@mseva/digit-ui-module-noc 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),n=require("react"),l=e(n),i=require("react-router-dom"),o=require("react-i18next"),a=require("react-query"),r=require("react-hook-form"),u=require("redux"),s=require("react-redux"),d=e(require("exif-js"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function v(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const m=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+i}return null},p=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},f=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],l=[],i=Digit.UserService.getUser().info.roles;return n.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&l.push(e?null==n||null===(a=n[o])||void 0===a?void 0:a.code:null==n?void 0:n[o])})})}),l},E=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=0),decodeURIComponent(e.split("?")[0].split("/").pop().slice(13))||"Document - "+(t+1)},g=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var h=function(e,t){return e===t||e!=e&&t!=t},A=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1},S=Array.prototype.splice;function b(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}b.prototype.clear=function(){this.__data__=[],this.size=0},b.prototype.delete=function(e){var t=this.__data__,n=A(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),--this.size,0))},b.prototype.get=function(e){var t=this.__data__,n=A(t,e);return n<0?void 0:t[n][1]},b.prototype.has=function(e){return A(this.__data__,e)>-1},b.prototype.set=function(e,t){var n=this.__data__,l=A(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var N=b,C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(e,t){return e(t={exports:{}},t.exports),t.exports}var y,L="object"==typeof C&&C&&C.Object===Object&&C,O="object"==typeof self&&self&&self.Object===Object&&self,T=L||O||Function("return this")(),I=T.Symbol,w=Object.prototype,R=w.hasOwnProperty,P=w.toString,x=I?I.toStringTag:void 0,B=Object.prototype.toString,F=I?I.toStringTag:void 0,M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=R.call(e,x),n=e[x];try{e[x]=void 0;var l=!0}catch(e){}var i=P.call(e);return l&&(t?e[x]=n:delete e[x]),i}(e):function(e){return B.call(e)}(e)},U=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!U(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},W=T["__core-js_shared__"],H=(y=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",j=Function.prototype.toString,z=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},V=/^\[object .+?Constructor\]$/,G=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!U(e)||(t=e,H&&H in t))&&(k(e)?G:V).test(z(e));var t}(n)?n:void 0},K=Y(T,"Map"),q=Y(Object,"create"),X=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Q.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return X.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:J.call(t,e)},Q.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this};var Z=Q,$=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(K||N),string:new Z}},ee.prototype.delete=function(e){var t=$(this,e).delete(e);return this.size-=t?1:0,t},ee.prototype.get=function(e){return $(this,e).get(e)},ee.prototype.has=function(e){return $(this,e).has(e)},ee.prototype.set=function(e,t){var n=$(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var te=ee;function ne(e){var t=this.__data__=new N(e);this.size=t.size}ne.prototype.clear=function(){this.__data__=new N,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof N){var l=n.__data__;if(!K||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(l)}return n.set(e,t),this.size=n.size,this};var le=ne,ie=function(){try{var e=Y(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),oe=function(e,t,n){"__proto__"==t&&ie?ie(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ae=Object.prototype.hasOwnProperty,re=function(e,t,n){var l=e[t];ae.call(e,t)&&h(l,n)&&(void 0!==n||t in e)||oe(e,t,n)},ue=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?oe(n,r,u):re(n,r,u)}return n},se=function(e){return null!=e&&"object"==typeof e},de=function(e){return se(e)&&"[object Arguments]"==M(e)},ce=Object.prototype,ve=ce.hasOwnProperty,me=ce.propertyIsEnumerable,pe=de(function(){return arguments}())?de:function(e){return se(e)&&ve.call(e,"callee")&&!me.call(e,"callee")},fe=Array.isArray,Ee=function(){return!1},_e=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ee}),ge=/^(?:0|[1-9]\d*)$/,he=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t},Ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var be=function(e){return function(t){return e(t)}},Ne=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&L.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ce=Ne&&Ne.isTypedArray,De=Ce?be(Ce):function(e){return se(e)&&Ae(e.length)&&!!Se[M(e)]},ye=Object.prototype.hasOwnProperty,Le=function(e,t){var n=fe(e),l=!n&&pe(e),i=!n&&!l&&_e(e),o=!n&&!l&&!i&&De(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!ye.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||he(s,u))||r.push(s);return r},Oe=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)},Ie=function(e,t){return function(n){return e(t(n))}},we=Ie(Object.keys,Object),Re=Object.prototype.hasOwnProperty,Pe=function(e){return null!=e&&Ae(e.length)&&!k(e)},xe=function(e){return Pe(e)?Le(e):function(e){if(!Te(e))return we(e);var t=[];for(var n in Object(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Be=Object.prototype.hasOwnProperty,Fe=function(e){return Pe(e)?Le(e,!0):function(e){if(!U(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var l in e)("constructor"!=l||!t&&Be.call(e,l))&&n.push(l);return n}(e)},Me=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Ue=function(){return[]},ke=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,He=We?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];ke.call(e,r)&&(a[o++]=r)}return a}(We(e)))}:Ue,je=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},ze=Ie(Object.getPrototypeOf,Object),Ve=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)je(t,He(e)),e=ze(e);return t}:Ue,Ge=function(e,t,n){var l=t(e);return fe(e)?l:je(l,n(e))},Ye=function(e){return Ge(e,xe,He)},Ke=function(e){return Ge(e,Fe,Ve)},qe=Y(T,"DataView"),Xe=Y(T,"Promise"),Je=Y(T,"Set"),Qe=Y(T,"WeakMap"),Ze=z(qe),$e=z(K),et=z(Xe),tt=z(Je),nt=z(Qe),lt=M;(qe&&"[object DataView]"!=lt(new qe(new ArrayBuffer(1)))||K&&"[object Map]"!=lt(new K)||Xe&&"[object Promise]"!=lt(Xe.resolve())||Je&&"[object Set]"!=lt(new Je)||Qe&&"[object WeakMap]"!=lt(new Qe))&&(lt=function(e){var t=M(e),n="[object Object]"==t?e.constructor:void 0,l=n?z(n):"";if(l)switch(l){case Ze:return"[object DataView]";case $e:return"[object Map]";case et:return"[object Promise]";case tt:return"[object Set]";case nt:return"[object WeakMap]"}return t});var it=lt,ot=Object.prototype.hasOwnProperty,at=T.Uint8Array,rt=function(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t},ut=/\w*$/,st=I?I.prototype:void 0,dt=st?st.valueOf:void 0,ct=Object.create,vt=function(){function e(){}return function(t){if(!U(t))return{};if(ct)return ct(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mt=Ne&&Ne.isMap,pt=mt?be(mt):function(e){return se(e)&&"[object Map]"==it(e)},ft=Ne&&Ne.isSet,Et=ft?be(ft):function(e){return se(e)&&"[object Set]"==it(e)},_t={};_t["[object Arguments]"]=_t["[object Array]"]=_t["[object ArrayBuffer]"]=_t["[object DataView]"]=_t["[object Boolean]"]=_t["[object Date]"]=_t["[object Float32Array]"]=_t["[object Float64Array]"]=_t["[object Int8Array]"]=_t["[object Int16Array]"]=_t["[object Int32Array]"]=_t["[object Map]"]=_t["[object Number]"]=_t["[object Object]"]=_t["[object RegExp]"]=_t["[object Set]"]=_t["[object String]"]=_t["[object Symbol]"]=_t["[object Uint8Array]"]=_t["[object Uint8ClampedArray]"]=_t["[object Uint16Array]"]=_t["[object Uint32Array]"]=!0,_t["[object Error]"]=_t["[object Function]"]=_t["[object WeakMap]"]=!1;var gt=function e(t,n,l,i,o,a){var r,u=1&n,s=2&n,d=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!U(t))return t;var c=fe(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ot.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var v=it(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(_e(t))return Me(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=s||m?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:vt(ze(e))}(t),!u)return s?function(e,t){return ue(e,Ve(e),t)}(t,function(e,t){return e&&ue(t,Fe(t),e)}(r,t)):function(e,t){return ue(e,He(e),t)}(t,function(e,t){return e&&ue(t,xe(t),e)}(r,t))}else{if(!_t[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,ut.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return dt?Object(dt.call(e)):{}}}(t,v,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),Et(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pt(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(d?s?Ke:Ye:s?Fe:xe)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),re(r,o,e(i,n,l,o,t,a))}),r},ht=function(e){return gt(e,5)};const At=e=>{var i,a;const{t:r}=o.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),s=Digit.ComponentRegistryService.getComponent("NOCSearchApplication"),d=f();let v=[];1==(null==d?void 0:d.length)&&(v=[null==d||null===(i=d[0])||void 0===i?void 0:i.code]),(null==d?void 0:d.length)>1&&(null==d||d.forEach(e=>{v.push(e.code)}));const[m,p]=n.useState({offset:0,limit:10,tenantId:u,nocType:v[0]}),E={offset:0,limit:10,tenantId:u,nocType:v[0]},_=window.Digit.Utils.browser.isMobile(),{data:g,isLoading:h,isSuccess:A,error:S}=Digit.Hooks.noc.useNOCSearchApplication(u,m,{});return l.createElement("div",null,l.createElement(t.CardHeader,{styles:_?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},r("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(s,{t:r,tenantId:u,onSubmit:function(e,t){void 0===t&&(t=!1);let n=ht(e),l=E;for(const[t,n]of Object.entries(e))null!=n&&null!=n&&""!=n&&(l=c({},l,{[t]:n}));p(1==t?n:l)},isLoading:h,Count:null==g?void 0:g.count,error:S,data:!h&&A&&(null==g||null===(a=g.Noc)||void 0===a?void 0:a.length)>0?g.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},St=e=>e.substr(0,1).toUpperCase()+e.substr(1),bt=(e,t)=>0===e?t("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+t("NOC_FLOOR_AREA_LABEL"),Nt=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y;let L=[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.applicantOwnerOrFirmName)||"N/A"},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.applicantEmailId)||"N/A"},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.applicationDetails)||void 0===d?void 0:d.applicantFatherHusbandName)||"N/A"},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber)||"N/A"},{title:t("NOC_APPLICANT_DOB_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.applicantDateOfBirth)||"N/A"},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(g=_.additionalDetails)||void 0===g||null===(h=g.applicationDetails)||void 0===h||null===(A=h.applicantGender)||void 0===A?void 0:A.code)||(null==e||null===(S=e.nocDetails)||void 0===S||null===(b=S.additionalDetails)||void 0===b||null===(N=b.applicationDetails)||void 0===N?void 0:N.applicantGender)||"N/A"},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(D=C.additionalDetails)||void 0===D||null===(y=D.applicationDetails)||void 0===y?void 0:y.applicantAddress)||"N/A"}];return{title:t("NOC_APPLICANT_DETAILS"),values:L}},Ct=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,J,Q,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,se,de,ce,ve,me,pe,fe,Ee,_e,ge,he,Ae,Se,be,Ne,Ce,De,ye,Le,Oe,Te,Ie,we,Re,Pe,xe,Be,Fe,Me,Ue,ke,We;let He=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress)||"N/A"},{title:t("NOC_ULB_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.siteDetails)||void 0===d||null===(c=d.ulbName)||void 0===c?void 0:c.name)||(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p?void 0:p.ulbName)||"N/A"},{title:t("NOC_ULB_TYPE_LABEL"),value:(null==e||null===(f=e.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E||null===(_=E.siteDetails)||void 0===_?void 0:_.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(g=e.nocDetails)||void 0===g||null===(h=g.additionalDetails)||void 0===h||null===(A=h.siteDetails)||void 0===A?void 0:A.khasraNo)||"N/A"},{title:t("NOC_HADBAST_NO_LABEL"),value:(null==e||null===(S=e.nocDetails)||void 0===S||null===(b=S.additionalDetails)||void 0===b||null===(N=b.siteDetails)||void 0===N?void 0:N.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(D=C.additionalDetails)||void 0===D||null===(y=D.siteDetails)||void 0===y||null===(L=y.roadType)||void 0===L?void 0:L.name)||(null==e||null===(O=e.nocDetails)||void 0===O||null===(T=O.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.roadType)||"N/A"},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:(null==e||null===(w=e.nocDetails)||void 0===w||null===(R=w.additionalDetails)||void 0===R||null===(P=R.siteDetails)||void 0===P?void 0:P.areaLeftForRoadWidening)||"N/A"},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:(null==e||null===(x=e.nocDetails)||void 0===x||null===(B=x.additionalDetails)||void 0===B||null===(F=B.siteDetails)||void 0===F?void 0:F.netPlotAreaAfterWidening)||"N/A"},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:(null==e||null===(M=e.nocDetails)||void 0===M||null===(U=M.additionalDetails)||void 0===U||null===(k=U.siteDetails)||void 0===k?void 0:k.roadWidthAtSite)||"N/A"},{title:t("NOC_DISTRICT_LABEL"),value:(null==e||null===(W=e.nocDetails)||void 0===W||null===(H=W.additionalDetails)||void 0===H||null===(j=H.siteDetails)||void 0===j||null===(z=j.district)||void 0===z?void 0:z.name)||(null==e||null===(V=e.nocDetails)||void 0===V||null===(G=V.additionalDetails)||void 0===G||null===(Y=G.siteDetails)||void 0===Y?void 0:Y.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(K=e.nocDetails)||void 0===K||null===(q=K.additionalDetails)||void 0===q||null===(X=q.siteDetails)||void 0===X||null===(J=X.zone)||void 0===J?void 0:J.name)||(null==e||null===(Q=e.nocDetails)||void 0===Q||null===(Z=Q.additionalDetails)||void 0===Z||null===($=Z.siteDetails)||void 0===$?void 0:$.zone)||"N/A"},{title:t("NOC_SITE_WARD_NO_LABEL"),value:(null==e||null===(ee=e.nocDetails)||void 0===ee||null===(te=ee.additionalDetails)||void 0===te||null===(ne=te.siteDetails)||void 0===ne?void 0:ne.wardNo)||"N/A"},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:(null==e||null===(le=e.nocDetails)||void 0===le||null===(ie=le.additionalDetails)||void 0===ie||null===(oe=ie.siteDetails)||void 0===oe?void 0:oe.villageName)||"N/A"},{title:t("NOC_SITE_COLONY_NAME_LABEL"),value:(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue?void 0:ue.colonyName)||"N/A"},{title:t("NOC_SITE_VASIKA_NO_LABEL"),value:(null==e||null===(se=e.nocDetails)||void 0===se||null===(de=se.additionalDetails)||void 0===de||null===(ce=de.siteDetails)||void 0===ce?void 0:ce.vasikaNumber)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(ve=e.nocDetails)||void 0===ve||null===(me=ve.additionalDetails)||void 0===me||null===(pe=me.siteDetails)||void 0===pe?void 0:pe.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(fe=e.nocDetails)||void 0===fe||null===(Ee=fe.additionalDetails)||void 0===Ee||null===(_e=Ee.siteDetails)||void 0===_e||null===(ge=_e.buildingStatus)||void 0===ge?void 0:ge.name)||(null==e||null===(he=e.nocDetails)||void 0===he||null===(Ae=he.additionalDetails)||void 0===Ae||null===(Se=Ae.siteDetails)||void 0===Se?void 0:Se.buildingStatus)||"N/A"},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(be=e.nocDetails)||void 0===be||null===(Ne=be.additionalDetails)||void 0===Ne||null===(Ce=Ne.siteDetails)||void 0===Ce||null===(De=Ce.isBasementAreaAvailable)||void 0===De?void 0:De.code)||(null==e||null===(ye=e.nocDetails)||void 0===ye||null===(Le=ye.additionalDetails)||void 0===Le||null===(Oe=Le.siteDetails)||void 0===Oe?void 0:Oe.isBasementAreaAvailable)||"N/A"}];var je,ze,Ve,Ge,Ye,Ke,qe,Xe,Je,Qe;return"BUILTUP"===(null==e||null===(Te=e.nocDetails)||void 0===Te||null===(Ie=Te.additionalDetails)||void 0===Ie||null===(we=Ie.siteDetails)||void 0===we||null===(Re=we.buildingStatus)||void 0===Re?void 0:Re.code)&&He.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(je=e.nocDetails)||void 0===je||null===(ze=je.additionalDetails)||void 0===ze||null===(Ve=ze.siteDetails)||void 0===Ve?void 0:Ve.basementArea)||"N/A"}),"BUILTUP"===(null==e||null===(Pe=e.nocDetails)||void 0===Pe||null===(xe=Pe.additionalDetails)||void 0===xe||null===(Be=xe.siteDetails)||void 0===Be||null===(Fe=Be.buildingStatus)||void 0===Fe?void 0:Fe.code)&&(null==e||null===(Ge=e.nocDetails)||void 0===Ge||null===(Ye=Ge.additionalDetails)||void 0===Ye||null===(Ke=Ye.siteDetails)||void 0===Ke||null===(qe=Ke.floorArea)||void 0===qe||qe.map((e,n)=>He.push({title:bt(n,t),value:null==e?void 0:e.value}))),"BUILTUP"===(null==e||null===(Me=e.nocDetails)||void 0===Me||null===(Ue=Me.additionalDetails)||void 0===Ue||null===(ke=Ue.siteDetails)||void 0===ke||null===(We=ke.buildingStatus)||void 0===We?void 0:We.code)&&He.push({title:t("NOC_TOTAL_FLOOR_AREA_LABEL"),value:(null==e||null===(Xe=e.nocDetails)||void 0===Xe||null===(Je=Xe.additionalDetails)||void 0===Je||null===(Qe=Je.siteDetails)||void 0===Qe?void 0:Qe.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:He}},Dt=(e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y,L,O,T,I,w,R;let P=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name)||(null==e||null===(s=e.nocDetails)||void 0===s||null===(d=s.additionalDetails)||void 0===d||null===(c=d.siteDetails)||void 0===c?void 0:c.specificationBuildingCategory)||"N/A"},{title:t("NOC_NOC_TYPE_LABEL"),value:(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p||null===(f=p.specificationNocType)||void 0===f?void 0:f.name)||(null==e||null===(E=e.nocDetails)||void 0===E||null===(_=E.additionalDetails)||void 0===_||null===(g=_.siteDetails)||void 0===g?void 0:g.specificationNocType)||"N/A"},{title:t("NOC_RESTRICTED_AREA_LABEL"),value:(null==e||null===(h=e.nocDetails)||void 0===h||null===(A=h.additionalDetails)||void 0===A||null===(S=A.siteDetails)||void 0===S||null===(b=S.specificationRestrictedArea)||void 0===b?void 0:b.code)||(null==e||null===(N=e.nocDetails)||void 0===N||null===(C=N.additionalDetails)||void 0===C||null===(D=C.siteDetails)||void 0===D?void 0:D.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(y=e.nocDetails)||void 0===y||null===(L=y.additionalDetails)||void 0===L||null===(O=L.siteDetails)||void 0===O||null===(T=O.specificationIsSiteUnderMasterPlan)||void 0===T?void 0:T.code)||(null==e||null===(I=e.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(R=w.siteDetails)||void 0===R?void 0:R.specificationIsSiteUnderMasterPlan)||"N/A"}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:P}},yt=function(e,t){try{var n;function l(n){var l;return{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e||null===(l=e.documents)||void 0===l?void 0:l.length)>0?e.documents.map((e,l)=>{let i=g(null==n?void 0:n.data,null==e?void 0:e.uuid);return console.log("doc link",i),{title:t((null==e?void 0:e.documentType)||t("CS_NA")),value:E(i,l)||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(l):l(o))}catch(e){return Promise.reject(e)}},Lt=function(e,t,n){try{var l,i,o,a;const u=e||{};console.log("appData here in DownloadACK",u);let s=[];return null!=u&&null!==(l=u.nocDetails)&&void 0!==l&&null!==(i=l.additionalDetails)&&void 0!==i&&null!==(o=i.applicationDetails)&&void 0!==o&&o.professionalName&&s.push(((e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,m,p,f,E;let _=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(d=s.applicationDetails)||void 0===d?void 0:d.professionalRegId)||"N/A"},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.professionalMobileNumber)||"N/A"},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:_}})(u,n)),Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(r=n("ULBGRADE_"+(null==t||null===(a=t.city)||void 0===a?void 0:a.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),r.toLowerCase().split(" ").map(St).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("NOC_REGISTRATION_CERTIFICATE"),applicationNumber:(null==u?void 0:u.applicationNo)||"NA",details:[...s,Nt(u,n),Ct(u,n),Dt(u,n),yt(u,n)]})}catch(e){return Promise.reject(e)}var r},Ot=e=>{var n,a,r;const u=i.useLocation(),{pathname:s,state:d}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==d||null===(n=d.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];window.localStorage.getItem("Employee.tenant-id"),console.log("nocData in Response",m);const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=s.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Lt(e,t,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/employee/noc/inbox")}}))))},Tt=e=>{let{location:n}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},It=e=>{var a,r,u,s,d,v,m,p,f,E;let{path:_}=e;const g=i.useLocation(),h=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),A=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NOCInbox"),S=null===(d=Digit)||void 0===d||null===(v=d.ComponentRegistryService)||void 0===v?void 0:v.getComponent("NewNOCStepperForm"),b=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview"),N=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("NewNOCEditApplication"),C=window.location.href.includes("/response"),D=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,C?null:l.createElement("div",{style:window.location.href.includes("application-overview")||D?{marginLeft:"10px"}:{}},l.createElement(Tt,{location:g})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:_+"/inbox/application-overview/:id",component:b}),l.createElement(t.PrivateRoute,{path:_+"/search/application-overview/:id",component:h}),l.createElement(t.PrivateRoute,{path:_+"/new-application",component:S}),l.createElement(t.PrivateRoute,{path:_+"/edit-application/:id",component:N}),l.createElement(t.PrivateRoute,{path:_+"/inbox",component:e=>l.createElement(A,c({},e,{parentRoute:_}))}),l.createElement(t.PrivateRoute,{path:_+"/search",component:e=>l.createElement(At,c({},e,{parentRoute:_}))}),l.createElement(t.PrivateRoute,{path:_+"/response/:id",component:Ot})))};function wt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Rt=e=>l.createElement("h1",{className:"heading-m"},e.label),Pt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),xt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pt,null)),Bt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:g}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,A]=n.useState({}),[S,b]=n.useState({}),[N,C]=n.useState([]),[D,y]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,R]=n.useState(null),[P,x]=n.useState([]),[B,F]=n.useState(null),[M,U]=n.useState(!1);function k(e){O(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&x(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",L,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(){R(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[L]),n.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:B,setSelectedFinancialYear:F}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:N,selectedApprover:D,setSelectedApprover:y,selectFile:k,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,N,P,B,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Rt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(xt,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:E||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==B?void 0:B.name,propertyId:null==v?void 0:v.propertyId,tenantId:u,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:T}]),d({Property:c({},v,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Ft=e=>l.createElement("h1",{className:"heading-m"},e.label),Mt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ut=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Mt,null)),kt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,g]=n.useState({}),[h,A]=n.useState({}),[S,b]=n.useState([]),[N,C]=n.useState({}),[D,y]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,R]=n.useState([]),[P,x]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&R(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function F(e){y(e.target.files[0])}return n.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{d(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:N,setSelectedApprover:C,selectFile:F,uploadedFile:L,setUploadedFile:O,businessService:m}))},[r,S,w,P,L]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ft,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Ut,{onClick:s}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null,wfDocuments:L?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:L}]:null}),d({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Wt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ht=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),jt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ht,null)),zt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[b,N]=n.useState({}),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{d(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:A,selectedApprover:b,setSelectedApprover:N,selectFile:w,uploadedFile:y,setUploadedFile:L,businessService:m,error:O}))},[r,A,y,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Wt,{label:a(E.label.heading)}),headerBarEnd:l.createElement(jt,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:null}),d({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Vt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Gt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Yt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gt,null)),Kt=e=>{var i,o,r,u,s,d,v,m,p,f,E,_;let{t:g,action:h,tenantId:A,closeModal:S,submitAction:b,applicationDetails:N,applicationData:C,businessService:D,workflowDetails:y,blockReason:L}=e;console.log("applicationData_BPAACTIONMODAL",C),console.log("workflowDetails_BPAACTIONMODAL",y),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:A,!1);const{data:O,isLoading:T}=Digit.Hooks.useEmployeeSearch(A,{roles:null==y||null===(v=y.data)||void 0===v||null===(m=v.initialActionState)||void 0===m||null===(p=m.nextActions)||void 0===p||null===(f=p.filter(e=>(null==e?void 0:e.action)==(null==h?void 0:h.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=h&&h.isTerminateState)}),[I,w]=(a.useQueryClient(),n.useState({})),[R,P]=n.useState({}),[x,B]=n.useState([]),[F,M]=n.useState([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,K]=n.useState(null),[q,X]=n.useState(null),J=!!Digit.Utils.browser.isMobile();function Q(e){z(e.target.files[0])}n.useEffect(()=>{var e;B(null==O||null===(e=O.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[O]),n.useEffect(()=>{!function(){try{K(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)K(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))K(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==A?void 0:A.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):K(g("CS_FILE_UPLOAD_ERROR"))})},function(){K(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[j]);const Z=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{M(null==L?void 0:L.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),h&&w((e=>{var n,i,o,a,r,u,s;let{t:d,action:c,approvers:v,selectedApprover:m,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:_,uploadedFile:g,setUploadedFile:h,assigneeLabel:A,businessService:S,error:b,blockReasonFiltered:N}=e,C=!1;return"REVOCATE"!=(null==c?void 0:c.action)&&"REJECT"!=(null==c?void 0:c.action)&&"SKIP_PAYMENT"!=c.action&&"SEND_BACK_TO_CITIZEN"!=(null==c?void 0:c.action)&&"APPROVE"!=(null==c?void 0:c.action)||(C=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+S+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(i=c.state)||void 0===i?void 0:i.state)?null:d(A||"WF_ROLE_"+(null===(o=c.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:p,selected:m})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?d("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(s=c.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:N,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:d("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+d("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:_,onDelete:()=>{h(null)},message:g?"1 "+d("ES_PT_ACTION_FILEUPLOADED"):d("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:g,action:h,approvers:x,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:Q,uploadedFile:V,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:F}))},[h,x,q,V,Y]),h&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vt,{label:g(I.label.heading)}),headerBarEnd:l.createElement(Yt,{onClick:S}),actionCancelLabel:g(I.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:g(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:J?{width:"720px"}:{},style:J?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:J?{paddingLeft:"5px"}:{}},T?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,u,s,d,v,m,p,f,E,_,A,D,L,O,T,I,w,R,P,x,B,F,M,k,H,z,G,Y,K,q,X,J,Q,Z,$,ne;if(C=c({},C,{documents:null===(t=C)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(n=C)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:te(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==h?void 0:h.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(o=y.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==y||null===(s=y.data)||void 0===s||null===(d=s.processInstances)||void 0===d||null===(v=d[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(p=y.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.state)||void 0===_?void 0:_.applicationStatus)?[null==y||null===(A=y.data)||void 0===A||null===(D=A.processInstances)||void 0===D||null===(L=D[0])||void 0===L||null===(O=L.assigner)||void 0===O?void 0:O.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==h?void 0:h.action,riskType:null===(T=C)||void 0===T||null===(I=T.additionalDetails)||void 0===I?void 0:I.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(w=y.data)||void 0===w||null===(R=w.processInstances)||void 0===R||null===(P=R[0])||void 0===P||null===(x=P.state)||void 0===x?void 0:x.applicationStatus)?[null==y||null===(B=y.data)||void 0===B||null===(F=B.processInstances)||void 0===F||null===(M=F[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(H=C)||void 0===H||null===(z=H.additionalDetails)||void 0===z||null===(G=z.selfCertificationCharges)||void 0===G?void 0:G.BPA_MALBA_CHARGES)+parseInt(null===(Y=C)||void 0===Y||null===(K=Y.additionalDetails)||void 0===K||null===(q=K.selfCertificationCharges)||void 0===q?void 0:q.BPA_LABOUR_CESS)+parseInt(null===(X=C)||void 0===X||null===(J=X.additionalDetails)||void 0===J||null===(Q=J.selfCertificationCharges)||void 0===Q?void 0:Q.BPA_WATER_CHARGES)+parseInt(null===(Z=C)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(ne=$.selfCertificationCharges)||void 0===ne?void 0:ne.BPA_GAUSHALA_CHARGES_CESS))S(),alert(g("Enterd Less Adjustment amount is invalid"));else{var le,ie;const e=null==N||null===(le=N.nocData)||void 0===le?void 0:le.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];if(e&&e.map(e=>{var t,o,a,r,u,s,d,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(d=e.Noc)||void 0===d||null===(c=d.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(S(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(t.Loader,null)},qt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Xt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xt,null)),Qt=e=>{var o,r;let{t:u,action:s,tenantId:d,closeModal:v,submitAction:m,applicationData:p,businessService:f}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(o=s.assigneeRoles)||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[g,h]=(a.useQueryClient(),n.useState({})),[A,S]=n.useState({}),[b,N]=n.useState([]),[C,D]=n.useState({}),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function P(e){L(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;N(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",y,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(u("CS_FILE_UPLOAD_ERROR"))})},function(){w(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{s&&h((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},showHint:!0,message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:D,selectFile:P,uploadedFile:O,setUploadedFile:T,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,b,O,I]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(qt,{label:u(g.label.heading)}),headerBarEnd:l.createElement(Jt,{onClick:v}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=p)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=p)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),p=c({},p,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:O?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null},documents:o}),m({Noc:p},!1,{isNoc:!0})},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},Zt=e=>l.createElement("h1",{className:"heading-m"},e.label),$t=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),en=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($t,null)),tn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},nn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[b,N]=n.useState({}),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{v(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:b,setSelectedApprover:N,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m,error:O})):r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{c(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:b,setSelectedApprover:N,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m,error:O}))},[r,A,y,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zt,{label:a(E.label.heading)}),headerBarEnd:l.createElement(en,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,_,g,h,A,S,N,D,L;const t=c({},null===(E=v)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=c({},null===(g=v)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(A=h.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=v)&&void 0!==S&&null!==(N=S.applicationType)&&void 0!==N&&N.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=v)&&void 0!==D&&null!==(L=D.applicationType)&&void 0!==L&&L.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:[]}});d({AmendmentUpdate:n})}else{if(v=c({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:null,processInstance:c({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ht(null==e?void 0:e.date);v.disconnectionExecutionDate=tn(t)}else if(null!=e&&e.date){const t=ht(null==e?void 0:e.date);v.connectionExecutionDate=tn(t)}var O;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(m=s.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=v)||void 0===O?void 0:O.serviceType)?d({WaterConnection:v,disconnectRequest:!0}):d({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,R,P,x,B,F,M,U,k,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},ln=e=>l.createElement("h1",{className:"heading-m"},e.label),on=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),an=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(on,null)),rn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[b,N]=n.useState(null),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:A,selectedApprover:b,setSelectedApprover:N,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m}))},[r,A,y]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ln,{label:a(E.label.heading)}),headerBarEnd:l.createElement(an,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};v.creationReason="CREATE",d({PetRegistrationApplications:[c({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],y&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]),d({PetRegistrationApplications:[c({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},un=e=>l.createElement("h1",{className:"heading-m"},e.label),sn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),dn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sn,null)),cn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:d,applicationData:v,businessService:m}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[_,g]=n.useState({}),[h,A]=n.useState({}),[S,b]=n.useState([]),[N,C]=n.useState(""),[D,y]=n.useState([]),[L,O]=n.useState(null),T=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=n.useMemo(()=>{var e;if(E||!f||!T.length)return[];const t=new Set(T.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[E,f,T]);return console.log("years",I),n.useEffect(()=>{u&&g((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:N,setSelectedApprover:C,businessService:m}))},[u,I,D,L]),u&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(un,{label:r(_.label.heading)}),headerBarEnd:l.createElement(dn,{onClick:s}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=c({},v,{financialYear:i,action:"INITIATE",additionalDetail:c({},v.additionalDetail,{validityYears:N.length>0?parseInt(N):""})}),d({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},vn=e=>l.createElement("h1",{className:"heading-m"},e.label),mn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mn,null)),fn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[b,N]=n.useState(null),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){w(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:s,setSelectedApprover:d,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:d,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:b,setSelectedApprover:N,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m,isUploading:I}))},[r,A,y]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(pn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};y&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]),d({streetVendingDetail:c({},v,{workflow:n})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},En=e=>l.createElement("h1",{className:"heading-m"},e.label),_n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_n,null)),hn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[b,N]=n.useState(null),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:b,setSelectedApprover:N,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m}))},[r,A,y]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(En,{label:a(E.label.heading)}),headerBarEnd:l.createElement(gn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};y&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:y}]),d({hallsBookingApplication:[c({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},An=e=>l.createElement("h1",{className:"heading-m"},e.label),Sn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Sn,null)),Nn=e=>{var o,a,r;let{t:u,action:s,tenantId:d,closeModal:v,submitAction:m,applicationData:p,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(o=s.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),g=i.useHistory(),[h,A]=n.useState({}),[S,b]=n.useState({}),[N,C]=n.useState([]),[D,y]=n.useState(null),[L,O]=n.useState(null);return n.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:N,selectedApprover:D,setSelectedApprover:y,uploadedFile:L,setUploadedFile:O,businessService:f}))},[s,N,L]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(An,{label:u(h.label.heading)}),headerBarEnd:l.createElement(bn,{onClick:v}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};L&&(t.documents=[]),m({Asset:c({},p,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Cn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Bt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(rn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(kt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(cn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(zt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Kt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Qt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(nn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(fn,e):null!=e&&e.businessService.includes("chb")?l.createElement(hn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Nn,e):void 0;var Dn=D(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",d="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",b="[object Float32Array]",N="[object Float64Array]",D="[object Int8Array]",y="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,F=RegExp(x.source),M=RegExp(B.source),U=/<%-([\s\S]+?)%>/g,k=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,$=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,de="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",me="["+de+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Ne="(?:"+Se+"|"+Ee+")",Ce="(?:"+me+"|"+_e+")?",De="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",ye="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+De,Le="(?:"+[ge+me+"?",me,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),Te=RegExp(me,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Le+De,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",Ne+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pe,ye].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,Fe={};Fe[b]=Fe[N]=Fe[D]=Fe[y]=Fe[L]=Fe[O]=Fe["[object Uint8ClampedArray]"]=Fe[T]=Fe[I]=!0,Fe[o]=Fe[a]=Fe[A]=Fe[r]=Fe[S]=Fe[u]=Fe[s]=Fe[d]=Fe[v]=Fe[m]=Fe[p]=Fe[f]=Fe[E]=Fe[_]=Fe[h]=!1;var Me={};Me[o]=Me[a]=Me[A]=Me[S]=Me[r]=Me[u]=Me[b]=Me[N]=Me[D]=Me[y]=Me[L]=Me[v]=Me[m]=Me[p]=Me[f]=Me[E]=Me[_]=Me[g]=Me[O]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[s]=Me[d]=Me[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof C&&C&&C.Object===Object&&C,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ye=Ge&&Ge.exports===Ve,Ke=Ye&&He.process,qe=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Xe=qe&&qe.isArrayBuffer,Je=qe&&qe.isDate,Qe=qe&&qe.isMap,Ze=qe&&qe.isRegExp,$e=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function dt(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function At(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Nt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Dt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function yt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Lt(e){return function(t){return e(t)}}function Ot(e,t){return st(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Bt(e){return"\\"+Ue[e]}function Ft(e){return Re.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ut(e,t){return function(n){return e(t(n))}}function kt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function jt(e){return Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Gt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var C=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,K=t.Date,de=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,_e=C.prototype,ge=me.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Se=ge.hasOwnProperty,be=0,Ne=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,De=Ae.call(me),ye=ze._,Le=pe("^"+Ae.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,Re=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=ge.propertyIsEnumerable,Ke=_e.splice,qe=Re?Re.isConcatSpreadable:void 0,pt=Re?Re.iterator:void 0,bt=Re?Re.toStringTag:void 0,Kt=function(){try{var e=Qi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=K&&K.now!==ze.Date.now&&K.now,Jt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Zt=ve.floor,$t=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=_e.join,ln=Ut(me.keys,me),on=ve.max,an=ve.min,rn=K.now,un=t.parseInt,sn=ve.random,dn=_e.reverse,cn=Qi(t,"DataView"),vn=Qi(t,"Map"),mn=Qi(t,"Promise"),pn=Qi(t,"Set"),fn=Qi(t,"WeakMap"),En=Qi(me,"create"),_n=fn&&new fn,gn={},hn=Lo(cn),An=Lo(vn),Sn=Lo(mn),bn=Lo(pn),Nn=Lo(fn),Cn=Re?Re.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,yn=Cn?Cn.toString:void 0;function Ln(e){if(Va(e)&&!Pa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Se.call(e,"__wrapped__"))return Oo(e)}return new In(e)}var On=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=Pa(e),l=!n&&Ra(e),i=!n&&!l&&Ma(e),o=!n&&!l&&!i&&Za(e),a=n||l||i||o,r=a?Dt(e.length,fe):[],u=r.length;for(var s in e)!t&&!Se.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||io(s,u))||r.push(s);return r}function Un(e){var t=e.length;return t?e[xl(0,t-1)]:void 0}function kn(e,t){return bo(fi(e),qn(t,0,e.length))}function Wn(e){return bo(fi(e))}function Hn(e,t,n){(void 0!==n&&!Ta(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];Se.call(e,t)&&Ta(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Ta(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return $n(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&Ei(t,Ar(t),e)}function Yn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,i=C(l),o=null==e;++n<l;)i[n]=o?void 0:fr(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var s,h=1&t,C=2&t,w=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!za(e))return e;var R=Pa(e);if(R){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return fi(e,s)}else{var P=eo(e),x=P==d||P==c;if(Ma(e))return si(e,h);if(P==p||P==o||x&&!i){if(s=C||x?{}:no(e),!h)return C?function(e,t){return Ei(e,$i(e),t)}(e,function(e,t){return e&&Ei(t,Sr(t),e)}(s,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Gn(s,e))}else{if(!Me[P])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case A:return di(e);case r:case u:return new l(+e);case S:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case N:case D:case y:case L:case O:case"[object Uint8ClampedArray]":case T:case I:return ci(e,n);case v:return new l;case m:case _:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case g:return Dn?me(Dn.call(e)):{}}}(e,P,h)}}a||(a=new Fn);var B=a.get(e);if(B)return B;a.set(e,s),Xa(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,a))});var F=R?void 0:(w?C?Vi:zi:C?Sr:Ar)(e);return lt(F||e,function(l,i){F&&(l=e[i=l]),jn(s,i,Xn(l,t,n,i,e,a))}),s}function Jn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new Ee(n);return go(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,Lt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Bn(t));e:for(;++i<r;){var d=e[i],c=null==n?d:n(d);if(d=l||0!==d?d:0,a&&c==c){for(var v=s;v--;)if(t[v]===c)continue e;u.push(d)}else o(t,c,l)||u.push(d)}return u}Ln.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:Ln}},(Ln.prototype=Tn.prototype).constructor=Ln,(In.prototype=On(Tn.prototype)).constructor=In,(wn.prototype=On(Tn.prototype)).constructor=wn,Rn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Se.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return zn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||Pn),string:new Rn}},xn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},xn.prototype.get=function(e){return Xi(this,e).get(e)},xn.prototype.has=function(e){return Xi(this,e).has(e)},xn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new xn(l)}return n.set(e,t),this.size=n.size,this};var $n=hi(rl),el=hi(ul,!0);function tl(e,t){var n=!0;return $n(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Qa(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return $n(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):dt(i,r):l||(i[i.length]=r)}return i}var ol=Ai(),al=Ai(!0);function rl(e,t){return e&&ol(e,t,Ar)}function ul(e,t){return e&&al(e,t,Ar)}function sl(e,t){return at(t,function(t){return Wa(e[t])})}function dl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[yo(t[n++])];return n&&n==l?e:void 0}function cl(e,t,n){var l=t(e);return Pa(e)?l:dt(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in me(e)?function(e){var t=Se.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Se.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=C(o),u=Infinity,s=[];a--;){var d=e[a];a&&t&&(d=st(d,Lt(t))),u=an(d.length,u),r[a]=!n&&(t||i>=120&&d.length>=120)?new Bn(a&&d):void 0}d=e[0];var c=-1,v=r[0];e:for(;++c<i&&s.length<u;){var m=d[c],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Tt(v,p):l(s,p,n))){for(a=o;--a;){var f=r[a];if(!(f?Tt(f,p):l(e[a],p,n)))continue e}v&&v.push(p),s.push(m)}}return s}function _l(e,t,n){var l=null==(e=po(e,t=oi(t,e)))?e:e[yo(ko(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Va(e)&&vl(e)==o}function hl(e,t,n,l,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,i,d){var c=Pa(e),h=Pa(t),b=c?a:eo(e),N=h?a:eo(t),C=(b=b==o?p:b)==p,D=(N=N==o?p:N)==p,y=b==N;if(y&&Ma(e)){if(!Ma(t))return!1;c=!0,C=!1}if(y&&!C)return d||(d=new Fn),c||Za(e)?Hi(e,t,n,l,i,d):function(e,t,n,l,i,o,a){switch(n){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case u:case m:return Ta(+e,+t);case s:return e.name==t.name&&e.message==t.message;case f:case _:return e==t+"";case v:var d=Mt;case E:if(d||(d=Wt),e.size!=t.size&&!(1&l))return!1;var c=a.get(e);if(c)return c==t;l|=2,a.set(e,t);var p=Hi(d(e),d(t),l,i,o,a);return a.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,b,n,l,i,d);if(!(1&n)){var L=C&&Se.call(e,"__wrapped__"),O=D&&Se.call(t,"__wrapped__");if(L||O){var T=L?e.value():e,I=O?t.value():t;return d||(d=new Fn),i(T,I,n,l,d)}}return!!y&&(d||(d=new Fn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var s=u;s--;){var d=r[s];if(!(a?d in t:Se.call(t,d)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++s<u;){var f=e[d=r[s]],E=t[d];if(l)var _=a?l(E,f,d,t,e,o):l(f,E,d,e,t,o);if(!(void 0===_?f===E||i(f,E,n,l,o):_)){m=!1;break}p||(p="constructor"==d)}if(m&&!p){var g=e.constructor,h=t.constructor;g==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,d))}(e,t,n,l,hl,i))}function Al(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],d=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var c=new Fn;if(l)var v=l(s,d,u,e,t,c);if(!(void 0===v?hl(d,s,3,l,c):v))return!1}}return!0}function Sl(e){return!(!za(e)||(t=e,Ne&&Ne in t))&&(Wa(e)?Le:ie).test(Lo(e));var t}function bl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Ll(e[0],e[1]):yl(e):tu(e)}function Nl(e){if(!so(e))return ln(e);var t=[];for(var n in me(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=Ba(e)?C(e.length):[];return $n(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function yl(e){var t=Ji(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Al(n,e,t)}}function Ll(e,t){return ao(e)&&co(t)?vo(yo(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):hl(t,l,3)}}function Ol(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Fn),za(o))!function(e,t,n,l,i,o,a){var r=Eo(e,n),u=Eo(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var d=o?o(r,u,n+"",e,t,a):void 0,c=void 0===d;if(c){var v=Pa(u),m=!v&&Ma(u),p=!v&&!m&&Za(u);d=u,v||m||p?Pa(r)?d=r:Fa(r)?d=fi(r):m?(c=!1,d=si(u,!0)):p?(c=!1,d=ci(u,!0)):d=[]:Ka(u)||Ra(u)?(d=r,Ra(r)?d=ar(r):za(r)&&!Wa(r)||(d=no(u))):c=!1}c&&(a.set(u,d),i(d,u,l,o,a),a.delete(u)),Hn(e,n,d)}}(e,t,a,n,Ol,l,i);else{var r=l?l(Eo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hn(e,a,r)}},Sr)}function Tl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Pa(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=st(t,Lt(qi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=dl(e,a);n(r,a)&&kl(o,oi(a,e),r)}return o}function Rl(e,t,n,l){var i=l?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),n&&(r=st(e,Lt(n)));++o<a;)for(var u=0,s=t[o],d=n?n(s):s;(u=i(r,d,u,l))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?Ke.call(e,i,1):Ql(e,i)}}return e}function xl(e,t){return e+Zt(sn()*(t-e+1))}function Bl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fl(e,t){return ho(mo(e,t,Yr),e+"")}function Ml(e){return Un(Tr(e))}function Ul(e,t){var n=Tr(e);return bo(n,qn(t,0,n.length))}function kl(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=yo(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var d=r[u];void 0===(s=l?l(d,u,r):void 0)&&(s=za(d)?d:io(t[i+1])?[]:{})}jn(r,u,s),r=r[u]}return e}var Wl=_n?function(e,t){return _n.set(e,t),e}:Yr,Hl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return bo(Tr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=C(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return $n(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Qa(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Qa(t),s=void 0===t;i<o;){var d=Zt((i+o)/2),c=n(e[d]),v=void 0!==c,m=null===c,p=c==c,f=Qa(c);if(a)var E=l||p;else E=s?p&&(l||v):r?p&&v&&(l||!m):u?p&&v&&!m&&(l||!f):!m&&!f&&(l?c<=t:c<t);E?i=d+1:o=d}return an(o,4294967294)}function Kl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ta(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function ql(e){return"number"==typeof e?e:Qa(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Pa(e))return st(e,Xl)+"";if(Qa(e))return yn?yn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Jl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var s=t?null:Bi(e);if(s)return Wt(s);a=!1,i=Tt,u=new Bn}else u=t?[]:r;e:for(;++l<o;){var d=e[l],c=t?t(d):d;if(d=n||0!==d?d:0,a&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),r.push(d)}else i(u,c,n)||(u!==r&&u.push(c),r.push(d))}return r}function Ql(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[yo(ko(t))]}function Zl(e,t,n,l){return kl(e,t,n(dl(e,t)),l)}function $l(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof wn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,dt([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Jl(e[0]):[];for(var i=-1,o=C(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Zn(o[i]||a,e[r],t,n));return Jl(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Fa(e)?e:[]}function ii(e){return"function"==typeof e?e:Yr}function oi(e,t){return Pa(e)?e:ao(e,t)?[e]:Do(rr(e))}var ai=Fl;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=qt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function di(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function ci(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Qa(e),a=void 0!==t,r=null===t,u=t==t,s=Qa(t);if(!r&&!s&&!o&&e>t||o&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,s=on(o-a,0),d=C(u+s),c=!l;++r<u;)d[r]=t[r];for(;++i<a;)(c||i<o)&&(d[n[i]]=e[i]);for(;s--;)d[r++]=e[i++];return d}function pi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,s=t.length,d=on(o-r,0),c=C(d+s),v=!l;++i<d;)c[i]=e[i];for(var m=i;++u<s;)c[m+u]=t[u];for(;++a<r;)(v||i<o)&&(c[m+n[a]]=e[i++]);return c}function fi(e,t){var n=-1,l=e.length;for(t||(t=C(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Yn(n,r,u):jn(n,r,u)}return n}function _i(e,t){return function(n,l){var i=Pa(n)?nt:Vn,o=t?t():{};return i(n,e,qi(l,2),o)}}function gi(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function hi(e,t){return function(n,l){if(null==n)return n;if(!Ba(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Ai(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function Si(e){return function(t){var n=Ft(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return ct(Wr(Rr(t).replace(Oe,"")),e,"")}}function Ni(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=On(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!Ba(t)){var o=qi(n,3);t=Ar(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return ji(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Ee(n);if(o&&!r&&"wrapper"==Yi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=Yi(a=t[i]),s="wrapper"==u?Gi(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Yi(s[0])].apply(r,s[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Pa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function yi(e,t,n,l,i,o,a,r,u,s){var d=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:Ni(e);return function E(){for(var _=arguments.length,g=C(_),h=_;h--;)g[h]=arguments[h];if(m)var A=Ki(E),S=Rt(g,A);if(l&&(g=mi(g,l,i,m)),o&&(g=pi(g,o,a,m)),_-=S,m&&_<s){var b=kt(g,A);return Pi(e,t,yi,E.placeholder,n,g,b,r,u,s-_)}var N=c?n:this,D=v?N[e]:e;return _=g.length,r?g=fo(g,r):p&&_>1&&g.reverse(),d&&u<_&&(g.length=u),this&&this!==ze&&this instanceof E&&(D=f||Ni(D)),D.apply(N,g)}}function Li(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Oi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function Ti(e){return ji(function(t){return t=st(t,Lt(qi())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Bl(t,e):t;var l=Bl(t,Qt(e/jt(t)));return Ft(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n,l){for(var i=-1,o=on(Qt((t-e)/(n||1)),0),a=C(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=or(t),n=or(n)),e(t,n)}}function Pi(e,t,n,l,i,o,a,r,u,s){var d=8&t;t|=d?32:64,4&(t&=~(d?64:32))||(t&=-4);var c=[e,t,i,d?o:void 0,d?a:void 0,d?void 0:o,d?void 0:a,r,u,s],v=n.apply(void 0,c);return ro(e)&&_o(v,c),v.placeholder=l,Ao(v,e,t)}function xi(e){var t=ve[e];return function(e,n){if(e=or(e),(n=null==n?0:an(lr(n),292))&&tn(e)){var l=(rr(e)+"e").split("e");return+((l=(rr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Bi=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Qr;function Fi(e){return function(t){var n=eo(t);return n==v?Mt(t):n==E?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,s){var d=2&t;if(!d&&"function"!=typeof e)throw new Ee(n);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:on(lr(u),0),s=void 0===s?s:lr(s),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=d?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,u,s];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?kt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(s=f[9]=void 0===f[9]?d?0:e.length:on(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ni(e);return function i(){for(var o=arguments.length,a=C(o),r=o,u=Ki(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:kt(a,u);if((o-=s.length)<n)return Pi(e,t,yi,i.placeholder,void 0,a,s,void 0,void 0,n-o);var d=this&&this!==ze&&this instanceof i?l:e;return tt(d,this,a)}}(e,t,s):32!=t&&33!=t||a.length?yi.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ni(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,d=C(s+r),c=this&&this!==ze&&this instanceof t?o:e;++u<s;)d[u]=l[u];for(;r--;)d[u++]=arguments[++a];return tt(c,i?n:this,d)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ni(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return Ao((p?Wl:_o)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ta(e,ge[n])&&!Se.call(l,n)?t:e}function ki(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ol(e,t,void 0,ki,o),o.delete(t)),e}function Wi(e){return Ka(e)?void 0:e}function Hi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=o.get(e),d=o.get(t);if(s&&d)return s==t&&d==e;var c=-1,v=!0,m=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,o):l(p,f,c,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,xo),e+"")}function zi(e){return cl(e,Ar,Zi)}function Vi(e){return cl(e,Sr,$i)}var Gi=_n?function(e){return _n.get(e)}:Qr;function Yi(e){for(var t=e.name+"",n=gn[t],l=Se.call(gn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(Se.call(Ln,"placeholder")?Ln:e).placeholder}function qi(){var e=Ln.iteratee||Kr;return e=e===Kr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ji(e){for(var t=Ar(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Zi=$t?function(e){return null==e?[]:(e=me(e),at($t(e),function(t){return Ge.call(e,t)}))}:iu,$i=$t?function(e){for(var t=[];e;)dt(t,Zi(e)),e=je(e);return t}:iu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=yo(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Pa(e)||Ra(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:On(je(e))}function lo(e){return Pa(e)||Ra(e)||!!(qe&&e&&e[qe])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Ba(n)&&io(t,n.length):"string"==l&&t in n)&&Ta(n[t],e)}function ao(e,t){if(Pa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qa(e))||j.test(e)||!H.test(e)||null!=t&&e in me(t)}function ro(e){var t=Yi(e),n=Ln[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(cn&&eo(new cn(new ArrayBuffer(1)))!=S||vn&&eo(new vn)!=v||mn&&"[object Promise]"!=eo(mn.resolve())||pn&&eo(new pn)!=E||fn&&eo(new fn)!=h)&&(eo=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Lo(n):"";if(l)switch(l){case hn:return S;case An:return v;case Sn:return"[object Promise]";case bn:return E;case Nn:return h}return t});var uo=he?Wa:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!za(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=C(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=C(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:dl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=So(Wl),go=Jt||function(e,t){return ze.setTimeout(e,t)},ho=So(Hl);function Ao(e,t,n){var l=t+"";return ho(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(J):[]}(l),n)))}function So(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=xl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var No,Co,Do=(No=Na(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace($,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=No.cache,No);function yo(e){if("string"==typeof e||Qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Fl(function(e,t){return Fa(e)?Zn(e,il(t,1,Fa,!0)):[]}),Io=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),qi(n,2)):[]}),wo=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),void 0,n):[]});function Ro(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),Et(e,qi(t,3),i)}function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=lr(n),i=n<0?on(l+i,0):an(i,l-1)),Et(e,qi(t,3),i,!0)}function xo(e){return null!=e&&e.length?il(e,1):[]}function Bo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?El(t):[]}),Mo=Fl(function(e){var t=ko(e),n=st(e,li);return t===ko(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,qi(t,2)):[]}),Uo=Fl(function(e){var t=ko(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ko(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wo=Fl(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Pl(e,st(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function zo(e){return null==e?e:dn.call(e)}var Vo=Fl(function(e){return Jl(il(e,1,Fa,!0))}),Go=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),Jl(il(e,1,Fa,!0),qi(t,2))}),Yo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,Jl(il(e,1,Fa,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=on(e.length,t),!0}),Dt(t,function(t){return st(e,St(t))})}function qo(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fa(e)?Zn(e,t):[]}),Jo=Fl(function(e){return ti(at(e,Fa))}),Qo=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),ti(at(e,Fa),qi(t,2))}),Zo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,ti(at(e,Fa),void 0,t)}),$o=Fl(Ko),ea=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qo(e,n)});function ta(e){var t=Ln(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,n){Se.call(e,n)?++e[n]:Yn(e,n,1)}),oa=Ci(Ro),aa=Ci(Po);function ra(e,t){return(Pa(e)?lt:$n)(e,qi(t,3))}function ua(e,t){return(Pa(e)?it:el)(e,qi(t,3))}var sa=_i(function(e,t,n){Se.call(e,n)?e[n].push(t):Yn(e,n,[t])}),da=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Ba(e)?C(e.length):[];return $n(e,function(e){o[++l]=i?tt(t,e,n):_l(e,t,n)}),o}),ca=_i(function(e,t,n){Yn(e,n,t)});function va(e,t){return(Pa(e)?st:Dl)(e,qi(t,3))}var ma=_i(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ga=Fl(function(e,t,n){var l=1;if(n.length){var i=kt(n,Ki(ga));l|=32}return Mi(e,l,t,n,i)}),ha=Fl(function(e,t,n){var l=3;if(n.length){var i=kt(n,Ki(ha));l|=32}return Mi(t,l,e,n,i)});function Aa(e,t,l){var i,o,a,r,u,s,d=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new Ee(n);function p(t){var n=i,l=o;return i=o=void 0,d=t,r=e.apply(l,n)}function f(e){return d=e,u=go(_,t),c?p(e):r}function E(e){var n=e-s;return void 0===s||n>=t||n<0||v&&e-d>=a}function _(){var e=fa();if(E(e))return g(e);u=go(_,function(e){var n=t-(e-s);return v?an(n,a-(e-d)):n}(e))}function g(e){return u=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=fa(),n=E(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(v)return ui(u),u=go(_,t),p(s)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?on(or(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==u&&ui(u),d=0,i=s=o=u=void 0},h.flush=function(){return void 0===u?r:g(fa())},h}var Sa=Fl(function(e,t){return Qn(e,1,t)}),ba=Fl(function(e,t,n){return Qn(e,or(t)||0,n)});function Na(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(Na.Cache||xn),l}function Ca(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Na.Cache=xn;var Da=ai(function(e,t){var n=(t=1==t.length&&Pa(t[0])?st(t[0],Lt(qi())):st(il(t,1),Lt(qi()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),ya=Fl(function(e,t){return Mi(e,32,void 0,t,kt(t,Ki(ya)))}),La=Fl(function(e,t){return Mi(e,64,void 0,t,kt(t,Ki(La)))}),Oa=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=Ri(ml),wa=Ri(function(e,t){return e>=t}),Ra=gl(function(){return arguments}())?gl:function(e){return Va(e)&&Se.call(e,"callee")&&!Ge.call(e,"callee")},Pa=C.isArray,xa=Xe?Lt(Xe):function(e){return Va(e)&&vl(e)==A};function Ba(e){return null!=e&&ja(e.length)&&!Wa(e)}function Fa(e){return Va(e)&&Ba(e)}var Ma=en||ou,Ua=Je?Lt(Je):function(e){return Va(e)&&vl(e)==u};function ka(e){if(!Va(e))return!1;var t=vl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Wa(e){if(!za(e))return!1;var t=vl(e);return t==d||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==lr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Qe?Lt(Qe):function(e){return Va(e)&&eo(e)==v};function Ya(e){return"number"==typeof e||Va(e)&&vl(e)==m}function Ka(e){if(!Va(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==De}var qa=Ze?Lt(Ze):function(e){return Va(e)&&vl(e)==f},Xa=$e?Lt($e):function(e){return Va(e)&&eo(e)==E};function Ja(e){return"string"==typeof e||!Pa(e)&&Va(e)&&vl(e)==_}function Qa(e){return"symbol"==typeof e||Va(e)&&vl(e)==g}var Za=et?Lt(et):function(e){return Va(e)&&ja(e.length)&&!!Fe[vl(e)]},$a=Ri(Cl),er=Ri(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Ba(e))return Ja(e)?zt(e):fi(e);if(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=eo(e);return(t==v?Mt:t==E?Wt:Tr)(e)}function nr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function lr(e){var t=nr(e),n=t%1;return t==t?n?t-n:t:0}function ir(e){return e?qn(lr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return Ei(e,Sr(e))}function rr(e){return null==e?"":Xl(e)}var ur=gi(function(e,t){if(so(t)||Ba(t))Ei(t,Ar(t),e);else for(var n in t)Se.call(t,n)&&jn(e,n,t[n])}),sr=gi(function(e,t){Ei(t,Sr(t),e)}),dr=gi(function(e,t,n,l){Ei(t,Sr(t),e,l)}),cr=gi(function(e,t,n,l){Ei(t,Ar(t),e,l)}),vr=ji(Kn),mr=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=Sr(o),r=-1,u=a.length;++r<u;){var s=a[r],d=e[s];(void 0===d||Ta(d,ge[s])&&!Se.call(e,s))&&(e[s]=o[s])}return e}),pr=Fl(function(e){return e.push(void 0,ki),tt(Nr,void 0,e)});function fr(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function Er(e,t){return null!=e&&to(e,t,fl)}var _r=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),gr=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},qi),hr=Fl(_l);function Ar(e){return Ba(e)?Mn(e):Nl(e)}function Sr(e){return Ba(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var br=gi(function(e,t,n){Ol(e,t,n)}),Nr=gi(function(e,t,n,l){Ol(e,t,n,l)}),Cr=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Ql(n,t[i]);return n}),Dr=ji(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function yr(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=qi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Lr=Fi(Ar),Or=Fi(Sr);function Tr(e){return null==e?[]:Ot(e,Ar(e))}var Ir=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function Rr(e){return(e=rr(e))&&e.replace(re,Pt).replace(Te,"")}var Pr=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),xr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Br=Si("toLowerCase"),Fr=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=bi(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Si("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Hr=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new de(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=yo(t),Yn(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Di(),Gr=Di(!0);function Yr(e){return e}function Kr(e){return bl("function"==typeof e?e:Xn(e,1))}var qr=Fl(function(e,t){return function(n){return _l(n,e,t)}}),Xr=Fl(function(e,t){return function(n){return _l(e,n,t)}});function Jr(e,t,n){var l=Ar(t),i=sl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Ar(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,dt([this.value()],arguments))})}),e}function Qr(){}var Zr=Ti(st),$r=Ti(ot),eu=Ti(mt);function tu(e){return ao(e)?St(yo(e)):function(e){return function(t){return dl(t,e)}}(e)}var nu=wi(),lu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Oi(function(e,t){return e+t},0),uu=xi("ceil"),su=Oi(function(e,t){return e/t},1),du=xi("floor"),cu=Oi(function(e,t){return e*t},1),vu=xi("round"),mu=Oi(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ea,Ln.assign=ur,Ln.assignIn=sr,Ln.assignInWith=dr,Ln.assignWith=cr,Ln.at=vr,Ln.before=_a,Ln.bind=ga,Ln.bindAll=jr,Ln.bindKey=ha,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},Ln.chain=ta,Ln.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(lr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=C(Qt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},Ln.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Ln.concat=function(){var e=arguments.length;if(!e)return[];for(var t=C(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return dt(Pa(n)?fi(n):[n],il(t,1))},Ln.cond=function(e){var t=null==e?0:e.length,l=qi();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Ln.conforms=function(e){return function(e){var t=Ar(e);return function(n){return Jn(n,e,t)}}(Xn(e,1))},Ln.constant=zr,Ln.countBy=ia,Ln.create=function(e,t){var n=On(e);return null==t?n:Gn(n,t)},Ln.curry=function e(t,n,l){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.curryRight=function e(t,n,l){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.debounce=Aa,Ln.defaults=mr,Ln.defaultsDeep=pr,Ln.defer=Sa,Ln.delay=ba,Ln.difference=To,Ln.differenceBy=Io,Ln.differenceWith=wo,Ln.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:lr(t))<0?0:t,l):[]},Ln.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t):[]},Ln.dropRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0,!0):[]},Ln.dropWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0):[]},Ln.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=lr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:lr(l))<0&&(l+=i),l=n>l?0:ir(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Ln.filter=function(e,t){return(Pa(e)?at:ll)(e,qi(t,3))},Ln.flatMap=function(e,t){return il(va(e,t),1)},Ln.flatMapDeep=function(e,t){return il(va(e,t),1/0)},Ln.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),il(va(e,t),n)},Ln.flatten=xo,Ln.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Ln.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:lr(t)):[]},Ln.flip=function(e){return Mi(e,512)},Ln.flow=Vr,Ln.flowRight=Gr,Ln.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Ln.functions=function(e){return null==e?[]:sl(e,Ar(e))},Ln.functionsIn=function(e){return null==e?[]:sl(e,Sr(e))},Ln.groupBy=sa,Ln.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Ln.intersection=Fo,Ln.intersectionBy=Mo,Ln.intersectionWith=Uo,Ln.invert=_r,Ln.invertBy=gr,Ln.invokeMap=da,Ln.iteratee=Kr,Ln.keyBy=ca,Ln.keys=Ar,Ln.keysIn=Sr,Ln.map=va,Ln.mapKeys=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},Ln.mapValues=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},Ln.matches=function(e){return yl(Xn(e,1))},Ln.matchesProperty=function(e,t){return Ll(e,Xn(t,1))},Ln.memoize=Na,Ln.merge=br,Ln.mergeWith=Nr,Ln.method=qr,Ln.methodOf=Xr,Ln.mixin=Jr,Ln.negate=Ca,Ln.nthArg=function(e){return e=lr(e),Fl(function(t){return Tl(t,e)})},Ln.omit=Cr,Ln.omitBy=function(e,t){return yr(e,Ca(qi(t)))},Ln.once=function(e){return _a(2,e)},Ln.orderBy=function(e,t,n,l){return null==e?[]:(Pa(t)||(t=null==t?[]:[t]),Pa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Ln.over=Zr,Ln.overArgs=Da,Ln.overEvery=$r,Ln.overSome=eu,Ln.partial=ya,Ln.partialRight=La,Ln.partition=ma,Ln.pick=Dr,Ln.pickBy=yr,Ln.property=tu,Ln.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Ln.pull=Wo,Ln.pullAll=Ho,Ln.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,qi(n,2)):e},Ln.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Ln.pullAt=jo,Ln.range=nu,Ln.rangeRight=lu,Ln.rearg=Oa,Ln.reject=function(e,t){return(Pa(e)?at:ll)(e,Ca(qi(t,3)))},Ln.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=qi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},Ln.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:lr(t))},Ln.reverse=zo,Ln.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),(Pa(e)?kn:Ul)(e,t)},Ln.set=function(e,t,n){return null==e?e:kl(e,t,n)},Ln.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},Ln.shuffle=function(e){return(Pa(e)?Wn:jl)(e)},Ln.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},Ln.sortBy=pa,Ln.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Ln.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,qi(t,2)):[]},Ln.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!qa(t))&&!(t=Xl(t))&&Ft(e)?ri(zt(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Fl(function(n){var l=n[t],i=ri(n,0,t);return l&&dt(i,l),tt(e,this,i)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t,l):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?$l(e,qi(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Aa(e,t,{leading:i,maxWait:t,trailing:o})},Ln.thru=na,Ln.toArray=tr,Ln.toPairs=Lr,Ln.toPairsIn=Or,Ln.toPath=function(e){return Pa(e)?st(e,yo):Qa(e)?[e]:fi(Do(rr(e)))},Ln.toPlainObject=ar,Ln.transform=function(e,t,n){var l=Pa(e),i=l||Ma(e)||Za(e);if(t=qi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Wa(o)?On(je(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},Ln.unary=function(e){return Ea(e,1)},Ln.union=Vo,Ln.unionBy=Go,Ln.unionWith=Yo,Ln.uniq=function(e){return e&&e.length?Jl(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?Jl(e,qi(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jl(e,void 0,t):[]},Ln.unset=function(e,t){return null==e||Ql(e,t)},Ln.unzip=Ko,Ln.unzipWith=qo,Ln.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},Ln.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},Ln.values=Tr,Ln.valuesIn=function(e){return null==e?[]:Ot(e,Sr(e))},Ln.without=Xo,Ln.words=Wr,Ln.wrap=function(e,t){return ya(ii(t),e)},Ln.xor=Jo,Ln.xorBy=Qo,Ln.xorWith=Zo,Ln.zip=$o,Ln.zipObject=function(e,t){return ni(e||[],t||[],jn)},Ln.zipObjectDeep=function(e,t){return ni(e||[],t||[],kl)},Ln.zipWith=ea,Ln.entries=Lr,Ln.entriesIn=Or,Ln.extend=sr,Ln.extendWith=dr,Jr(Ln,Ln),Ln.add=ru,Ln.attempt=Hr,Ln.camelCase=Ir,Ln.capitalize=wr,Ln.ceil=uu,Ln.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=or(n))==n?n:0),void 0!==t&&(t=(t=or(t))==t?t:0),qn(or(e),t,n)},Ln.clone=function(e){return Xn(e,4)},Ln.cloneDeep=function(e){return Xn(e,5)},Ln.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Ln.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Ln.conformsTo=function(e,t){return null==t||Jn(e,t,Ar(t))},Ln.deburr=Rr,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=su,Ln.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:qn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Ln.eq=Ta,Ln.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(B,xt):e},Ln.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Ln.every=function(e,t,n){var l=Pa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.find=oa,Ln.findIndex=Ro,Ln.findKey=function(e,t){return ft(e,qi(t,3),rl)},Ln.findLast=aa,Ln.findLastIndex=Po,Ln.findLastKey=function(e,t){return ft(e,qi(t,3),ul)},Ln.floor=du,Ln.forEach=ra,Ln.forEachRight=ua,Ln.forIn=function(e,t){return null==e?e:ol(e,qi(t,3),Sr)},Ln.forInRight=function(e,t){return null==e?e:al(e,qi(t,3),Sr)},Ln.forOwn=function(e,t){return e&&rl(e,qi(t,3))},Ln.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},Ln.get=fr,Ln.gt=Ia,Ln.gte=wa,Ln.has=function(e,t){return null!=e&&to(e,t,pl)},Ln.hasIn=Er,Ln.head=Bo,Ln.identity=Yr,Ln.includes=function(e,t,n,l){e=Ba(e)?e:Tr(e),n=n&&!l?lr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ja(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Ln.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),_t(e,t,i)},Ln.inRange=function(e,t,n){return t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=or(e),t,n)},Ln.invoke=hr,Ln.isArguments=Ra,Ln.isArray=Pa,Ln.isArrayBuffer=xa,Ln.isArrayLike=Ba,Ln.isArrayLikeObject=Fa,Ln.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},Ln.isBuffer=Ma,Ln.isDate=Ua,Ln.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ka(e)},Ln.isEmpty=function(e){if(null==e)return!0;if(Ba(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Ra(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(so(e))return!Nl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Ln.isEqual=function(e,t){return hl(e,t)},Ln.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?hl(e,t,void 0,n):!!l},Ln.isError=ka,Ln.isFinite=function(e){return"number"==typeof e&&tn(e)},Ln.isFunction=Wa,Ln.isInteger=Ha,Ln.isLength=ja,Ln.isMap=Ga,Ln.isMatch=function(e,t){return e===t||Al(e,t,Ji(t))},Ln.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Al(e,t,Ji(t),n)},Ln.isNaN=function(e){return Ya(e)&&e!=+e},Ln.isNative=function(e){if(uo(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Ln.isNil=function(e){return null==e},Ln.isNull=function(e){return null===e},Ln.isNumber=Ya,Ln.isObject=za,Ln.isObjectLike=Va,Ln.isPlainObject=Ka,Ln.isRegExp=qa,Ln.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Ln.isSet=Xa,Ln.isString=Ja,Ln.isSymbol=Qa,Ln.isTypedArray=Za,Ln.isUndefined=function(e){return void 0===e},Ln.isWeakMap=function(e){return Va(e)&&eo(e)==h},Ln.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},Ln.join=function(e,t){return null==e?"":nn.call(e,t)},Ln.kebabCase=Pr,Ln.last=ko,Ln.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=lr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,ht,i,!0)},Ln.lowerCase=xr,Ln.lowerFirst=Br,Ln.lt=$a,Ln.lte=er,Ln.max=function(e){return e&&e.length?nl(e,Yr,ml):void 0},Ln.maxBy=function(e,t){return e&&e.length?nl(e,qi(t,2),ml):void 0},Ln.mean=function(e){return At(e,Yr)},Ln.meanBy=function(e,t){return At(e,qi(t,2))},Ln.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},Ln.minBy=function(e,t){return e&&e.length?nl(e,qi(t,2),Cl):void 0},Ln.stubArray=iu,Ln.stubFalse=ou,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=cu,Ln.nth=function(e,t){return e&&e.length?Tl(e,lr(t)):void 0},Ln.noConflict=function(){return ze._===this&&(ze._=ye),this},Ln.noop=Qr,Ln.now=fa,Ln.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Zt(i),n)+e+Ii(Qt(i),n)},Ln.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+Ii(t-l,n):e},Ln.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Ln.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},Ln.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nr(e),void 0===t?(t=e,e=0):t=nr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+ke("1e-"+((i+"").length-1))),t)}return xl(e,t)},Ln.reduce=function(e,t,n){var l=Pa(e)?ct:Nt,i=arguments.length<3;return l(e,qi(t,4),n,i,$n)},Ln.reduceRight=function(e,t,n){var l=Pa(e)?vt:Nt,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},Ln.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),Bl(rr(e),t)},Ln.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[yo(t[l])];void 0===o&&(l=i,o=n),e=Wa(o)?o.call(e):o}return e},Ln.round=vu,Ln.runInContext=e,Ln.sample=function(e){return(Pa(e)?Un:Ml)(e)},Ln.size=function(e){if(null==e)return 0;if(Ba(e))return Ja(e)?jt(e):e.length;var t=eo(e);return t==v||t==E?e.size:Nl(e).length},Ln.snakeCase=Fr,Ln.some=function(e,t,n){var l=Pa(e)?mt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.sortedIndex=function(e,t){return Gl(e,t)},Ln.sortedIndexBy=function(e,t,n){return Yl(e,t,qi(n,2))},Ln.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Ta(e[l],t))return l}return-1},Ln.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Ln.sortedLastIndexBy=function(e,t,n){return Yl(e,t,qi(n,2),!0)},Ln.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Ta(e[n],t))return n}return-1},Ln.startCase=Mr,Ln.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:qn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Ln.subtract=mu,Ln.sum=function(e){return e&&e.length?Ct(e,Yr):0},Ln.sumBy=function(e,t){return e&&e.length?Ct(e,qi(t,2)):0},Ln.template=function(e,t,n){var l=Ln.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=rr(e),t=dr({},t,l,Ui);var i,o,a=dr({},t.imports,l.imports,Ui),r=Ar(a),u=Ot(a,r),s=0,d=t.interpolate||ue,c="__p += '",v=pe((t.escape||ue).source+"|"+d.source+"|"+(d===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),c+=e.slice(s,u).replace(se,Bt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),c+="';\n";var p=Se.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new de("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(R,"$1").replace(P,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Hr(function(){return ce(r,m+"return "+c).apply(void 0,u)});if(f.source=c,ka(f))throw f;return f},Ln.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Dt(l,t=qi(t));++n<e;)t(n);return i},Ln.toFinite=nr,Ln.toInteger=lr,Ln.toLength=ir,Ln.toLower=function(e){return rr(e).toLowerCase()},Ln.toNumber=or,Ln.toSafeInteger=function(e){return e?qn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},Ln.toString=rr,Ln.toUpper=function(e){return rr(e).toUpperCase()},Ln.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return yt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ri(l,It(l,i),wt(l,i)+1).join("")},Ln.trimEnd=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,0,wt(l,zt(t))+1).join("")},Ln.trimStart=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,It(l,zt(t))).join("")},Ln.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=rr(e)).length;if(Ft(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-jt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),qa(i)){if(e.slice(r).search(i)){var s,d=u;for(i.global||(i=pe(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(d);)var c=s.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xl(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Ln.unescape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,Gt):e},Ln.uniqueId=function(e){var t=++be;return rr(e)+t},Ln.upperCase=Ur,Ln.upperFirst=kr,Ln.each=ra,Ln.eachRight=ua,Ln.first=Bo,Jr(Ln,(au={},rl(Ln,function(e,t){Se.call(Ln.prototype,t)||(au[t]=e)}),au),{chain:!1}),Ln.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(lr(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Yr)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return _l(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ca(qi(e)))},wn.prototype.slice=function(e,t){e=lr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=lr(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},rl(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Ln[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Ln.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||Pa(t),d=function(e){var t=i.apply(Ln,dt([e],a));return l&&c?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&s){t=p?t:new wn(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[d],thisArg:void 0}),new In(f,c)}return m&&p?e.apply(this,a):(f=this.thru(d),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Pa(i)?i:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Ln[t];if(n){var l=n.name+"";Se.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[yi(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,s=l?r:a-1,d=this.__iteratees__,c=d.length,v=0,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&v<m;){for(var f=-1,E=e[s+=t];++f<c;){var _=d[f],g=_.type,h=(0,_.iteratee)(E);if(2==g)E=h;else if(!h){if(1==g)continue e;break e}}p[v++]=E}return p},Ln.prototype.at=la,Ln.prototype.chain=function(){return ta(this)},Ln.prototype.commit=function(){return new In(this.value(),this.__chain__)},Ln.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var l=Oo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,pt&&(Ln.prototype[pt]=function(){return this}),Ln}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(C)});function yn(e){let{documents:n,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=o.useTranslation(),d=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!d&&(null==n?void 0:n.map((e,i)=>{var o,d,c;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(d=value)&&void 0!==d&&null!==(c=d.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),d&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Ln=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const d=(null==r?void 0:r.status)||"",c=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,g]=n.useState([]),[h,A]=n.useState(!0),[S,b]=n.useState(!1),[N,C]=n.useState(!1),{isLoading:D,data:y}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:L,data:O}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=y&&null!==(e=y.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==y||null===(o=y.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let s=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==O||null===(t=O["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),g(s)},[!D,!L]),n.useEffect(()=>{let e=0;_.map(t=>{let n=!1;m.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),A("0"!=e&&0!=e||!(m.length>0))},[m,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===d&&(null==c?void 0:c.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(On,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:b,applicationStatus:d,actions:c,bpaTaxDocuments:_,checkEnablingDocs:N}))))};function On(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:d,bpaTaxDocuments:v,checkEnablingDocs:m}=e;const p=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,_]=n.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,h]=n.useState(null),[A,S]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[b,N]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==E?void 0:E.code,fileStoreId:A,documentUid:A,fileName:(null==g?void 0:g.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[g]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(yn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&N(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Tn(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,s,d,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(d=e.questions)||void 0===d?void 0:d.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(yn,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function In(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],d=Digit.ULBService.getStateId(),[c,v]=n.useState(),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:d,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const wn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:d,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==s?void 0:s.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[g,h]=n.useState([]),[A,S]=n.useState([]),[b,N]=n.useState(!1),[C,D]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[y,L]=n.useState(null),O=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,d,c;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(d=E.BPA)||void 0===d||null===(c=d.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,g]),n.useEffect(()=>{N("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[s,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:O?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),d&&d.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(yn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==A?void 0:A.map((e,t)=>l.createElement(In,{key:t,document:e,t:o,error:y,setError:L,setNocDocuments:D,nocDocuments:C,checkEnablingDocs:b}))))},Rn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,d,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?c({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function Pn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:a}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function xn(e){let{floors:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},i(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Bn(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=o.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=c({},u,{maxWidth:"950px"}),u=c({},u,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const Fn=e=>{var i,a;let{scrutinyDetails:r,paymentsList:u=[],additionalDetails:s,applicationData:d}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==d?void 0:d.status))&&window.location.href.includes("bpa");const[c,v]=n.useState(),[m,p]=n.useState(),[f,E]=n.useState(),_=Digit.ULBService.getStateId(),[g,h]=n.useState(),[A,S]=n.useState(),[b,N]=n.useState([]),[C,D]=n.useState(),[y,L]=n.useState(""),[O,T]=n.useState(null),[I,w]=n.useState({}),[R,P]=n.useState(!1),[x,B]=n.useState(!1);n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(C.size>=2e6)T(F("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N([...b,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):T(F("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else T(F("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(b))},[b]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=s&&null!==(e=s.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==s?void 0:s.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==s||null===(n=s.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==s||null===(l=s.lessAdjustmentFeeFiles[(null==s||null===(i=s.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,_).then(e=>w(null==e?void 0:e.data))}v(null==s||null===(t=s.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==s||null===(n=s.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),p(null==s||null===(l=s.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==s||null===(i=s.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==s||null===(o=s.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==s||null===(a=s.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==s?void 0:s.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==s?void 0:s.otherFeesDiscription),N(null==s?void 0:s.lessAdjustmentFeeFiles)},[s]);const{t:F}=o.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},F(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?F(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void F("NA");return l.createElement(n.Fragment,null,!(null!=r&&r.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==r||null===(i=r.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+F(""+e.title),text:null!=e&&e.value?M(e)+" "+F(null==e?void 0:e.isUnit):F("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+F(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},F(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},F(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},Mn=e=>{var i,a,r,u,s;let{edcrDetails:d,applicationData:c}=e;const{t:v}=o.useTranslation(),m=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:f(e.id),id:e.id})));function _(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:Number(null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea).toFixed(2),FloorArea:Number(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function g(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==d||null===(i=d.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==d||null===(a=d.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==d||null===(i=d.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:E,getCellProps:e=>({style:{}})})))})))},Un=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},kn=e=>{var i,a,r;let{data:u,OpenImage:s,privacy:d={}}=e;const[c,v]=n.useState(!1),{t:m}=o.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:d}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Un,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{v(!0)},style:{color:"#800000"}},m("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},m("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Wn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Hn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const jn=e=>{var i,a,r,u,s;let{wsAdditionalDetails:d}=e;const{t:c}=o.useTranslation();let v=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const p=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:h}=(null==d?void 0:d.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==d||null===(i=d.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==d||null===(a=d.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==d||null===(r=d.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var n;return l.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==d||null===(u=d.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==d||null===(s=d.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},zn=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Vn=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Gn=e=>{var i,a,r,u;let{wsAdditionalDetails:s}=e;const{t:d}=o.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[A,S]=n.useState(!1),[b,N]=n.useState(v||{}),[C,D]=n.useState(null),[y,L]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[O,T]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=c({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,d,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(d=v.billDetails)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount)}];T(e),L(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),N(i)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),P=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),B=function(e,t,n){void 0===t&&(t=!1);let l=c({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}N(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},O&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==O?void 0:O.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==y?void 0:y.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,A&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{N(v),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{N(v),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,h,A;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n=c({},null==s||null===(v=s.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(h=s.additionalDetails)||void 0===h||null===(A=h.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,s,d,c,v,p,f,g,h;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const A=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(s=e.Calculation)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(ht(e.Calculation[0])),L(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(A),b.billDetails=null==e?void 0:e.Calculation,m(b),S(!1)}).catch(e=>{var t,n,l,i,o,a;D({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:zn,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>B("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>B("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Vn,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>B("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},Yn=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:c({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Kn=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(Yn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},qn=e=>{var i,a,r,u,s,d,c;let{wsAdditionalDetails:v}=e;const{t:m}=o.useTranslation(),[p,f]=n.useState(!1),[E,_]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),h=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(h,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),_(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(A,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(d=E.billSlabData)||void 0===d||null===(c=d.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Xn={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Jn=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Xn.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Xn.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:c({},Xn.cell,Xn.cellLeft,Xn.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:c({},Xn.cell,n.length==t+1?Xn.cellRight:{},Xn.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:c({},Xn.cell,Xn.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,i)=>l.createElement("td",{style:c({},Xn.cell,{textAlign:"left"},n.length==i+1?Xn.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:c({},Xn.cell,Xn.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:c({},Xn.cell,Xn.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:c({},Xn.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Xn.cell,key:t,numeric:!0})))))))},Qn={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Zn=e=>{var t,i,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let s={},d=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];d=[...d];const c=(null===(i=d)||void 0===i?void 0:i.reduce((e,t,n)=>e+t.amount,0))||0;let v="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));d.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);s[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let p=[];p=Object.keys(m),p.sort((e,t)=>m[e]-m[t]);const[f,E]=n.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Qn.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Jn,{headers:[...p],values:s,arrears:v}),!f&&l.createElement("div",{style:Qn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Qn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},$n=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))};function el(e){var a,r,u,s,d,v,m,p,f,E,g,h,A,S,b,N;let{applicationDetails:C,demandData:D,workflowDetails:y,isDataLoading:L,applicationData:O,businessService:T,timelineStatusPrefix:I,showTimeLine:w=!0,statusAttribute:R="status",paymentsList:P,oldValue:x,isInfoLabel:B=!1,propertyId:F,moduleCode:M}=e;const{t:U}=o.useTranslation(),k=i.useHistory(),W=Digit.ULBService.getCurrentTenantId(),[H,j]=n.useState(null),[z,V]=n.useState([]);let G=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function Y(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",C);const[K,q]=n.useState({}),[X,J]=n.useState(),[Q,Z]=n.useState([]),[$,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.status)||$.loading||$.loaded||$.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==$||!$.canLoad||$.loading||$.loaded||(ee({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const o=Array.from(l.values());return Z(o),console.log(o),J(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||W,null==O?void 0:O.propertyId,q,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ne=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==O||null===(i=O.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(kn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},d=null==n?void 0:n[t-1],c={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,comment:U(null==e?void 0:e.comment),wfComment:d?null==d?void 0:d.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(kn,{data:c,OpenImage:Y,privacy:i})}{var d,c,v,m,p;const t={date:te(null==O||null===(d=O.auditDetails)||void 0===d?void 0:d.lastModifiedTime),name:null==e||null===(c=e.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(m=e.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.mobileNumber};return l.createElement(kn,{data:t})}},le=(e,t)=>e?t?e:U(e):U("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+U(null==e?void 0:e.isUnit):U("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):U("N/A"),[se,de]=n.useState(!1);console.log("demand Data arr",D),null==D||D.reduce((e,t)=>e+t.demandInterest,0),null==D||D.reduce((e,t)=>e+t.demandPenality,0),null==D||D.reduce((e,t)=>e+t.collectionTax,0),null==D||D.reduce((e,t)=>e+t.collectionInterest,0),null==D||D.reduce((e,t)=>e+t.collectionPenality,0),null==D||D.reduce((e,t)=>e+t.balanceTax,0),null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0);const ce=function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},l)},W,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},ve=null==C?void 0:C.applicationData,me=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C,T),console.log("infolabel",B),console.log("assessment details",X),n.useEffect(()=>{try{let e={consumerCodes:F};const t=!0;"BPREG"===M?Digit.OBPSService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)}):Digit.PTService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},B?l.createElement(Kn,{t:U,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,o)=>{var a,r,u,s,d,c,v,m,p,f,E,_,g,h,A,S,b,N,D,L,O,T,I,w,R,B,F,M,k,W,H,j,z,V,Y,q,X,J;return l.createElement(l.Fragment,{key:o},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:ie?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==o||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==o&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+U(e.title):U(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},U(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},U(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},U(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},U(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,o)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:U(n.title),label:U(n.title),text:l.createElement("img",{src:U(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:U(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},U(null==n?void 0:n.title)))):oe||ae?""+U(n.title):U(n.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:o===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+U(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:U(n.title),label:U(n.title),text:ue(n),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Zn,{bill:null===(r=K.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(Fn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(s=C.applicationData)||void 0===s||null===(d=s.additionalDetails)||void 0===d||null===(c=d.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(Tn,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(xn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&l.createElement(Bn,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(Hn,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(Wn,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!G&&(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions)&&(null==y||null===(D=y.data)||void 0===D||null===(L=D.nextActions)||void 0===L?void 0:L.length)>0&&l.createElement(Rn,{applicationData:null==C?void 0:C.applicationData,t:U,permissions:null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Ln,{t:U,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:y})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(wn,{t:U,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:y}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(Fn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Fn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Mn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.documentsWithUrl)&&l.createElement(yn,{documents:null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(Pn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(jn,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(z=e.additionalDetails)||void 0===z||null===(V=z.redirectUrl)||void 0===V?void 0:V.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(Y=e.additionalDetails)||void 0===Y||null===(q=Y.redirectUrl)||void 0===q?void 0:q.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Gn,{wsAdditionalDetails:e,workflowDetails:y}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&l.createElement(qn,{wsAdditionalDetails:e,workflowDetails:y}))}),(null==X?void 0:X.length)>0&&l.createElement($n,{assessmentData:Q}),w&&(null==y||null===(s=y.data)||void 0===s||null===(d=s.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==y?void 0:y.isLoading)||L)&&l.createElement(t.Loader,null),!(null!=y&&y.isLoading)&&!L&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},U("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=y&&null!==(v=y.data)&&void 0!==v&&v.timeline&&1===(null==y||null===(m=y.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:U(""+I+(null==y||null===(f=y.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(null==y||null===(g=y.data)||void 0===g?void 0:g.timeline[0],null==y||null===(h=y.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==y||null===(A=y.data)||void 0===A?void 0:A.timeline)&&(null==y||null===(S=y.data)||void 0===S?void 0:S.timeline.slice(0,se?null==y?void 0:y.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,s,d,c,v;return window.location.href.includes("/obps/")&&(a=null!=y&&null!==(r=y.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=y&&null!==(d=y.data)&&void 0!==d&&null!==(c=d.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:U(""+I+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[R])+a),customChild:ne(e,n,null==y||null===(o=y.data)||void 0===o?void 0:o.timeline)}))}))),(null==y||null===(b=y.data)||void 0===b||null===(N=b.timeline)||void 0===N?void 0:N.length)>2&&l.createElement(t.LinkButton,{label:U(se?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{de(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(ve,"ACTIVE",me):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(ve,"INACTIVE",me):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&k.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),H&&l.createElement(t.Toast,{error:H.isError,label:U(H.label),onClose:()=>{j(null)},isDleteBtn:"false"}))}function tl(e){var n,i,o,a,r,u,s,d,c,v,m,p,f,E,_,g,h,A;let{t:S,showToast:b,closeToast:N,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var D;let e="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:S("ES_"+C+"_"+(null==b||null===(c=b.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:N}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var y;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(y=b.action)||void 0===y?void 0:y.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:S("ES_"+C+"_"+(null==b||null===(A=b.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:N}))}{var L,O;const e="error"===(null==b?void 0:b.key)?null==b||null===(L=b.error)||void 0===L?void 0:L.message:"ES_"+C+"_"+(null==b||null===(O=b.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:N}))}}function nl(e){var i,a,r,u,s,d,v,m,p,f,E,_,g,h,A,S;let{workflowDetails:b,displayMenu:N,onActionSelect:C,setDisplayMenu:D,businessService:y,forcedActionPrefix:L,ActionBarStyle:O={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=Digit.UserService.getUser();const R=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const P=null===(i=w)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,B=!1,F=(null==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==b||null===(v=b.data)||void 0===v||null===(m=v.nextActions)||void 0===m?void 0:m.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",b),Digit.Hooks.useClickOutside(R,()=>{D(!1)},N),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(p=F[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(B=!1,x=!0):(null==F?void 0:F.length)>0&&(B=!0,x=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&B&&!x&&l.createElement(t.ActionBar,{style:c({},O)},N&&(null!=b&&null!==(E=b.data)&&void 0!==E&&null!==(_=E.actionState)&&void 0!==_&&_.nextActions||null!=b&&null!==(g=b.data)&&void 0!==g&&g.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:L||"WF_EMPLOYEE_"+(null==y?void 0:y.toUpperCase()),options:F,optionKey:"action",t:I,onSelect:C,style:T}):null,l.createElement(t.SubmitBar,{ref:R,label:I("WF_TAKE_ACTION"),onSubmit:()=>D(!N)})),!(null!=b&&b.isLoading)&&!B&&x&&l.createElement(t.ActionBar,{style:c({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(h=F[0])||void 0===h?void 0:h.action,value:null==F||null===(A=F[0])||void 0===A?void 0:A.action,onClick:e=>{C((null==F?void 0:F[0])||{})}},I((L||"WF_EMPLOYEE_"+(null==y?void 0:y.toUpperCase()))+"_"+(null==F||null===(S=F[0])||void 0===S?void 0:S.action)))))}const ll=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),il=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ll,null));function ol(e){let{action:n,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(il,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const al=e=>{var r,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const d=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),f=i.useHistory();let{id:E}=i.useParams();const[_,g]=n.useState(!1),[h,A]=n.useState(null),[S,b]=n.useState(!1),[N,C]=n.useState(!1),[D,y]=n.useState(!1),{data:L}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:R,setShowToast:P,isLoading:x,isDataLoading:B,applicationData:F,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:K,MenuStyle:q,paymentsList:X,showTimeLine:J=!0,oldValue:Q,isInfoLabel:Z=!1,clearDataDetails:$,propertyId:ee}=e;n.useEffect(()=>{R&&k.revalidate()},[R]);const te=a.useQueryClient(),ne=()=>{A(null),b(!1)};return console.log("ActionsInPayment2",k),x||N?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,x?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(el,{applicationDetails:O,demandData:T,id:W,workflowDetails:k,isDataLoading:B,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:J,oldValue:Q,isInfoLabel:Z,propertyId:ee,moduleCode:z}),S?l.createElement(Cn,{t:p,action:h,tenantId:d,state:v,id:E,applicationDetails:O,applicationData:null==O?void 0:O.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,s,d,v,m,E,_,g,A,S,b,N,D,y){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(d=s[0])||void 0===d||null===(v=d.additionalDetail)||void 0===v||null===(m=v.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(_=E[0])||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(S=A.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(N=b.comment)||void 0===N?void 0:N.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(y=D.comment)||void 0===y?void 0:y.length)){var L,O;"INITIATE"===(null==e||null===(L=e.Licenses)||void 0===L||null===(O=L[0])||void 0===O?void 0:O.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),P({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,d,c,v,m,E,_,g;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(d=s.workflow)&&void 0!==d&&d.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,S,b;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(A=e.Licenses[0])&&void 0!==A&&null!==(S=A.businessService)&&void 0!==S&&S.includes("BPAREG")?(P({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(b=e.Licenses[0])||void 0===b?void 0:b.applicationNumber)));P({key:"success",action:h}),$&&setTimeout($,3e3),setTimeout(j,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=wt(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,s,d,c,v,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(d=e.response)||void 0===d||null===(c=d.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;ne(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==k||null===(r=k.data)||void 0===r?void 0:r.timeline,businessService:H,workflowDetails:k,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(ol,{action:h,workflowDetails:k,businessService:H,isWarningPop:D,closeWarningPopup:()=>{y(!1)}}):null,l.createElement(tl,{t:p,showToast:R,closeToast:j,businessService:H}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==F?void 0:F.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==L||null===(t=L.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==O||null===(n=O.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==O||null===(o=O.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const s=function(e,t,n,l,i,o,a,r,s,c,v,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,d)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(nl,{workflowDetails:k,displayMenu:_,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)y(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,d;f.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.state})}else{var v;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(v=e.redirectionUrll)||void 0===v?void 0:v.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:c({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else b(!0);A(e),g(!1)},setDisplayMenu:g,businessService:H,forcedActionPrefix:G,ActionBarStyle:K,MenuStyle:q}))))};function rl(e){var i;let{t:o,document:a,setNocDocuments:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],d=Digit.ULBService.getStateId(),[c,v]=n.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{null!=c&&c.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==c?void 0:c.code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}])},[f,c]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:d,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t),l=n&&(null==n?void 0:n.map(e=>{var t,n,l;return{documentType:null==c?void 0:c.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,fileName:(null==e||null===(l=e.file)||void 0===l?void 0:l.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(i=n[n.length-1])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const ul=e=>{let{width:t=20,height:n=20,style:i}=e;return l.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},l.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function sl(e){var t;let{value:n={}}=e;const{t:i}=o.useTranslation(),{data:a}=Digit.Hooks.noc.useNOCDocumentSearch({value:n},{value:n});let r=[];return null!=n&&n.workflowDocs&&(r=null==n?void 0:n.workflowDocs),a.pdfFiles&&0!==Object.keys(a.pdfFiles).length?l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{var n,o;let r=g(null==a?void 0:a.pdfFiles,(null==e?void 0:e.documentAttachment)||(null==e?void 0:e.documentUid));return l.createElement("a",{target:"_",href:r,style:{width:"120px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",textDecoration:"none",color:"inherit"},key:t},l.createElement(ul,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",fontSize:"12px",wordWrap:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i(null==e||null===(n=e.documentType)||void 0===n||null===(o=n.replace(".","_"))||void 0===o?void 0:o.toUpperCase())))})))):l.createElement("div",null,i("NOC_NO_DOCUMENTS_MSG"))}const dl=e=>l.createElement("h1",{className:"heading-m"},e.label),cl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),vl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(cl,null)),ml=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationDetails:v,applicationData:m,businessService:p,showToast:f,setShowToast:E,closeToast:_,showErrorToast:g,errorOne:h,closeToastOne:A}=e;const[S,b]=n.useState({}),[N,C]=n.useState({}),[D,y]=n.useState([]),[L,O]=n.useState({}),[T,I]=n.useState(null),[w,R]=n.useState(null),[P,x]=n.useState(null),[B,F]=n.useState([]),[M,U]=n.useState(null),{data:k}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{data:W}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;W&&W["egf-master"]&&F(null===(e=W["egf-master"])||void 0===e?void 0:e.FinancialYear)},[W]);const{data:H}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function j(e){I(e.target.files[0])}return n.useEffect(()=>{if(k&&H){var e;const t=H["common-masters"].Department;y(null==k||null===(e=k.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[k]),console.log("approverData",k),console.log("approvers",D),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{if("SENDBACKTOCITIZEN"===(null==r?void 0:r.action)){var e,t,n;const l=(null==v||null===(e=v.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(n=t.auditDetails)||void 0===n?void 0:n.createdBy)||null;O({uuid:l})}},[r]),console.log("selectedApprover",L),n.useEffect(()=>{r&&b((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SENDBACK"!=(null==i?void 0:i.action)||(c=!1),i.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NOC_CANCEL"},form:[{body:[{label:c?n("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:c?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:c?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{d(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:D,selectedApprover:L,setSelectedApprover:O,selectFile:j,uploadedFile:w,setUploadedFile:R,businessService:p}))},[r,D,B,M,w]),r&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dl,{label:a(S.label.heading)}),headerBarEnd:l.createElement(vl,{onClick:s}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;console.log("data here in Modal",e);let n=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==r?void 0:r.action);null!=r&&r.isTerminateState&&(n=!0);const l=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim();null!=L&&L.uuid?!n||l?(m=c({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=L&&L.uuid?[null==L?void 0:L.uuid]:null,wfDocuments:w?[{documentType:null==T?void 0:T.type,fileName:null==T?void 0:T.name,documentUid:w,filestoreId:w,documentAttachment:w}]:null}),console.log("uploadedFile here in NOCModal",w),d({Licenses:[m]})):E({key:"true",warning:!0,message:a("COMMON_COMMENTS_REQUIRED_LABEL")}):E({key:"true",warning:!0,message:a("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")})},defaultValues:N,formId:"modal-action"}),f&&l.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,label:null==f?void 0:f.message,onClose:_,isDleteBtn:!0}),g&&l.createElement(t.Toast,{error:!0,label:h,isDleteBtn:!0,onClose:A})):l.createElement(t.Loader,null)},pl=(e,n,i,o)=>{var a,r,u,s,d;console.log("checkpoint here",e);const{wfComment:c,thumbnailsToShow:v,wfDocuments:m}=e;console.log("wfDocuments",m);const p={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(r=e.assigner)||void 0===r?void 0:r.name,mobileNumber:null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber,source:null==e||null===(s=e.assigner)||void 0===s?void 0:s.source};return l.createElement("div",null,(null==c?void 0:c.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,o("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},c)),(null==v||null===(d=v.thumbs)||void 0===d?void 0:d.length)>0&&l.createElement(t.DisplayPhotos,{srcs:v.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=v.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==m?void 0:m.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(sl,{value:{workflowDocs:m},index:n}))),l.createElement("div",{style:{marginTop:"8px"}},p.date&&l.createElement("p",null,p.date),p.name&&l.createElement("p",null,p.name),p.mobileNumber&&l.createElement("p",null,p.mobileNumber),p.source&&l.createElement("p",null,o("ES_COMMON_FILED_VIA_"+p.source.toUpperCase()))))},fl=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},El=e=>{let{statuses:i,controlFilterForm:a,applicationTypesOfBPA:u}=e;const{t:s}=o.useTranslation(),d=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+s("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+s("ES_INBOX_ASSIGNED_TO_ALL")}]);return null==u||u.forEach(e=>{e.name=s("WF_BPA_"+e.code),e.i18nKey=s("WF_BPA_"+e.code)}),console.log("status heres===>",i),l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:a,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:d.filter(t=>t.code===e.value)[0],optionsKey:"name",options:d})})),l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:a,defaultValue:[],render:e=>l.createElement(n.Fragment,null,null==i?void 0:i.map((n,i)=>l.createElement(t.CheckBox,{key:n.applicationstatus,label:s(n.applicationstatus)+" - "+n.count,value:n.applicationstatus,checked:e.value.includes(n.applicationstatus),onChange:()=>{var t;e.value.includes(t=n.applicationstatus)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t])},index:i})))})))};function _l(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function gl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function hl(e){gl(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Al(e,t){gl(2,arguments);var n=hl(e).getTime(),l=_l(t);return new Date(n+l)}function Sl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function bl(e){return gl(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Nl(e){if(gl(1,arguments),!bl(e)&&"number"!=typeof e)return!1;var t=hl(e);return!isNaN(Number(t))}var Cl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Dl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,l=e.formats[n]||e.formats[e.defaultWidth];return l}}var yl={date:Dl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Dl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Dl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ll={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Ol(e){return function(t,n){var l,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;l=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function Tl(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,i=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?wl(u,function(e){return e.test(r)}):Il(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(s):s,a=n.valueCallback?n.valueCallback(a):a;var d=t.slice(r.length);return{value:a,rest:d}}}function Il(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function wl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var Rl,Pl={code:"en-US",formatDistance:function(e,t,n){var l,i=Cl[e];return l="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:yl,formatRelative:function(e,t,n,l){return Ll[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Ol({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ol({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ol({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ol({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ol({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Rl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(Rl.matchPattern);if(!n)return null;var l=n[0],i=e.match(Rl.parsePattern);if(!i)return null;var o=Rl.valueCallback?Rl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(l.length);return{value:o,rest:a}}),era:Tl({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Tl({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Tl({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Tl({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Tl({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function xl(e,t){gl(2,arguments);var n=_l(t);return Al(e,-n)}function Bl(e){gl(1,arguments);var t=1,n=hl(e),l=n.getUTCDay(),i=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function Fl(e){gl(1,arguments);var t=hl(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var i=Bl(l),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Bl(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Ml(e){gl(1,arguments);var t=Fl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=Bl(n);return l}function Ul(e,t){gl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.weekStartsOn,o=null==i?0:_l(i),a=null==n.weekStartsOn?o:_l(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=hl(e),u=r.getUTCDay(),s=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-s),r.setUTCHours(0,0,0,0),r}function kl(e,t){gl(1,arguments);var n=hl(e),l=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:_l(a),u=null==i.firstWeekContainsDate?r:_l(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=new Date(0);s.setUTCFullYear(l+1,0,u),s.setUTCHours(0,0,0,0);var d=Ul(s,t),c=new Date(0);c.setUTCFullYear(l,0,u),c.setUTCHours(0,0,0,0);var v=Ul(c,t);return n.getTime()>=d.getTime()?l+1:n.getTime()>=v.getTime()?l:l-1}function Wl(e,t){gl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.firstWeekContainsDate,o=null==i?1:_l(i),a=null==n.firstWeekContainsDate?o:_l(n.firstWeekContainsDate),r=kl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=Ul(u,t);return s}function Hl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var jl={G:function(e,t,n){var l=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var l=e.getUTCFullYear();return n.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),l=n>0?n:1-n;return Hl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var i=kl(e,l),o=i>0?i:1-i;return"YY"===t?Hl(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):Hl(o,t.length)},R:function(e,t){return Hl(Fl(e),t.length)},u:function(e,t){return Hl(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return Hl(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return Hl(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,t,n){var l=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Hl(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(e,t,n){var l=e.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return Hl(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(e,t,n,l){var i=function(e,t){gl(1,arguments);var n=hl(e),l=Ul(n,t).getTime()-Wl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):Hl(i,t.length)},I:function(e,t,n){var l=function(e){gl(1,arguments);var t=hl(e),n=Bl(t).getTime()-Ml(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Hl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Hl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){gl(1,arguments);var t=hl(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),i=n-l;return Math.floor(i/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):Hl(l,t.length)},E:function(e,t,n){var l=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Hl(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Hl(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),i=0===l?7:l;switch(t){case"i":return String(i);case"ii":return Hl(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(e,t,n){var l=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var l,i=e.getUTCHours();switch(l=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var l,i=e.getUTCHours();switch(l=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var l=e.getUTCHours()%12;return 0===l&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return function(e,t){return Hl(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return Hl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Hl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Hl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Hl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Hl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Hl(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Vl(i);case"XXXX":case"XX":return Gl(i);case"XXXXX":case"XXX":default:return Gl(i,":")}},x:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Vl(i);case"xxxx":case"xx":return Gl(i);case"xxxxx":case"xxx":default:return Gl(i,":")}},O:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zl(i,":");case"OOOO":default:return"GMT"+Gl(i,":")}},z:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zl(i,":");case"zzzz":default:return"GMT"+Gl(i,":")}},t:function(e,t,n,l){return Hl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Hl((l._originalDate||e).getTime(),t.length)}};function zl(e,t){var n=e>0?"-":"+",l=Math.abs(e),i=Math.floor(l/60),o=l%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+Hl(o,2)}function Vl(e,t){return e%60==0?(e>0?"-":"+")+Hl(Math.abs(e)/60,2):Gl(e,t)}function Gl(e,t){var n=t||"",l=e>0?"-":"+",i=Math.abs(e);return l+Hl(Math.floor(i/60),2)+n+Hl(i%60,2)}function Yl(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Kl(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var ql={p:Kl,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],i=l[1],o=l[2];if(!o)return Yl(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Yl(i,t)).replace("{{time}}",Kl(o,t))}},Xl=["D","DD"],Jl=["YY","YYYY"];function Ql(e){return-1!==Xl.indexOf(e)}function Zl(e){return-1!==Jl.indexOf(e)}function $l(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var ei=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ti=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ni=/^'([^]*?)'?$/,li=/''/g,ii=/[a-zA-Z]/;function oi(e,t,n){gl(2,arguments);var l=String(t),i=n||{},o=i.locale||Pl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:_l(a),u=null==i.firstWeekContainsDate?r:_l(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=o.options&&o.options.weekStartsOn,d=null==s?0:_l(s),c=null==i.weekStartsOn?d:_l(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var v=hl(e);if(!Nl(v))throw new RangeError("Invalid time value");var m=Sl(v),p=xl(v,m),f={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},E=l.match(ti).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,ql[t])(e,o.formatLong,f):e}).join("").match(ei).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return ai(n);var a=jl[l];if(a)return!i.useAdditionalWeekYearTokens&&Zl(n)&&$l(n,t,e),!i.useAdditionalDayOfYearTokens&&Ql(n)&&$l(n,t,e),a(p,n,o.localize,f);if(l.match(ii))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function ai(e){return e.match(ni)[1].replace(li,"'")}const ri=e=>{var i,a;const{register:u,control:s,setValue:d,getValues:c,reset:v,formState:m}=r.useFormContext(),{t:p}=o.useTranslation(),E=f();return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_APP_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_SOURCE_MODULE_NUMBER")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_TYPE_LABEL")),l.createElement(r.Controller,{control:s,name:"nocType",render:e=>l.createElement(t.Dropdown,{selected:1==(null==E?void 0:E.length)?E[0]:e.value,select:e.onChange,onBlur:e.onBlur,option:E||[],optionKey:"i18nKey",t:p,disable:1==(null==E?void 0:E.length)})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"nocNo",inputRef:u({})})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var t,n;d("applicationNo",null),d("sourceRefId",null),d("mobileNumber",null),d("nocType",null==E||null===(t=E[0])||void 0===t?void 0:t.code),d("offset",0),d("limit",10),d("sortBy","commencementDate"),d("sortOrder","DESC"),d("isSubmitSuccessful","false"),v({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),d("offset",c("offset")-c("limit")),null==e||e.onSubmit({nocType:null==E||null===(n=E[0])||void 0===n?void 0:n.code,offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},p("ES_COMMON_CLEAR_ALL"))))},ui=["currentlyActiveMobileModal"],si=["currentlyActiveMobileModal"],di=e=>{var i,a;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:d,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=r.useFormContext(),[_,g]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{g({type:"remove"})},A=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),S=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,ui);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(A,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,si)))},[_]);return d?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),_?l.createElement(t.PopUp,null,l.createElement(S,{onSubmit:e=>{g({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:_,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(a=m[0])||void 0===a?void 0:a.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:s,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APP_NO_LABEL")}))},ci=e=>{let{columns:i,SearchFormFieldsComponent:a,onSubmit:u,data:s,isLoading:d,Count:c}=e;const{handleSubmit:v,setValue:m,getValues:p}=r.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:_}=o.useTranslation(),g=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},A=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){m("limit",Number(e.target.value)),v(u)()}function b(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function N(){m("offset",Number(p("offset"))-Number(p("limit"))),v(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return d?l.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},_(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:_,data:s,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:b,onPrevPage:N,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:g,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(a,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},vi={step:1,isValid:!1,formData:{},coordinates:{}},mi=function(e,t){switch(void 0===e&&(e=vi),t.type){case"UPDATE_NOCNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return vi;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});default:return e}},pi=["path","url"],fi=[],Ei=()=>{var e,n,a,r,u,s;const d=i.useRouteMatch(),{path:c}=d,m=(v(d,pi),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm")),p=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),f=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),E=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview"),_=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NewNOCEditApplication");return l.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,(void 0===(g=fi)&&(g=[]),g.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:c+"/new-application",component:m}),l.createElement(t.PrivateRoute,{path:c+"/response/:id",component:p}),l.createElement(t.PrivateRoute,{path:c+"/my-application",component:f}),l.createElement(t.PrivateRoute,{path:c+"/edit-application/:id",component:_}),l.createElement(t.PrivateRoute,{path:c+"/search/application-overview/:id",component:E}))));var g},_i=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},d={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},c=(window.Digit.Utils.browser.isMobile(),i.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(c)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===c?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},a(i[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<c-1&&l.createElement("div",{style:d})));var o})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},gi=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function s(){i<r.length?c():i===r.length&&n()}function d(){i>1&&v()}const c=()=>a(i+1),v=()=>a(i-1);return l.createElement(_i,{currentStep:i,nextStep:c,prevStep:v,stepsList:r},(()=>{var e,t;const n=r[i-1],{component:o,key:a,texts:c,currStepConfig:v}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:c,component:o,currStepNumber:i,currStepConfig:v},onGoNext:s,onBackClick:d,t:u}))})())},hi=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],Ai=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Si=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),bi=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Ni=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:hi.filter(t=>t.stepNumber===e.stepNumber)})),Ci=e=>{var i,o,a,r,u;const{t:s,currentStepData:d,Controller:c,control:v,setValue:m,errors:p,errorStyle:f}=e,E=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:_}=Digit.Hooks.obps.useMDMS(E,"common-masters",["GenderType"]);let g=[];_&&_["common-masters"].GenderType.filter(e=>e.active).map(e=>{g.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),n.useEffect(()=>{console.log("currentStepData1",d);const e=null==d?void 0:d.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;m(t,n)})},[d,m]);const[h,A]=n.useState(""),[S,b]=n.useState(null),[N,C]=n.useState(null);n.useEffect(()=>{N&&Object.entries(N).forEach(e=>{let[t,n]=e;if("name"===t)m("applicantOwnerOrFirmName",n,{shouldValidate:!0,shouldDirty:!0});else if("emailId"===t)m("applicantEmailId",n,{shouldValidate:!0,shouldDirty:!0});else if("gender"===t){const e=g.find(e=>e.code===n);m("applicantGender",e,{shouldValidate:!0,shouldDirty:!0})}else"dob"===t?m("applicantDateOfBirth",n,{shouldValidate:!0,shouldDirty:!0}):"fatherOrHusbandName"===t?m("applicantFatherHusbandName",n):"permanentAddress"===t&&m("applicantAddress",n,{shouldValidate:!0,shouldDirty:!0})})},[N]);const D=window.location.pathname.includes("edit");return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_APPLICANT_DETAILS")),l.createElement("div",null,D&&l.createElement(t.CardSectionSubText,{style:{color:"red",margin:"10px 0px"}}," To update your Mobile No, Name, Email, Date of Birth, or Gender, please go the Citizen's Edit Profile section"),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantMobileNumber",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value),A(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:D})})),l.createElement("div",{className:"search-icon",onClick:D?null:function(){try{return""===h||10!==h.length?(b({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve()):Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:h},{})).then(function(e){var t,n;0===(null==e||null===(t=e.user)||void 0===t?void 0:t.length)?b({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"}):C(null==e||null===(n=e.user)||void 0===n?void 0:n[0])})}catch(e){return Promise.reject(e)}}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabelError,{style:f},(null==p||null===(i=p.applicantMobileNumber)||void 0===i?void 0:i.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_FIRM_OWNER_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantOwnerOrFirmName",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==N?void 0:N.name),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:D})}))),l.createElement(t.CardLabelError,{style:f},null!=p&&p.applicantOwnerOrFirmName?p.applicantOwnerOrFirmName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantEmailId",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:s("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==N?void 0:N.emailId),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:D})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(o=p.applicantEmailId)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantFatherHusbandName",render:e=>l.createElement(t.TextInput,{value:e.value||(null==N?void 0:N.fatherOrHusbandName),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantAddress",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value||(null==N?void 0:N.permanentAddress),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(a=p.applicantAddress)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_DOB_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantDateOfBirth",rules:{required:s("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth(),o=t.getDate()-n.getDate();return l>=18||18===l&&(i>0||0===i&&o>=0)||s("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value||(null==N?void 0:N.dob),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],disabled:D})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(r=p.applicantDateOfBirth)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_GENDER_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(c,{control:v,name:"applicantGender",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.RadioButtons,{t:s,options:g,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:D})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(u=p.applicantGender)||void 0===u?void 0:u.message)||"")),S&&l.createElement(t.Toast,{error:null==S?void 0:S.error,warning:null==S?void 0:S.warning,label:s(null==S?void 0:S.message),isDleteBtn:!0,onClose:()=>{b(null)}}))},Di=e=>{var i,o,a,r,u,s,d;const{t:c,currentStepData:v,Controller:m,control:p,setValue:f,errors:E,errorStyle:_}=e,g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",v);const e=null==v?void 0:v.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[v,f]);const{data:h}=Digit.Hooks.noc.useTenants(),[A,S]=n.useState(h);return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},c("NOC_PROFESSIONAL_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+c("NOC_PROFESSIONAL_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalName",defaultValue:null==g||null===(i=g.info)||void 0===i?void 0:i.name,rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:_},null!=E&&E.professionalName?E.professionalName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalEmailId",defaultValue:null==g||null===(o=g.info)||void 0===o?void 0:o.emailId,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:c("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(a=E.professionalEmailId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalRegId",rules:{required:c("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(r=E.professionalRegId)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalMobileNumber",defaultValue:null==g||null===(u=g.info)||void 0===u?void 0:u.mobileNumber,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:c("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:c,disable:"true"})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(s=E.professionalMobileNumber)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalAddress",rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(d=E.professionalAddress)||void 0===d?void 0:d.message)||""))},yi=e=>{var i,o,a,r,u,s,d,v,m,p,f,E,_,g,h,A,S,b,N;Digit.ULBService.getCurrentTenantId();const C=Digit.ULBService.getStateId(),{t:D,currentStepData:y,Controller:L,control:O,setValue:T,errors:I,errorStyle:w,useFieldArray:R,watch:P}=e,[x,B]=n.useState("0.00"),{fields:F,append:M,remove:U}=R({control:O,name:"floorArea"}),k=P("floorArea"),W=P("basementArea");n.useEffect(()=>{const e=null==k?void 0:k.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(W)?0:W,n=(e+parseFloat(t)).toFixed(2);B(n),T("totalFloorArea",n)},[k,W]);const[H,j]=n.useState((null==y||null===(i=y.siteDetails)||void 0===i?void 0:i.ulbName)||null),[z,V]=n.useState((null==y||null===(o=y.siteDetails)||void 0===o?void 0:o.ulbType)||""),[G,Y]=n.useState((null==y||null===(a=y.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:K,isLoading:q}=Digit.Hooks.noc.useBuildingType(C),{data:X,isLoading:J}=Digit.Hooks.noc.useRoadType(C),{data:Q,isLoading:Z}=Digit.Hooks.useTenants(),$=null==Q?void 0:Q.map(e=>c({},e,{displayName:D(e.i18nKey)}));n.useEffect(()=>{if(H){var e;const t=null==H||null===(e=H.city)||void 0===e?void 0:e.ulbType;V(t),T("ulbType",t)}},[H,T]);const[ee,te]=n.useState((null==y||null===(r=y.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),ne=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],le=Digit.Hooks.noc.useTenants(),[ie,oe]=n.useState(le),[ae,re]=n.useState((null==y||null===(u=y.siteDetails)||void 0===u?void 0:u.district)||null),[ue,se]=n.useState([]),{data:de}=Digit.Hooks.useBoundaryLocalities(null==ae?void 0:ae.code,"revenue",{enabled:!!ae},D);return n.useEffect(()=>{(null==de?void 0:de.length)>0&&se(de)},[de]),n.useEffect(()=>{se([]),T("zone",null)},[ae]),n.useEffect(()=>{const e=null==y?void 0:y.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&T(t,n)}),Array.isArray(e.floorArea))){for(let e=F.length-1;e>=0;e--)U(e);e.floorArea.forEach(e=>{M({value:e.value||""})})}},[y,T,M,U]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},D("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"plotNo",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},null!=I&&I.plotNo?I.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},D("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"proposedSiteAddress",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:200,message:D("MAX_200_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},null!=I&&I.proposedSiteAddress?I.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_ULB_NAME_LABEL"),"*"),!Z&&l.createElement(L,{control:O,name:"ulbName",rules:{required:D("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{j(t),e.onChange(t)},selected:e.value,option:$,optionKey:"displayName"})})),l.createElement(t.CardLabelError,{style:w},null!=I&&I.ulbName?I.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:z||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"khasraNo",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(s=I.khasraNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"hadbastNo",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(d=I.hadbastNo)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_ROAD_TYPE_LABEL"),"*"),!J&&l.createElement(L,{control:O,name:"roadType",rules:{required:D("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:X,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:w},(null==I||null===(v=I.roadType)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"areaLeftForRoadWidening",rules:{required:D("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:D("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(m=I.areaLeftForRoadWidening)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"netPlotAreaAfterWidening",rules:{required:D("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:D("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(p=I.netPlotAreaAfterWidening)||void 0===p?void 0:p.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"roadWidthAtSite",rules:{required:D("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:D("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},null!=I&&I.roadWidthAtSite?I.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_BUILDING_STATUS_LABEL"),"*"),!q&&l.createElement(L,{control:O,name:"buildingStatus",rules:{required:D("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{Y(t),e.onChange(t)},selected:e.value,option:K,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:w},(null==I||null===(f=I.buildingStatus)||void 0===f?void 0:f.message)||""),"BUILTUP"===(null==G?void 0:G.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(L,{control:O,name:"isBasementAreaAvailable",rules:{required:D("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{te(t),e.onChange(t)},selected:e.value,option:ne,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:w},(null==I||null===(E=I.isBasementAreaAvailable)||void 0===E?void 0:E.message)||""),"BUILTUP"===(null==G?void 0:G.code)&&"YES"===(null==ee?void 0:ee.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"basementArea",rules:{required:D("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:D("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},null!=I&&I.basementArea?I.basementArea.message:""),"BUILTUP"===(null==G?void 0:G.code)&&F.map((e,n)=>l.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},l.createElement(t.CardLabel,{className:"card-label-smaller"},0===n?"Ground":""+n," Floor Area(sq mt)*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(L,{control:O,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:D("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:D("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;return l.createElement(l.Fragment,null,l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==I||null===(i=I.floorArea)||void 0===i||null===(o=i[n])||void 0===o?void 0:o.value)&&l.createElement(t.CardLabelError,{className:w},I.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>U(n)},"❌")))),"BUILTUP"===(null==G?void 0:G.code)&&l.createElement("button",{type:"button",onClick:()=>M({value:""})},"➕ Add Floor"),"BUILTUP"===(null==G?void 0:G.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_TOTAL_FLOOR_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"totalFloorArea",defaultValue:x,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"wardNo",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(_=I.wardNo)||void 0===_?void 0:_.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_DISTRICT_LABEL"),"*"),l.createElement(L,{control:O,name:"district",rules:{required:D("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{re(t),e.onChange(t)},selected:e.value,option:ie.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name"})})),l.createElement(t.CardLabelError,{style:w},(null==I||null===(g=I.district)||void 0===g?void 0:g.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_ZONE_LABEL"),"*"),l.createElement(L,{control:O,name:"zone",rules:{required:D("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:ue,optionKey:"i18nkey"})})),l.createElement(t.CardLabelError,{style:w},(null==I||null===(h=I.zone)||void 0===h?void 0:h.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"villageName",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(A=I.villageName)||void 0===A?void 0:A.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_SITE_COLONY_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"colonyName",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(S=I.colonyName)||void 0===S?void 0:S.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_SITE_VASIKA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"vasikaNumber",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(b=I.vasikaNumber)||void 0===b?void 0:b.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+D("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(L,{control:O,name:"khewatAndKhatuniNo",rules:{required:D("REQUIRED_FIELD"),maxLength:{value:100,message:D("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},(null==I||null===(N=I.khewatAndKhatuniNo)||void 0===N?void 0:N.message)||"")),l.createElement(t.BreakLine,null)))},Li=e=>{var i,o,a,r;const{t:u,currentStepData:s,Controller:d,control:c,setValue:v,errors:m,errorStyle:p}=e,f=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[E,_]=n.useState((null==s||null===(i=s.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||null),{data:g,isLoading:h}=Digit.Hooks.noc.useBuildingCategory(f),{data:A,isLoading:S}=Digit.Hooks.noc.useNocType(f),b=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return n.useEffect(()=>{console.log("currentStepData4",s);const e=null==s?void 0:s.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;v(t,n)})},[s,v]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,u("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:c,name:"specificationPlotArea",rules:{required:u("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:u("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:u("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:u})}))),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationPlotArea?m.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_BUILDING_CATEGORY_LABEL"),"*"),!h&&g.length>0&&l.createElement(d,{control:c,name:"specificationBuildingCategory",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{_(t),e.onChange(t)},selected:e.value,option:g,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationBuildingCategory?m.specificationBuildingCategory.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_NOC_TYPE_LABEL"),"*"),!S&&l.createElement(d,{control:c,name:"specificationNocType",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:A,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(o=m.specificationNocType)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_RESTRICTED_AREA_LABEL")," *"),l.createElement(d,{control:c,name:"specificationRestrictedArea",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:b,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(a=m.specificationRestrictedArea)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL")," *"),l.createElement(d,{control:c,name:"specificationIsSiteUnderMasterPlan",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:b,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(r=m.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.message)||"")))};function Oi(e){var n,o,a,r,u,d,c,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,J,Q,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,se,de,ce,ve;let{currentStepData:me,t:pe}=e;i.useLocation(),i.useHistory(),s.useDispatch(),console.log("formData in Summary Page",me);const fe={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},Ee={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},_e={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},ge={fontWeight:"bold",color:"#555"},he=(e,n)=>l.createElement("div",{style:Ee},l.createElement(t.CardLabel,{style:ge},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let Ae=null==me||null===(n=me.documents)||void 0===n||null===(o=n.documents)||void 0===o?void 0:o.documents;return console.log("documents here in summary",Ae),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:_e},pe("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:fe},he(pe("NOC_FIRM_OWNER_NAME_LABEL"),null==me||null===(a=me.applicationDetails)||void 0===a?void 0:a.applicantOwnerOrFirmName),he(pe("NOC_APPLICANT_EMAIL_LABEL"),null==me||null===(r=me.applicationDetails)||void 0===r?void 0:r.applicantEmailId),he(pe("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==me||null===(u=me.applicationDetails)||void 0===u?void 0:u.applicantFatherHusbandName),he(pe("NOC_APPLICANT_MOBILE_NO_LABEL"),null==me||null===(d=me.applicationDetails)||void 0===d?void 0:d.applicantMobileNumber),he(pe("NOC_APPLICANT_DOB_LABEL"),null==me||null===(c=me.applicationDetails)||void 0===c?void 0:c.applicantDateOfBirth),he(pe("NOC_APPLICANT_GENDER_LABEL"),null==me||null===(v=me.applicationDetails)||void 0===v||null===(m=v.applicantGender)||void 0===m?void 0:m.code),he(pe("NOC_APPLICANT_ADDRESS_LABEL"),null==me||null===(p=me.applicationDetails)||void 0===p?void 0:p.applicantAddress)),(null==me||null===(f=me.applicationDetails)||void 0===f?void 0:f.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:_e},pe("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:fe},he(pe("NOC_PROFESSIONAL_NAME_LABEL"),null==me||null===(E=me.applicationDetails)||void 0===E?void 0:E.professionalName),he(pe("NOC_PROFESSIONAL_EMAIL_LABEL"),null==me||null===(_=me.applicationDetails)||void 0===_?void 0:_.professionalEmailId),he(pe("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==me||null===(g=me.applicationDetails)||void 0===g?void 0:g.professionalRegId),he(pe("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==me||null===(h=me.applicationDetails)||void 0===h?void 0:h.professionalMobileNumber),he(pe("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==me||null===(A=me.applicationDetails)||void 0===A?void 0:A.professionalAddress))),l.createElement("h2",{style:_e},pe("NOC_SITE_DETAILS")),l.createElement("div",{style:fe},he(pe("NOC_PLOT_NO_LABEL"),null==me||null===(S=me.siteDetails)||void 0===S?void 0:S.plotNo),he(pe("NOC_PROPOSED_SITE_ADDRESS"),null==me||null===(b=me.siteDetails)||void 0===b?void 0:b.proposedSiteAddress),he(pe("NOC_ULB_NAME_LABEL"),null==me||null===(N=me.siteDetails)||void 0===N||null===(C=N.ulbName)||void 0===C?void 0:C.name),he(pe("NOC_ULB_TYPE_LABEL"),null==me||null===(D=me.siteDetails)||void 0===D?void 0:D.ulbType),he(pe("NOC_KHASRA_NO_LABEL"),null==me||null===(y=me.siteDetails)||void 0===y?void 0:y.khasraNo),he(pe("NOC_HADBAST_NO_LABEL"),null==me||null===(L=me.siteDetails)||void 0===L?void 0:L.hadbastNo),he(pe("NOC_ROAD_TYPE_LABEL"),null==me||null===(O=me.siteDetails)||void 0===O||null===(T=O.roadType)||void 0===T?void 0:T.name),he(pe("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==me||null===(I=me.siteDetails)||void 0===I?void 0:I.areaLeftForRoadWidening),he(pe("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==me||null===(w=me.siteDetails)||void 0===w?void 0:w.netPlotAreaAfterWidening),he(pe("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==me||null===(R=me.siteDetails)||void 0===R?void 0:R.roadWidthAtSite),he(pe("NOC_BUILDING_STATUS_LABEL"),null==me||null===(P=me.siteDetails)||void 0===P||null===(x=P.buildingStatus)||void 0===x?void 0:x.name),he(pe("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==me||null===(B=me.siteDetails)||void 0===B||null===(F=B.isBasementAreaAvailable)||void 0===F?void 0:F.code),"BUILTUP"===(null==me||null===(M=me.siteDetails)||void 0===M||null===(U=M.buildingStatus)||void 0===U?void 0:U.code)&&he(pe("NOC_BASEMENT_AREA_LABEL"),null==me||null===(k=me.siteDetails)||void 0===k?void 0:k.basementArea),"BUILTUP"===(null==me||null===(W=me.siteDetails)||void 0===W||null===(H=W.buildingStatus)||void 0===H?void 0:H.code)&&(null==me||null===(j=me.siteDetails)||void 0===j||null===(z=j.floorArea)||void 0===z?void 0:z.map((e,t)=>he((e=>0===e?pe("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+pe("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==me||null===(V=me.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&he(pe("NOC_TOTAL_FLOOR_AREA_LABEL"),null==me||null===(Y=me.siteDetails)||void 0===Y?void 0:Y.totalFloorArea),he(pe("NOC_DISTRICT_LABEL"),null==me||null===(K=me.siteDetails)||void 0===K||null===(q=K.district)||void 0===q?void 0:q.name),he(pe("NOC_ZONE_LABEL"),null==me||null===(X=me.siteDetails)||void 0===X||null===(J=X.zone)||void 0===J?void 0:J.name),he(pe("NOC_SITE_WARD_NO_LABEL"),null==me||null===(Q=me.siteDetails)||void 0===Q?void 0:Q.wardNo),he(pe("NOC_SITE_VILLAGE_NAME_LABEL"),null==me||null===(Z=me.siteDetails)||void 0===Z?void 0:Z.villageName),he(pe("NOC_SITE_COLONY_NAME_LABEL"),null==me||null===($=me.siteDetails)||void 0===$?void 0:$.colonyName),he(pe("NOC_SITE_VASIKA_NO_LABEL"),null==me||null===(ee=me.siteDetails)||void 0===ee?void 0:ee.vasikaNumber),he(pe("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),null==me||null===(te=me.siteDetails)||void 0===te?void 0:te.khewatAndKhatuniNo)),l.createElement("h2",{style:_e},pe("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:fe},he(pe("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==me||null===(ne=me.siteDetails)||void 0===ne?void 0:ne.specificationPlotArea),he(pe("NOC_BUILDING_CATEGORY_LABEL"),null==me||null===(le=me.siteDetails)||void 0===le||null===(ie=le.specificationBuildingCategory)||void 0===ie?void 0:ie.name),he(pe("NOC_NOC_TYPE_LABEL"),null==me||null===(oe=me.siteDetails)||void 0===oe||null===(ae=oe.specificationNocType)||void 0===ae?void 0:ae.name),he(pe("NOC_RESTRICTED_AREA_LABEL"),null==me||null===(re=me.siteDetails)||void 0===re||null===(ue=re.specificationRestrictedArea)||void 0===ue?void 0:ue.code),he(pe("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),null==me||null===(se=me.siteDetails)||void 0===se||null===(de=se.specificationIsSiteUnderMasterPlan)||void 0===de?void 0:de.code)),l.createElement("h2",{style:_e},pe("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:fe},Array.isArray(null==me||null===(ce=me.documents)||void 0===ce||null===(ve=ce.documents)||void 0===ve?void 0:ve.documents)&&me.documents.documents.documents.length>0?l.createElement("div",{className:"documentsContainerStyle"},l.createElement(sl,{value:{workflowDocs:me.documents.documents.documents}})):l.createElement("div",null,pe("NOC_NO_DOCUMENTS_MSG"))))}function Ti(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:v,formData:m,handleSubmit:p,id:f,geocoordinates:E,setGeoCoordinates:_,dispatch:g,previewLink:h}=e;const A=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[S,b]=(Digit.ULBService.getCurrentTenantId(),n.useState(A?c({},A,{active:!0===(null==a?void 0:a.active),code:null==A?void 0:A.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[N,C]=n.useState(null),[D,y]=n.useState(()=>(null==A?void 0:A.filestoreId)||null);function L(e){const t=e.target.files[0];C(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{d.getData(e,function(){const e=d.getTag(this,"GPSLatitude"),n=d.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&n){const l=x(e).toFixed(6),i=x(n).toFixed(6);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(bi("Latitude1",e.latitude)),g(bi("Longitude1",e.longitude)),_(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(g(bi("Latitude1","")),g(bi("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(bi("Latitude2",e.latitude)),g(bi("Longitude2",e.longitude)),_(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(g(bi("Latitude2","")),g(bi("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:O}=a;var T=O;const[I,w]=n.useState(!1),[R,P]=n.useState(!1);function x(e){return e[0]+e[1]/60+e[2]/3600}return n.useEffect(()=>{null!=S&&S.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==D?void 0:D.length)||null===D?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==D))||[],{documentType:null==S?void 0:S.code,filestoreId:D,documentUid:D,documentAttachment:D}]})},[D,S]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),n.useEffect(()=>{if("update"===v){var e,t;const n=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(b(l),y(null==n?void 0:n.fileStoreId)):w(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||b({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(N){P(!0);const e=function(){if(N.size>=5242880)P(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;P(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?y(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){P(!1),u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{I&&y(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},R&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:S,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>b(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.UploadFile,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{onUpload:L,onDelete:()=>{y(null)},id:f,message:D?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!D}:{onUpload:L,onDelete:()=>{y(null)},id:f,message:D?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!D}),h&&l.createElement("div",{style:{cursor:"pointer",padding:"10px",marginLeft:"25px"},onClick:e=>{e.preventDefault(),window.open(h,"_blank")}},l.createElement(t.ViewsIcon,null)),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude1),l.createElement("p",null,"Longitude: ",E.Longitude1))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude2),l.createElement("p",null,"Longitude: ",E.Longitude2)))))}const Ii=l.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:s,documents:v,formData:m,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",v);const _=(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",_);const g=Digit.ULBService.getStateId(),[h,A]=n.useState(_?c({},_,{active:!0,code:null==_?void 0:_.documentType,i18nKey:null==_?void 0:_.documentType}):(null==u||null===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[S,b]=n.useState(null),[N,C]=n.useState(()=>(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[D,y]=n.useState([]),[L,O]=n.useState([]),[T,I]=n.useState([]||(null==m||null===(o=m.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,R]=n.useState(null),[P,x]=n.useState(null);function B(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==v?void 0:v.length)>0&&E()},[v]),n.useEffect(()=>{L.length>0&&null!=h&&h.code&&(s(e=>{if(null===N||null==(null==N?void 0:N.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==N.fileStoreId);let n=[];return L&&L.map((e,t)=>{var l,i;n.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:P},documentUid:e.fileStoreId,fileName:(null===(l=T[t])||void 0===l?void 0:l.name)||"",id:v?null===(i=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),O([])),null!=h&&h.code&&s(e=>{var t;return null===N||null==(null==N?void 0:N.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.split(".")[1])==(null==h||null===(l=h.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==N.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:N.fileStoreId,documentUid:N.fileStoreId,fileName:(null==S?void 0:S.name)||N.fileName||"document",id:v?null===(t=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[N,h]),n.useEffect(()=>{h.code||null===N||O([...L,N])},[N]);const F=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",m);let n=[];return null==m||null===(e=m.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:g}}])),console.log("selectedUplDocs here",n),n},[m]);return l.createElement("div",null,l.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:g,getFormState:function(e){let t,n,l=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{d.getData(e,function(){const e=d.getTag(this,"GPSLatitude"),n=d.getTag(this,"GPSLongitude");if(e&&n){const l=B(e),i=B(n);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),R(i.latitude),x(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==m||null===(o=m.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),y(n);let d=[];null==e||e.map((e,t)=>{var n,l,o,a;d.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(l=n.fileStoreId)||void 0===l?void 0:l.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:v?null===(a=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const c=[...v.filter(e=>e.documentType!==l),...d];s(c),null===(r=n)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=l,function(e,t){e&&b(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...v.filter(e=>e.documentType!==l)];s(e)}},setuploadedstate:F,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(yn,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),f(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),f(!0)," ")))}),wi=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:hi.filter(t=>t.stepNumber===e.stepNumber)})),Ri=(e,t,n,i)=>{var o,a,r,u,s;console.log("checkpoint here",e);const{wfComment:d,thumbnailsToShow:c,wfDocuments:v}=e;console.log("wfDocuments",v);const m={date:null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.lastModified,name:null==e||null===(a=e.assigner)||void 0===a?void 0:a.name,mobileNumber:null==e||null===(r=e.assigner)||void 0===r?void 0:r.mobileNumber,source:null==e||null===(u=e.assigner)||void 0===u?void 0:u.source};return l.createElement("div",null,(null==d?void 0:d.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,i("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},d)),(null==c||null===(s=c.thumbs)||void 0===s?void 0:s.length)>0&&l.createElement(DisplayPhotos,{srcs:c.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=c.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==v?void 0:v.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(sl,{value:{workflowDocs:v},index:t}))),l.createElement("div",{style:{marginTop:"8px"}},m.date&&l.createElement("p",null,m.date),m.name&&l.createElement("p",null,m.name),m.mobileNumber&&l.createElement("p",null,m.mobileNumber),m.source&&l.createElement("p",null,i("ES_COMMON_FILED_VIA_"+m.source.toUpperCase()))))},Pi=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const s=[{link:n+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:s,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},xi=e=>{let{stateCode:n,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:s}=Digit.Services.useStore({stateCode:n,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),s?l.createElement(t.Loader,null):"citizen"===o?l.createElement(Ei,null):l.createElement(It,{path:r,stateCode:n})},Bi={NOCModule:xi,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.useLocation(),s=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const d={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:v,data:{totalCount:m,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:s,filters:c({},d),config:{enabled:(null==d||null===(e=d.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),E=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const _=n.useMemo(()=>({Icon:l.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:v?"":m,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:m,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[v,m]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,_):null},NOCLinks:Pi,NOCApplicationOverview:()=>{var e,a,r,u,s,d,v,f,E;const{id:_}=i.useParams(),{t:g}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[S,b]=n.useState({}),[N,C]=n.useState(null),D={},[y]=n.useState(()=>(null==D?void 0:D.fileStoreId)||null),[L,O]=n.useState(null),[T,I]=n.useState([]),[w,R]=n.useState([]),[P,x]=n.useState([]),[B,F]=n.useState([]),[M,U]=n.useState([]),[k,W]=n.useState({}),[H,j]=n.useState(()=>[]),[z,V]=n.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:Y}=Digit.Hooks.obps.useMDMS(A,"NOC",["DocumentTypeMapping"]),{data:K}=Digit.Hooks.obps.useMDMS(A,"common-masters",["DocumentType"]),{isLoading:q,data:X}=Digit.Hooks.noc.useNOCDetails(g,h,{applicationNo:_}),{mutate:J}=Digit.Hooks.noc.useNOCApplicationActions(h),Q=Digit.Hooks.useWorkflowDetails({tenantId:h,id:_,moduleCode:"NOC"});var Z,$;null!=Q&&null!==(e=Q.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Q.isLoading&&(Q.data.actionState.nextActions=[...null==Q||null===(r=Q.data)||void 0===r?void 0:r.nextActions]),Q&&Q.data&&!Q.isLoading&&(Q.data.initialActionState=(null==Q||null===(Z=Q.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==Q||null===($=Q.data)||void 0===$?void 0:$.actionState)||{},Q.data.actionState=c({},Q.data)),n.useEffect(()=>{R([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;x(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;F(null==K||null===(e=K["common-masters"])||void 0===e?void 0:e.DocumentType)},[K]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),n.useEffect(()=>{if(null!=w&&w.length&&null!=P&&P.length){let e=[];w.map(t=>{var n,l;const i=P.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(n=i[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],B.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,P,B]),n.useEffect(()=>{var e,t;let n=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,l)=>{n.push(null==e?void 0:e.fileStoreId)}),j(null==n?void 0:n.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),n.useEffect(()=>{null!=H&&H.length&&Digit.UploadServices.Filefetch(H,Digit.ULBService.getStateId()).then(e=>{W(null==e?void 0:e.data)})},[H]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,s,d,c,v,f,E,_,g,h,A,S,b,N,C,D,y,I,w;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return l.createElement(n.Fragment,null,l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+p(null==a||null===(s=a[0])||void 0===s?void 0:s.code,".","_")+"_LABEL")),l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(d=o[0])||void 0===d?void 0:d.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(c=o[0])||void 0===c?void 0:c.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(v=o[0])||void 0===v?void 0:v.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(f=o[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(E=o[0])&&void 0!==E&&null!==(_=E.additionalDetails)&&void 0!==_&&_.SubmittedOn?m(Number(null==o||null===(g=o[0])||void 0===g||null===(h=g.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(A=o[0])||void 0===A?void 0:A.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?m(Number(null==o||null===(S=o[0])||void 0===S||null===(b=S.auditDetails)||void 0===b?void 0:b.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(N=o[0])&&void 0!==N&&N.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(D=o[0])||void 0===D||null===(y=D.documents)||void 0===y?void 0:y.map((e,n)=>{var o,r;return l.createElement("a",{target:"_",href:null===(o=k[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):l.createElement("div",null,l.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==Q||null===(I=Q.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>l.createElement(rl,{key:t,document:e,t:i,error:L,setError:O,setNocDocuments:U,nocDocuments:M})):null)))}return l.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>l.createElement(n.Fragment,null,l.createElement("div",{style:{maxWidth:"950px"}},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>l.createElement(t.Row,{className:"border-none",label:""+g(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return n.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;b(c({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:g,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,y,H,k]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},g("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(al,{applicationDetails:S,isLoading:q||z,isDataLoading:q,applicationData:null==X?void 0:X.applicationData,mutate:J,workflowDetails:Q,businessService:null!=Q&&null!==(s=Q.data)&&void 0!==s&&s.applicationBusinessService?null==Q||null===(d=Q.data)||void 0===d?void 0:d.applicationBusinessService:null==X||null===(v=X.applicationData)||void 0===v?void 0:v.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:N,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:a}=e;const{t:u}=o.useTranslation(),s=window.localStorage.getItem("Employee.tenant-id"),d={mobileNumber:"",applicationNo:""},v={moduleName:"noc-service",applicationStatus:[],businessService:"obpas_noc",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},m={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:v,searchForm:d,tableForm:m},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[_,g]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{searchForm:t.data})),c({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{filterForm:t.data})),c({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{tableForm:t.data})),c({},e,{tableForm:t.data})}},E),{data:h,isLoading:A}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},u),{isLoading:S,data:b}=Digit.Hooks.noc.useInbox({tenantId:s,filters:c({},_)});n.useEffect(()=>{b&&b.revalidate()},[]),console.log("data in noc==>",b);const[N,C]=n.useState([]),[D,y]=n.useState([]),[L,O]=n.useState(0);n.useEffect(()=>{b&&(y((null==b?void 0:b.statuses)||[]),C((null==b?void 0:b.table)||[]),O((null==b?void 0:b.totalCount)||0))},[b]);const T={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},I=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(fl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),w=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(El,{statuses:D,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[D,S,h,A]),R={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},m)}),g({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:d,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),g({action:"mutateSearchForm",data:d})}},P={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},m)}),g({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),g({action:"mutateFilterForm",data:v})}},x=(e=>{var t,a,r,u;let{parentRoute:s,onPageSizeChange:d,formState:v,totalCount:m,table:p,dispatch:f,onSortingByData:E}=e;const{t:_}=o.useTranslation(),g=n.useMemo(()=>[{Header:_("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:s+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(oi(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:_("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>_(null==e?void 0:e.status),disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(t=v.tableForm)||void 0===t?void 0:t.offset)/(null===(a=v.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=v.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:m,onSearch:null==v||null===(u=v.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:10*Math.ceil(m/10)-parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:c({},v.tableForm,{offset:0})}),data:p,columns:g}})(c({},{parentRoute:a,onPageSizeChange:e=>{g({action:"mutateTableForm",data:c({},_.tableForm,{limit:e.target.value})})},formState:_,totalCount:L,table:N,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===l||g({action:"mutateTableForm",data:c({},_.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:n,table:i}=e;const{t:a}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:n,locality:l,status:i}=e;return{[a("NOC_APPLICATION_NUMBER")]:t,[a("TL_COMMON_TABLE_COL_APP_DATE")]:oi(new Date(n),"dd/MM/yyyy"),[a("PT_COMMON_TABLE_COL_STATUS_LABEL")]:a(i),[a("ES_INBOX_LOCALITY")]:a(l)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:a("NOC_APPLICATION_NUMBER"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=r.useFormContext();return l.createElement(t.SearchField,null,l.createElement(r.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:i,value:o}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:a,table:N}),F={onMobileSortOrderData:e=>{const{sortOrder:t}=e;g({action:"mutateTableForm",data:c({},_.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),g({action:"mutateTableForm",data:m})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),L?l.createElement("p",{className:"inbox-count"},L):null),l.createElement(t.InboxComposer,c({isInboxLoading:S,PropsForInboxLinks:T},R,P,F,{propsForInboxTable:x,propsForInboxMobileCards:B,formState:_})))},NOCSearchApplication:e=>{let{t:t,onSubmit:a,data:u,error:s,isLoading:d,Count:c}=e;const[v,m]=n.useState(null),p=r.useForm({defaultValues:{}});n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","commencementDate"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation(),t=e=>l.createElement("span",{className:"cell-text"},e);return n.useMemo(()=>[{Header:e("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/noc/search/application-overview/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:e("NOC_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.auditDetails)&&void 0!==n&&n.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"-")}},{Header:e("NOC_APPLICANTS_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.applicantName?null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName:"-")}},{Header:e("NOC_SOURCE_MODULE_LABEL"),disableSortBy:!0,accessor:n=>t(e("MODULE_"+(null==n?void 0:n.source)||"-"))},{Header:e("NOC_SOURCE_MODULE_NUMBER"),disableSortBy:!0,accessor:e=>t((null==e?void 0:e.sourceRefId)||"-")},{Header:e("NOC_STATUS_LABEL"),accessor:n=>t(e((null==n?void 0:n.applicationStatus)&&""+n.applicationStatus||"-")),disableSortBy:!0},{Header:e("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:n=>{var l,i;return t(e((null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.currentOwner)&&""+(null==n||null===(i=n.additionalDetails)||void 0===i?void 0:i.currentOwner)||"-"))},disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),_=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,l,i;return{[t("NOC_APP_NO_LABEL")]:e.applicationNo,[t("NOC_COMMON_TABLE_COL_APP_DATE_LABEL")]:Digit.DateUtils.ConvertEpochToDate(null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime)||"-",[t("NOC_APPLICANTS_NAME_LABEL")]:(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName)||"-",[t("NOC_SOURCE_MODULE_LABEL")]:e.source?t("MODULE_"+e.source):"-",[t("NOC_SOURCE_MODULE_NUMBER")]:(null==e?void 0:e.sourceRefId)||"-",[t("WF_INBOX_HEADER_CURRENT_OWNER")]:(null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return l.createElement(r.FormProvider,p,E?l.createElement(di,{SearchFormFieldsComponent:ri,propsMobileInboxCards:_,isLoading:d,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(ci,{columns:f,SearchFormFieldsComponent:ri,onSubmit:a,data:u,error:s,isLoading:d,Count:c}))},NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.useTranslation(),a=s.useDispatch(),[r,u]=n.useState(null),d=s.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),l.createElement(gi,{stepsList:Ni,onSubmit:e=>{console.log("dataGet===",e)},step:d,setStep:e=>{a(Si(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var i,a,u;let{config:d,onGoNext:v,onBackClick:m}=e;const p=s.useDispatch(),{t:f}=o.useTranslation(),[E,_]=n.useState(null),[g,h]=n.useState(""),A=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),S=Digit.UserService.getUser(),{control:b,handleSubmit:N,setValue:C,formState:{errors:D},trigger:y,reset:L}=r.useForm(),O={Controller:r.Controller,control:b,setValue:C,errors:D,trigger:y,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:L};function T(e){p(Ai(d.key,e)),v()}function I(e){m(d.key,e)}const[w,R]=n.useState((null==A||null===(i=A.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),P=Digit.ULBService.getStateId(),[x,B]=n.useState(!1),F=null==S||null===(a=S.info)||void 0===a||null===(u=a.roles)||void 0===u?void 0:u.map(e=>e.code),{data:M,isLoading:U}=Digit.Hooks.obps.useMDMS(P,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!U){var e,t;let n=[];null==M||null===(e=M.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{n.push(e)})});const l=null==n?void 0:n.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.map(e=>{null!=F&&F.includes(e)&&R(!0)})}},[U]),n.useEffect(()=>{var e;null!=A&&null!==(e=A.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&C("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:N(e=>{y(),D.length>0?console.log("Plz fill mandatory fields in Step1"):T(e)})},l.createElement("div",{className:"employeeCard"},w?l.createElement(l.Fragment,null,l.createElement(Di,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)),l.createElement(Ci,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O))):l.createElement(l.Fragment,null,l.createElement(Ci,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:g,onClose:()=>{_(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:i,onBackClick:a,onGoNext:u}=e;const{t:d}=o.useTranslation(),v=s.useDispatch(),[m,p]=n.useState(null),[f,E]=n.useState(""),{control:_,handleSubmit:g,setValue:h,formState:{errors:A},trigger:S,watch:b}=(Digit.UserService.getUser(),r.useForm({defaultValues:{floorArea:[{value:""}]}})),N=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C={Controller:r.Controller,control:_,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:r.useFieldArray,watch:b};let D;function y(e){v(Ai(i.key,e)),u()}function L(e){a(i.key,e)}return D=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:g(e=>{var t,n,l;S();const o=parseFloat(null==e?void 0:e.areaLeftForRoadWidening)||0,a=parseFloat(null==e?void 0:e.netPlotAreaAfterWidening)||0,r=parseFloat(null==e?void 0:e.specificationPlotArea)||0;Math.abs(r-(o+a))>Number.EPSILON?p({key:"true",error:!0,message:"NOC_PLOT_AREA_SUM_VALIDATION_MESG_LABEL"}):(v(Ai(i.key,e)),null!=N&&null!==(t=N.apiData)&&void 0!==t&&null!==(n=t.Noc)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&l.applicationNo?u():function(e){try{var t,n,l,i,o,a,r,s,d,m,f,E,_,g,h,A,S,b,N,C,y,L,O,T,I,w;const R={applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(t=e.applicationDetails)||void 0===t||null===(n=t.applicantGender)||void 0===n?void 0:n.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(l=e.siteDetails)||void 0===l||null===(i=l.ulbName)||void 0===i?void 0:i.name)||"",roadType:(null==e||null===(o=e.siteDetails)||void 0===o||null===(a=o.roadType)||void 0===a?void 0:a.name)||"",buildingStatus:(null==e||null===(r=e.siteDetails)||void 0===r||null===(s=r.buildingStatus)||void 0===s?void 0:s.name)||"",isBasementAreaAvailable:(null==e||null===(d=e.siteDetails)||void 0===d||null===(m=d.isBasementAreaAvailable)||void 0===m?void 0:m.code)||"",district:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.district)||void 0===E?void 0:E.name)||"",zone:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.zone)||void 0===g?void 0:g.name)||"",specificationBuildingCategory:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.specificationBuildingCategory)||void 0===A?void 0:A.name)||"",specificationNocType:(null==e||null===(S=e.siteDetails)||void 0===S||null===(b=S.specificationNocType)||void 0===b?void 0:b.name)||"",specificationRestrictedArea:(null==e||null===(N=e.siteDetails)||void 0===N||null===(C=N.specificationRestrictedArea)||void 0===C?void 0:C.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(y=e.siteDetails)||void 0===y||null===(L=y.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.code)||""})},P={mobileNumber:(null==R||null===(O=R.applicationDetails)||void 0===O?void 0:O.applicantMobileNumber)||"",name:(null==R||null===(T=R.applicationDetails)||void 0===T?void 0:T.applicantOwnerOrFirmName)||"",emailId:(null==R||null===(I=R.applicationDetails)||void 0===I?void 0:I.applicantEmailId)||"",userName:(null==R||null===(w=R.applicationDetails)||void 0===w?void 0:w.applicantMobileNumber)||""},x={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:D,owners:[P],workflow:{action:"INITIATE"},nocDetails:{additionalDetails:R,tenantId:D}}};console.log("final Payload here==>",x),Promise.resolve(wt(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:D,details:x})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),v(Ai("apiData",e)),u(),{isSuccess:!0,response:e}):(console.error("error : create api not executed properly !!!"),p({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),{isSuccess:!1,response:e})})},function(e){return console.log("errors here in goNext - catch block",e),p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"}),{isSuccess:!1,response:response}}))}catch(e){return Promise.reject(e)}}(c({},N,{siteDetails:c({},e)})))})},l.createElement("div",{className:"employeeCard"},l.createElement(yi,c({onGoBack:L,goNext:y,currentStepData:N,t:d},C)),l.createElement(Li,c({onGoBack:L,goNext:y,currentStepData:N,t:d},C))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:L}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),m&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==m?void 0:m.error,warning:null==m?void 0:m.warning,label:d(null==m?void 0:m.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=s.useDispatch(),[d,c]=n.useState(!1),[v,m]=n.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),_=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}}),g=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});return console.log("coordinates from redux",g),l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:_,config:i.currStepConfig,onSubmit:function(e){var t,n,l,i;const a=function(e){if(!f){var t,n;const l=(null==E||null===(t=E.NOC)||void 0===t?void 0:t.Documents)||[],i=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],o=l.filter(e=>e.required).map(e=>e.code),a=i.map(e=>e.documentType);return o.filter(e=>!a.includes(e))}}(e);return a.length>0?(m(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),void c(!0)):null!=g&&null!==(t=g.Latitude1)&&void 0!==t&&t.trim()&&null!=g&&null!==(n=g.Latitude2)&&void 0!==n&&n.trim()&&null!=g&&null!==(l=g.Longitude1)&&void 0!==l&&l.trim()&&null!=g&&null!==(i=g.Longitude2)&&void 0!==i&&i.trim()?void o():(m(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void c(!0))},onFormValueChange:function(e,t){Dn.isEqual(t,_)||u(Ai(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{c(!1),m("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,d,v,m,p,f,E,_,g,h;let{config:A,onBackClick:S,t:b}=e;s.useDispatch();const[N,C]=n.useState(null),[D,y]=n.useState(""),L=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData)||{}}),O=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates in summary page",O);const T=n.useRef();let I=Digit.UserService.getUser();const w=null==I||null===(o=I.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[R,P]=n.useState(!1);Digit.Hooks.useClickOutside(T,()=>{P(!1)},R);const x=i.useHistory();let B;B=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const F=e=>{console.log("formData in parent SummaryPage",L),M(L,e)},M=function(e,t){try{if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return C({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),Promise.resolve();const n=function(e,t){var n,l,i,o,a,r,u,s,d,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y,L,T,I,w,R,P,x,B;console.log("nocFormData",e);const F=c({},null==e||null===(n=e.apiData)||void 0===n||null===(l=n.Noc)||void 0===l?void 0:l[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:c({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:c({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(d=e.applicationDetails)||void 0===d||null===(v=d.applicantGender)||void 0===v?void 0:v.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(m=e.siteDetails)||void 0===m||null===(p=m.ulbName)||void 0===p?void 0:p.name)||"",roadType:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.roadType)||void 0===E?void 0:E.name)||"",buildingStatus:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.buildingStatus)||void 0===g?void 0:g.name)||"",isBasementAreaAvailable:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.isBasementAreaAvailable)||void 0===A?void 0:A.code)||"",district:(null==e||null===(S=e.siteDetails)||void 0===S||null===(b=S.district)||void 0===b?void 0:b.name)||"",zone:(null==e||null===(N=e.siteDetails)||void 0===N||null===(C=N.zone)||void 0===C?void 0:C.name)||"",specificationBuildingCategory:(null==e||null===(D=e.siteDetails)||void 0===D||null===(y=D.specificationBuildingCategory)||void 0===y?void 0:y.name)||"",specificationNocType:(null==e||null===(L=e.siteDetails)||void 0===L||null===(T=L.specificationNocType)||void 0===T?void 0:T.name)||"",specificationRestrictedArea:(null==e||null===(I=e.siteDetails)||void 0===I||null===(w=I.specificationRestrictedArea)||void 0===w?void 0:w.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(R=e.siteDetails)||void 0===R||null===(P=R.specificationIsSiteUnderMasterPlan)||void 0===P?void 0:P.code)||""}),coordinates:c({},O)})}),documents:[]});return((null==e||null===(x=e.documents)||void 0===x||null===(B=x.documents)||void 0===B?void 0:B.documents)||[]).forEach(e=>{F.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})}),{Noc:c({},F)}}(e,t);console.log("finalPayload here==>",n);const l=wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:B,details:n})).then(function(e){var n,l,i,o,a,r;"successful"===(null==e||null===(n=e.ResponseInfo)||void 0===n?void 0:n.status)?(console.log("success: Update API "),window.location.href.includes("citizen")?"CANCEL"==t.action?(C({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{x.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),x.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(C({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{x.push("/digit-ui/employee/noc/inbox")},3e3)):x.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:e}}))):(console.error("Submission failed, not moving to next step.",null===(r=res)||void 0===r?void 0:r.response),C({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),C({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function U(e){S(A.key,e)}console.log("currentStepData in StepFour",L);const k=(null==L||null===(r=L.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.applicationNo)||"";console.log("applicationNo here==>",k);const W=Digit.Hooks.useWorkflowDetails({tenantId:B,id:k,moduleCode:"obpas_noc"});console.log("workflow Details here==>",W);let H=(null==W||null===(v=W.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==w?void 0:w.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==W||null===(f=W.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==w?void 0:w.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",H),l.createElement(l.Fragment,null,l.createElement(Oi,{onGoBack:U,goNext:F,currentStepData:L,t:b}),H&&l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:U}),R&&(null!=W&&null!==(_=W.data)&&void 0!==_&&null!==(g=_.actionState)&&void 0!==g&&g.nextActions||null!=W&&null!==(h=W.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:H,optionKey:"action",t:b,onSelect:function(e){F(e)}}):null,l.createElement(t.SubmitBar,{ref:T,label:b("WF_TAKE_ACTION"),onSubmit:()=>P(!R)})),N&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==N?void 0:N.error,warning:null==N?void 0:N.warning,label:b(null==N?void 0:N.message),onClose:()=>{C(null)}}))},NOCApplicantDetails:Ci,NOCProfessionalDetails:Di,NOCSiteDetails:yi,NOCSpecificationDetails:Li,NOCDocumentsRequired:e=>{var i,o,a;let{t:r,config:u,onSelect:d,formData:v}=e;Digit.ULBService.getStateId();const[m,p]=n.useState(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents);console.log("documents in childStep three",m);const[f,E]=n.useState(null),[_,h]=n.useState(!0),[A,S]=n.useState(!1),[b,N]=n.useState(null),C=Digit.ULBService.getStateId(),D=s.useDispatch(),{isLoading:y,data:L}=Digit.Hooks.pt.usePropertyMDMS(C,"NOC",["Documents"]),O=s.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});n.useEffect(()=>{Object.keys(O).length>0&&N(O)},[O]),console.log("coordinates (from redux)",O),console.log("geocoordinates",b);const T=()=>{let e;e=c({},v.documents,{documents:m}),d(u.key,e)};n.useEffect(()=>{var e,t;let n=0;null==L||null===(e=L.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==m||m.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),h("0"!=n&&0!=n||!((null==m?void 0:m.length)>0))},[m,A]);const I={value:{workflowDocs:null==m?void 0:m.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:w}=Digit.Hooks.noc.useNOCDocumentSearch(I),R=null==m?void 0:m.map(e=>({code:e.documentType,link:g(null==w?void 0:w.pdfFiles,e.filestoreId)}));return l.createElement("div",null,y?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:T,onSkip:()=>d(),isDisabled:_,onAdd:function(){}},null==L||null===(o=L.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>{var n;return l.createElement(Ti,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:S,handleSubmit:T,geocoordinates:b,setGeoCoordinates:N,dispatch:D,previewLink:null==R||null===(n=R.find(t=>t.code===e.code))||void 0===n?void 0:n.link})}),f&&l.createElement(t.Toast,{label:f,isDleteBtn:!0,onClose:()=>E(null),error:!0})))},NOCSummary:Oi,NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:d}=e;const v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==d||null===(i=d.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,g]=n.useState(!0),[h,A]=n.useState(!1),[S,b]=n.useState(!1),N=ht((null==d?void 0:d.PrevStateDocuments)||[]),{isLoading:C,data:D}=Digit.Hooks.pt.usePropertyMDMS(v,"NOC",["Documents"]),y=()=>{let e;e=c({},d.documents,{documents:m}),s(u.key,e)};return n.useEffect(()=>{var e,t;const n=null==D||null===(e=D.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),l=null==n?void 0:n.filter(e=>m.reduce((t,n)=>{var l,i,o,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(i=l.split("."))||void 0===i?void 0:i[0])+"."+(null==n||null===(o=n.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));g(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:y,onSkip:()=>s(),onAdd:function(){}},null==D||null===(o=D.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(Ii,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:A,formData:d,beforeUploadDocuments:N||[],isNextButtonDisabled:S,setIsNextButtonDisabled:b,handleSubmit:y}))),f&&l.createElement(t.Toast,{label:f,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=d&&d.applicationNo?l.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==d?void 0:d.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var n,a,r;const u=i.useLocation(),{pathname:s,state:d}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==d||null===(n=d.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];console.log("nocData here",m),window.localStorage.getItem("CITIZEN.CITY");const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=s.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Lt(e,t,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/citizen/noc-home")}}))))},NOCCitizenMyApplications:e=>{var a,r,u;const{t:s}=o.useTranslation(),d=(i.useHistory(),(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{}),v=window.localStorage.getItem("CITIZEN.CITY"),m={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC",mobileNumber:""},{isLoading:p,data:f}=Digit.Hooks.noc.useNOCCitizenSearchApplication(c({},m,{mobileNumber:(null==d?void 0:d.mobileNumber)||""}),v);console.log("data herein NOC==>",f);const E=["CS_CF_VIEW","CS_CF_TRACK","TL_VIEW_DETAILS"];return n.useEffect(()=>{f&&f.revalidate()},[]),p?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"applications-list-container"},l.createElement(t.Header,null,""+s("NOC_MY_APPLICATION")),0===(null==f||null===(r=f.data)||void 0===r?void 0:r.length)&&l.createElement(t.Card,{style:{textAlign:"center"}},s("NO_APPLICATIONS_MSG")),null==f||null===(u=f.data)||void 0===u?void 0:u.map((e,n)=>{var o;const a=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return l.createElement("div",{key:"card-"+n},l.createElement(t.Card,null,Object.keys(a).filter(e=>null!==a[e]).map(e=>l.createElement(t.KeyNote,{keyValue:s(e),note:s(a[e])})),l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationNo)},l.createElement(t.SubmitBar,{label:s(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,s,d,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y,L,O,T,I,w,R;const{id:P}=i.useParams(),{t:x}=o.useTranslation(),B=i.useHistory(),F=window.localStorage.getItem("CITIZEN.CITY"),[M,U]=n.useState({}),{isLoading:k,data:W}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:P},F),H=null==W?void 0:W.resData;console.log("applicationDetails here==>",H);const{data:j}=Digit.Hooks.useStore.getInitData(),{tenants:z}=j||{};let V=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};V=null==t?void 0:t.value}const G=null===(e=V)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);n.useEffect(()=>{var e;const t=null==H||null===(e=H.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,a=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,r=(null==t?void 0:t.documents)||[];console.log("applicantDetails",e),console.log("siteDetails",a),U({applicantDetails:e?[e]:[],siteDetails:a?[a]:[],Documents:r.length>0?r:[]})}},[null==H?void 0:H.Noc]),console.log("displayData here",M);const[Y,K]=n.useState(null),[q,X]=n.useState(!1),[J,Q]=n.useState(null),Z=n.useRef();Digit.Hooks.useClickOutside(Z,()=>{X(!1)},q);const $=Digit.Hooks.useWorkflowDetails({tenantId:F,id:P,moduleCode:"obpas_noc"});var ee,te;console.log("workflowDetails here=>",$),null!=$&&null!==(u=$.data)&&void 0!==u&&null!==(s=u.actionState)&&void 0!==s&&s.nextActions&&!$.isLoading&&($.data.actionState.nextActions=[...null==$||null===(d=$.data)||void 0===d?void 0:d.nextActions]),$&&$.data&&!$.isLoading&&($.data.initialActionState=(null==$||null===(ee=$.data)||void 0===ee?void 0:ee.initialActionState)||c({},null==$||null===(te=$.data)||void 0===te?void 0:te.actionState)||{},$.data.actionState=c({},$.data)),n.useEffect(()=>{$&&$.revalidate(),W&&W.revalidate()},[]);let ne=(null==$||null===(v=$.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==G?void 0:G.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==$||null===(f=$.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==G?void 0:G.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",ne),k?l.createElement(t.Loader,null):l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},x("NDC_APP_OVER_VIEW_HEADER")),"APPROVED"===(null==H||null===(_=H.Noc)||void 0===_||null===(g=_[0])||void 0===g?void 0:g.applicationStatus)&&l.createElement(t.LinkButton,{label:x("DOWNLOAD_CERTIFICATE"),style:{color:"#A52A2A"},onClick:function(){try{var e;const t=null==H||null===(e=H.Noc)||void 0===e?void 0:e[0];console.log("Property in NOC",H);const n=z.find(e=>e.code===t.tenantId);return Promise.resolve(Lt(t,n,x)).then(function(e){console.log("acknowledgementData",e),Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_APPLICANT_DETAILS")),null==M||null===(h=M.applicantDetails)||void 0===h?void 0:h.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"})))})),(null==M||null===(A=M.applicantDetails)||void 0===A?void 0:A.professionalName)&&(null==M||null===(S=M.applicantDetails)||void 0===S?void 0:S.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_SITE_DETAILS")),null==M||null===(b=M.siteDetails)||void 0===b?void 0:b.map((e,n)=>{var i,o,a,r,u,s,d,c,v,m;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:x("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:x("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:x("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:x("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:x("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"BUILTUP"==(null==e||null===(u=e.buildingStatus)||void 0===u?void 0:u.code)&&l.createElement(t.Row,{label:x("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"BUILTUP"==(null==e||null===(s=e.buildingStatus)||void 0===s?void 0:s.code)&&(null==e||null===(d=e.floorArea)||void 0===d?void 0:d.map((e,t)=>{(e=>{x(0===e?"NOC_GROUND_FLOOR_AREA_LABEL":"NOC_FLOOR_AREA_LABEL")})(t)})),"BUILTUP"==(null==e||null===(c=e.buildingStatus)||void 0===c?void 0:c.code)&&l.createElement(t.Row,{label:x("NOC_TOTAL_FLOOR_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:x("NOC_DISTRICT_LABEL"),text:(null==e||null===(v=e.district)||void 0===v?void 0:v.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ZONE_LABEL"),text:(null==e||null===(m=e.zone)||void 0===m?void 0:m.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_SPECIFICATION_DETAILS")),null==M||null===(N=M.siteDetails)||void 0===N?void 0:N.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:x("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:x("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:x("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:x("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:{display:"flex",gap:"16px"}},Array.isArray(null==M?void 0:M.Documents)&&(null==M||null===(C=M.Documents)||void 0===C?void 0:C.length)>0?l.createElement(sl,{value:{workflowDocs:null==M?void 0:M.Documents}}):l.createElement("div",null,x("NOC_NO_DOCUMENTS_MSG")))),(null==$||null===(D=$.data)||void 0===D?void 0:D.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==$||null===(y=$.data)||void 0===y?void 0:y.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:x(null==$||null===(L=$.data)||void 0===L||null===(O=L.timeline[0])||void 0===O?void 0:O.status)}):l.createElement(t.ConnectingCheckPoints,null,null==$||null===(T=$.data)||void 0===T?void 0:T.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:x("NOC_STATUS_"+e.status),customChild:Ri(e,n,0,x)})))),ne&&ne.length>0&&l.createElement(t.ActionBar,null,q&&(null!=$&&null!==(I=$.data)&&void 0!==I&&null!==(w=I.actionState)&&void 0!==w&&w.nextActions||null!=$&&null!==(R=$.data)&&void 0!==R&&R.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:ne,optionKey:"action",t:x,onSelect:function(e){var t,n;console.log("selected action",e);const l=null==H||null===(t=H.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?B.push("/digit-ui/citizen/noc/edit-application/"+l):"DRAFT"==(null==e?void 0:e.action)?K({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?function(e){try{var t,n;const l=c({},(null==H||null===(t=H.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments},console.log("updatedApplicant",l);const o={Noc:c({},l)};console.log("final Payload ",o);const a=wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:F,details:o})).then(function(e){var t,n,l;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==i?void 0:i.action)?(K({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),$.revalidate(),Q(null)):(console.log("We are calling citizen response page"),B.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})):(K({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Q(null))})},function(){K({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(i):"PAY"==(null==e?void 0:e.action)?B.push("/digit-ui/citizen/payment/collect/obpas_noc/"+l+"/"+F+"?tenantId="+F):Q(e)}}):null,l.createElement(t.SubmitBar,{ref:Z,label:x("WF_TAKE_ACTION"),onSubmit:()=>X(!q)})),Y&&l.createElement(t.Toast,{error:null==Y?void 0:Y.error,warning:null==Y?void 0:Y.warning,label:x(null==Y?void 0:Y.message),isDleteBtn:!0,onClose:()=>{K(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,s,d,v,m,p,f,E,_,g,h,A,S,b,N,C,D,y,L,O,T,I,w;const{id:R}=i.useParams(),{t:P}=o.useTranslation(),x=window.localStorage.getItem("Employee.tenant-id"),B=i.useHistory(),F=null==x?void 0:x.split(".")[0],[M,U]=n.useState(null),[k,W]=n.useState(null),[H,j]=n.useState(null),[z,V]=n.useState(null),[G,Y]=n.useState({}),[K,q]=n.useState(!1),{isLoading:X,data:J}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:R},x),Q=null==J?void 0:J.resData;console.log("applicationDetails here==>",Q);const Z=Digit.Hooks.useWorkflowDetails({tenantId:x,id:R,moduleCode:"obpas_noc"});var $,ee;console.log("workflowDetails here=>",Z),null!=Z&&null!==(e=Z.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Z.isLoading&&(Z.data.actionState.nextActions=[...null==Z||null===(r=Z.data)||void 0===r?void 0:r.nextActions]),Z&&Z.data&&!Z.isLoading&&(Z.data.initialActionState=(null==Z||null===($=Z.data)||void 0===$?void 0:$.initialActionState)||c({},null==Z||null===(ee=Z.data)||void 0===ee?void 0:ee.actionState)||{},Z.data.actionState=c({},Z.data));const[te,ne]=n.useState(!1),[le,ie]=n.useState(null),[oe,ae]=n.useState(!1),re=()=>{U(null)};let ue=Digit.UserService.getUser();const se=n.useRef();if(Digit.Hooks.useClickOutside(se,()=>{ne(!1)},te),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};ue=null==t?void 0:t.value}const de=null===(u=ue)||void 0===u||null===(s=u.info)||void 0===s||null===(d=s.roles)||void 0===d?void 0:d.map(e=>e.code);n.useEffect(()=>{Z&&Z.revalidate(),J&&J.revalidate()},[]);let ce=(null==Z||null===(v=Z.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==de?void 0:de.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==Z||null===(f=Z.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==de?void 0:de.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));console.log("actions here",ce),n.useEffect(()=>{var e;const t=null==Q||null===(e=Q.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,a=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,r=(null==t?void 0:t.documents)||[];Y({applicantDetails:e?[e]:[],siteDetails:a?[a]:[],Documents:r.length>0?r:[]})}},[null==Q?void 0:Q.Noc]);const ve=function(e){try{var t,n;const l=c({},(null==Q||null===(t=Q.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},l)};console.log("final Payload ",o);const a=wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:x,details:o})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==i?void 0:i.action))U({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Z.revalidate(),ie(null);else if("APPLY"===(null==i?void 0:i.action)||"RESUBMIT"===(null==i?void 0:i.action)||"DRAFT"===(null==i?void 0:i.action)){var n,l;console.log("We are calling employee response page"),B.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})}else U({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),Z.revalidate(),ie(null);else U({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),ie(null)})},function(){U({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};return X?l.createElement(t.Loader,null):(console.log("displayData here",G),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},P("NDC_APP_OVER_VIEW_HEADER"))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,P("NOC_APPLICANT_DETAILS")),null==G||null===(_=G.applicantDetails)||void 0===_?void 0:_.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:P("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:P("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:P("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:P("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:P("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:P("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"})))})),(null==G||null===(g=G.applicantDetails)||void 0===g?void 0:g.professionalName)&&(null==G||null===(h=G.applicantDetails)||void 0===h?void 0:h.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,P("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:P("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:P("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:P("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:P("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,P("NOC_SITE_DETAILS")),null==G||null===(A=G.siteDetails)||void 0===A?void 0:A.map((e,n)=>{var i,o,a,r,u,s,d,c,v,m;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:P("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:P("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:P("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:P("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:P("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:P("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:P("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:P("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:P("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:P("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:P("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"BUILTUP"==(null==e||null===(u=e.buildingStatus)||void 0===u?void 0:u.code)&&l.createElement(t.Row,{label:P("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"BUILTUP"==(null==e||null===(s=e.buildingStatus)||void 0===s?void 0:s.code)&&(null==e||null===(d=e.floorArea)||void 0===d?void 0:d.map((e,t)=>{(e=>{P(0===e?"NOC_GROUND_FLOOR_AREA_LABEL":"NOC_FLOOR_AREA_LABEL")})(t)})),"BUILTUP"==(null==e||null===(c=e.buildingStatus)||void 0===c?void 0:c.code)&&l.createElement(t.Row,{label:P("NOC_TOTAL_FLOOR_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:P("NOC_DISTRICT_LABEL"),text:(null==e||null===(v=e.district)||void 0===v?void 0:v.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:P("NOC_ZONE_LABEL"),text:(null==e||null===(m=e.zone)||void 0===m?void 0:m.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:P("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:P("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:P("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:P("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:P("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,P("NOC_SPECIFICATION_DETAILS")),null==G||null===(S=G.siteDetails)||void 0===S?void 0:S.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:P("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:P("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:P("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:P("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,P("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:{display:"flex",gap:"16px"}},Array.isArray(null==G?void 0:G.Documents)&&(null==G||null===(b=G.Documents)||void 0===b?void 0:b.length)>0?l.createElement(sl,{value:{workflowDocs:null==G?void 0:G.Documents}}):l.createElement("div",null,P("NOC_NO_DOCUMENTS_MSG")))),(null==Z||null===(N=Z.data)||void 0===N?void 0:N.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,P("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==Z||null===(C=Z.data)||void 0===C?void 0:C.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:P(null==Z||null===(D=Z.data)||void 0===D||null===(y=D.timeline[0])||void 0===y?void 0:y.status)}):l.createElement(t.ConnectingCheckPoints,null,null==Z||null===(L=Z.data)||void 0===L?void 0:L.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:P("NOC_STATUS_"+e.status),customChild:pl(e,n,0,P)})))),(null==ce?void 0:ce.length)>0&&l.createElement(t.ActionBar,null,te&&(null!=Z&&null!==(O=Z.data)&&void 0!==O&&null!==(T=O.actionState)&&void 0!==T&&T.nextActions||null!=Z&&null!==(I=Z.data)&&void 0!==I&&I.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:ce,optionKey:"action",t:P,onSelect:function(e){var t,n;console.log("selected action",e);const l=null==Q||null===(t=Q.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?B.push("/digit-ui/employee/noc/edit-application/"+l):"DRAFT"==(null==e?void 0:e.action)?U({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?ve(i):"PAY"==(null==e?void 0:e.action)?B.push("/digit-ui/employee/payment/collect/obpas_noc/"+l+"/"+x+"?tenantId="+x):(ae(!0),ie(e))}}):null,l.createElement(t.SubmitBar,{ref:se,label:P("WF_TAKE_ACTION"),onSubmit:()=>ne(!te)})),oe?l.createElement(ml,{t:P,action:le,tenantId:x,state:F,id:R,applicationDetails:Q,applicationData:null==Q?void 0:Q.Noc,closeModal:()=>{ie(null),ae(!1)},submitAction:ve,actionData:null==Z||null===(w=Z.data)||void 0===w?void 0:w.timeline,workflowDetails:Z,showToast:M,setShowToast:U,closeToast:re,errors:k,showErrorToast:H,errorOne:z,closeToastOne:()=>{j(null)}}):null,M&&l.createElement(t.Toast,{error:null==M?void 0:M.error,warning:null==M?void 0:M.warning,label:P(null==M?void 0:M.message),isDleteBtn:!0,onClose:re})))},NewNOCEditApplication:()=>{var e,a,r,u,d,v,m,p;const{id:f}=i.useParams(),{t:E}=(i.useHistory(),o.useTranslation()),_=s.useDispatch(),[g,h]=n.useState(null),A=s.useSelector(e=>e.noc.NOCNewApplicationFormReducer),S=A.formData,b=A.step;let N;N=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY"),console.log("tenantId here",N);const{isLoading:C,data:D}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:f},N),y=null==D?void 0:D.resData;console.log("applicationDetails here==>",y);const L=(null==y||null===(e=y.Noc)||void 0===e?void 0:e[0])||{},O=(null==L||null===(a=L.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},T=(null==L||null===(u=L.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.siteDetails)||{},I=(null==L||null===(v=L.documents)||void 0===v?void 0:v.filter(e=>(null==e?void 0:e.documentUid)||(null==e?void 0:e.documentType)))||[],w=(null==L||null===(m=L.nocDetails)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.coordinates)||{},R=Digit.ULBService.getStateId(),{data:P,isLoading:x}=Digit.Hooks.noc.useBuildingType(R),{data:B}=Digit.Hooks.noc.useRoadType(R),{data:F}=Digit.Hooks.noc.useBuildingCategory(R),{data:M}=Digit.Hooks.noc.useNocType(R),{data:U,isLoading:k}=Digit.Hooks.useTenants(),[W,H]=n.useState(Digit.Hooks.noc.useTenants()),j=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],z=null==U?void 0:U.map(e=>c({},e,{displayName:E(e.i18nKey)})),{data:V}=Digit.Hooks.obps.useMDMS(R,"common-masters",["GenderType"]);let G=[];V&&V["common-masters"].GenderType.filter(e=>e.active).map(e=>{G.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const[Y,K]=n.useState(null),{data:q}=Digit.Hooks.useBoundaryLocalities(null==Y?void 0:Y.code,"revenue",{enabled:!!Y},E);return n.useEffect(()=>{if((null==q?void 0:q.length)>0&&null!=T&&T.zone){var e;const t=(null==T||null===(e=T.zone)||void 0===e?void 0:e.name)||(null==T?void 0:T.zone),n=q.find(e=>e.name===t);n&&_(Ai("siteDetails",c({},S.siteDetails,{zone:n})))}},[q,null==T?void 0:T.zone]),n.useEffect(()=>{if(_({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!C&&!x&&null!=L&&L.nocDetails&&!k){const e={documents:{documents:null==I?void 0:I.map(e=>({documentType:(null==e?void 0:e.documentType)||"",uuid:(null==e?void 0:e.uuid)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||"",filestoreId:(null==e?void 0:e.uuid)||""}))}};Object.entries(w).forEach(e=>{let[t,n]=e;_(bi(t,n))});const t=c({},O,{applicantGender:G.find(e=>{var t;return e.code===(null==O||null===(t=O.applicantGender)||void 0===t?void 0:t.code)||e.code===(null==O?void 0:O.applicantGender)})}),n=W.find(e=>{var t;return e.name===(null==T||null===(t=T.district)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.district)});K(n);const l=c({},T,{ulbName:z.find(e=>{var t;return e.name===(null==T||null===(t=T.ulbName)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.ulbName)}),roadType:B.find(e=>{var t;return e.name===(null==T||null===(t=T.roadType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.roadType)}),buildingStatus:P.find(e=>{var t;return e.name===(null==T||null===(t=T.buildingStatus)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.buildingStatus)}),isBasementAreaAvailable:j.find(e=>{var t;return e.code===(null==T||null===(t=T.isBasementAreaAvailable)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.isBasementAreaAvailable)}),district:n,specificationBuildingCategory:F.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationBuildingCategory)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationBuildingCategory)}),specificationNocType:M.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationNocType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationNocType)}),specificationRestrictedArea:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationRestrictedArea)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationRestrictedArea)}),specificationIsSiteUnderMasterPlan:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationIsSiteUnderMasterPlan)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationIsSiteUnderMasterPlan)})});_(Ai("applicationDetails",t)),_(Ai("siteDetails",l)),_(Ai("documents",e)),_(Ai("apiData",y))}},[C,y,x]),C||!S.applicationDetails?l.createElement("div",null,l.createElement(t.Loader,null)):l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},E("NOC_REGISTRATION_APPLICATION")),l.createElement(gi,{stepsList:wi,onSubmit:e=>{},step:b,setStep:e=>{_(Si(e))}}),g&&l.createElement(t.Toast,{error:g.key,label:E(g.label),onClose:()=>{h(null)},isDleteBtn:"true"}))}};exports.NOCLinks=Pi,exports.NOCModule=xi,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:mi}),exports.initNOCComponents=()=>{Object.entries(Bi).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),n=require("react"),l=e(n),i=require("react-router-dom"),o=require("react-i18next"),a=require("react-query"),r=require("react-hook-form"),u=require("redux"),d=require("react-redux"),s=e(require("exif-js"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function v(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const m=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+i}return null},p=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},f=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],l=[],i=Digit.UserService.getUser().info.roles;return n.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&l.push(e?null==n||null===(a=n[o])||void 0===a?void 0:a.code:null==n?void 0:n[o])})})}),l},E=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=0),decodeURIComponent(e.split("?")[0].split("/").pop().slice(13))||"Document - "+(t+1)},g=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var h=function(e,t){return e===t||e!=e&&t!=t},A=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1},S=Array.prototype.splice;function N(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}N.prototype.clear=function(){this.__data__=[],this.size=0},N.prototype.delete=function(e){var t=this.__data__,n=A(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),--this.size,0))},N.prototype.get=function(e){var t=this.__data__,n=A(t,e);return n<0?void 0:t[n][1]},N.prototype.has=function(e){return A(this.__data__,e)>-1},N.prototype.set=function(e,t){var n=this.__data__,l=A(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var b=N,C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(e,t){return e(t={exports:{}},t.exports),t.exports}var y,L="object"==typeof C&&C&&C.Object===Object&&C,O="object"==typeof self&&self&&self.Object===Object&&self,T=L||O||Function("return this")(),I=T.Symbol,w=Object.prototype,R=w.hasOwnProperty,P=w.toString,x=I?I.toStringTag:void 0,B=Object.prototype.toString,F=I?I.toStringTag:void 0,M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=R.call(e,x),n=e[x];try{e[x]=void 0;var l=!0}catch(e){}var i=P.call(e);return l&&(t?e[x]=n:delete e[x]),i}(e):function(e){return B.call(e)}(e)},U=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!U(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},W=T["__core-js_shared__"],H=(y=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",j=Function.prototype.toString,z=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},V=/^\[object .+?Constructor\]$/,G=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!U(e)||(t=e,H&&H in t))&&(k(e)?G:V).test(z(e));var t}(n)?n:void 0},K=Y(T,"Map"),q=Y(Object,"create"),X=Object.prototype.hasOwnProperty,Q=Object.prototype.hasOwnProperty;function J(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},J.prototype.get=function(e){var t=this.__data__;if(q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return X.call(t,e)?t[e]:void 0},J.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:Q.call(t,e)},J.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this};var Z=J,$=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function ee(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(K||b),string:new Z}},ee.prototype.delete=function(e){var t=$(this,e).delete(e);return this.size-=t?1:0,t},ee.prototype.get=function(e){return $(this,e).get(e)},ee.prototype.has=function(e){return $(this,e).has(e)},ee.prototype.set=function(e,t){var n=$(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var te=ee;function ne(e){var t=this.__data__=new b(e);this.size=t.size}ne.prototype.clear=function(){this.__data__=new b,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof b){var l=n.__data__;if(!K||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(l)}return n.set(e,t),this.size=n.size,this};var le=ne,ie=function(){try{var e=Y(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),oe=function(e,t,n){"__proto__"==t&&ie?ie(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ae=Object.prototype.hasOwnProperty,re=function(e,t,n){var l=e[t];ae.call(e,t)&&h(l,n)&&(void 0!==n||t in e)||oe(e,t,n)},ue=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?oe(n,r,u):re(n,r,u)}return n},de=function(e){return null!=e&&"object"==typeof e},se=function(e){return de(e)&&"[object Arguments]"==M(e)},ce=Object.prototype,ve=ce.hasOwnProperty,me=ce.propertyIsEnumerable,pe=se(function(){return arguments}())?se:function(e){return de(e)&&ve.call(e,"callee")&&!me.call(e,"callee")},fe=Array.isArray,Ee=function(){return!1},_e=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ee}),ge=/^(?:0|[1-9]\d*)$/,he=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t},Ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var Ne=function(e){return function(t){return e(t)}},be=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&L.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ce=be&&be.isTypedArray,De=Ce?Ne(Ce):function(e){return de(e)&&Ae(e.length)&&!!Se[M(e)]},ye=Object.prototype.hasOwnProperty,Le=function(e,t){var n=fe(e),l=!n&&pe(e),i=!n&&!l&&_e(e),o=!n&&!l&&!i&&De(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var d in e)!t&&!ye.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||he(d,u))||r.push(d);return r},Oe=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)},Ie=function(e,t){return function(n){return e(t(n))}},we=Ie(Object.keys,Object),Re=Object.prototype.hasOwnProperty,Pe=function(e){return null!=e&&Ae(e.length)&&!k(e)},xe=function(e){return Pe(e)?Le(e):function(e){if(!Te(e))return we(e);var t=[];for(var n in Object(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Be=Object.prototype.hasOwnProperty,Fe=function(e){return Pe(e)?Le(e,!0):function(e){if(!U(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var l in e)("constructor"!=l||!t&&Be.call(e,l))&&n.push(l);return n}(e)},Me=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Ue=function(){return[]},ke=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,He=We?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];ke.call(e,r)&&(a[o++]=r)}return a}(We(e)))}:Ue,je=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},ze=Ie(Object.getPrototypeOf,Object),Ve=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)je(t,He(e)),e=ze(e);return t}:Ue,Ge=function(e,t,n){var l=t(e);return fe(e)?l:je(l,n(e))},Ye=function(e){return Ge(e,xe,He)},Ke=function(e){return Ge(e,Fe,Ve)},qe=Y(T,"DataView"),Xe=Y(T,"Promise"),Qe=Y(T,"Set"),Je=Y(T,"WeakMap"),Ze=z(qe),$e=z(K),et=z(Xe),tt=z(Qe),nt=z(Je),lt=M;(qe&&"[object DataView]"!=lt(new qe(new ArrayBuffer(1)))||K&&"[object Map]"!=lt(new K)||Xe&&"[object Promise]"!=lt(Xe.resolve())||Qe&&"[object Set]"!=lt(new Qe)||Je&&"[object WeakMap]"!=lt(new Je))&&(lt=function(e){var t=M(e),n="[object Object]"==t?e.constructor:void 0,l=n?z(n):"";if(l)switch(l){case Ze:return"[object DataView]";case $e:return"[object Map]";case et:return"[object Promise]";case tt:return"[object Set]";case nt:return"[object WeakMap]"}return t});var it=lt,ot=Object.prototype.hasOwnProperty,at=T.Uint8Array,rt=function(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t},ut=/\w*$/,dt=I?I.prototype:void 0,st=dt?dt.valueOf:void 0,ct=Object.create,vt=function(){function e(){}return function(t){if(!U(t))return{};if(ct)return ct(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mt=be&&be.isMap,pt=mt?Ne(mt):function(e){return de(e)&&"[object Map]"==it(e)},ft=be&&be.isSet,Et=ft?Ne(ft):function(e){return de(e)&&"[object Set]"==it(e)},_t={};_t["[object Arguments]"]=_t["[object Array]"]=_t["[object ArrayBuffer]"]=_t["[object DataView]"]=_t["[object Boolean]"]=_t["[object Date]"]=_t["[object Float32Array]"]=_t["[object Float64Array]"]=_t["[object Int8Array]"]=_t["[object Int16Array]"]=_t["[object Int32Array]"]=_t["[object Map]"]=_t["[object Number]"]=_t["[object Object]"]=_t["[object RegExp]"]=_t["[object Set]"]=_t["[object String]"]=_t["[object Symbol]"]=_t["[object Uint8Array]"]=_t["[object Uint8ClampedArray]"]=_t["[object Uint16Array]"]=_t["[object Uint32Array]"]=!0,_t["[object Error]"]=_t["[object Function]"]=_t["[object WeakMap]"]=!1;var gt=function e(t,n,l,i,o,a){var r,u=1&n,d=2&n,s=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!U(t))return t;var c=fe(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ot.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var v=it(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(_e(t))return Me(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=d||m?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:vt(ze(e))}(t),!u)return d?function(e,t){return ue(e,Ve(e),t)}(t,function(e,t){return e&&ue(t,Fe(t),e)}(r,t)):function(e,t){return ue(e,He(e),t)}(t,function(e,t){return e&&ue(t,xe(t),e)}(r,t))}else{if(!_t[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?rt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,ut.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return st?Object(st.call(e)):{}}}(t,v,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),Et(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pt(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(s?d?Ke:Ye:d?Fe:xe)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),re(r,o,e(i,n,l,o,t,a))}),r},ht=function(e){return gt(e,5)};const At=e=>{var i,a;const{t:r}=o.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),d=Digit.ComponentRegistryService.getComponent("NOCSearchApplication"),s=f();let v=[];1==(null==s?void 0:s.length)&&(v=[null==s||null===(i=s[0])||void 0===i?void 0:i.code]),(null==s?void 0:s.length)>1&&(null==s||s.forEach(e=>{v.push(e.code)}));const[m,p]=n.useState({offset:0,limit:10,tenantId:u,nocType:v[0]}),E={offset:0,limit:10,tenantId:u,nocType:v[0]},_=window.Digit.Utils.browser.isMobile(),{data:g,isLoading:h,isSuccess:A,error:S}=Digit.Hooks.noc.useNOCSearchApplication(u,m,{});return l.createElement("div",null,l.createElement(t.CardHeader,{styles:_?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},r("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(d,{t:r,tenantId:u,onSubmit:function(e,t){void 0===t&&(t=!1);let n=ht(e),l=E;for(const[t,n]of Object.entries(e))null!=n&&null!=n&&""!=n&&(l=c({},l,{[t]:n}));p(1==t?n:l)},isLoading:h,Count:null==g?void 0:g.count,error:S,data:!h&&A&&(null==g||null===(a=g.Noc)||void 0===a?void 0:a.length)>0?g.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},St=e=>e.substr(0,1).toUpperCase()+e.substr(1),Nt=(e,t)=>0===e?t("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+t("NOC_FLOOR_AREA_LABEL"),bt=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T;let I=[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.applicantOwnerOrFirmName)||"N/A"},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.applicantEmailId)||"N/A"},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.applicationDetails)||void 0===s?void 0:s.applicantFatherHusbandName)||"N/A"},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber)||"N/A"},{title:t("NOC_APPLICANT_DOB_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.applicantDateOfBirth)||"N/A"},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(g=_.additionalDetails)||void 0===g||null===(h=g.applicationDetails)||void 0===h||null===(A=h.applicantGender)||void 0===A?void 0:A.code)||(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.applicationDetails)||void 0===b?void 0:b.applicantGender)||"N/A"},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(D=C.additionalDetails)||void 0===D||null===(y=D.applicationDetails)||void 0===y?void 0:y.applicantAddress)||"N/A"},{title:t("NOC_APPLICANT_PROPERTY_ID_LABEL"),value:(null==e||null===(L=e.nocDetails)||void 0===L||null===(O=L.additionalDetails)||void 0===O||null===(T=O.applicationDetails)||void 0===T?void 0:T.applicantPropertyId)||"N/A"}];return{title:t("NOC_APPLICANT_DETAILS"),values:I}},Ct=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,Q,J,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,de,se,ce,ve,me,pe,fe,Ee,_e,ge,he,Ae,Se,Ne,be,Ce,De,ye,Le,Oe,Te,Ie,we,Re,Pe,xe,Be,Fe,Me,Ue,ke,We;let He=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress)||"N/A"},{title:t("NOC_ULB_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.siteDetails)||void 0===s||null===(c=s.ulbName)||void 0===c?void 0:c.name)||(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p?void 0:p.ulbName)||"N/A"},{title:t("NOC_ULB_TYPE_LABEL"),value:(null==e||null===(f=e.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E||null===(_=E.siteDetails)||void 0===_?void 0:_.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(g=e.nocDetails)||void 0===g||null===(h=g.additionalDetails)||void 0===h||null===(A=h.siteDetails)||void 0===A?void 0:A.khasraNo)||"N/A"},{title:t("NOC_HADBAST_NO_LABEL"),value:(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(D=C.additionalDetails)||void 0===D||null===(y=D.siteDetails)||void 0===y||null===(L=y.roadType)||void 0===L?void 0:L.name)||(null==e||null===(O=e.nocDetails)||void 0===O||null===(T=O.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.roadType)||"N/A"},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:(null==e||null===(w=e.nocDetails)||void 0===w||null===(R=w.additionalDetails)||void 0===R||null===(P=R.siteDetails)||void 0===P?void 0:P.areaLeftForRoadWidening)||"N/A"},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:(null==e||null===(x=e.nocDetails)||void 0===x||null===(B=x.additionalDetails)||void 0===B||null===(F=B.siteDetails)||void 0===F?void 0:F.netPlotAreaAfterWidening)||"N/A"},{title:t("NOC_NET_TOTAL_AREA_LABEL"),value:(null==e||null===(M=e.nocDetails)||void 0===M||null===(U=M.additionalDetails)||void 0===U||null===(k=U.siteDetails)||void 0===k?void 0:k.netTotalArea)||"N/A"},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:(null==e||null===(W=e.nocDetails)||void 0===W||null===(H=W.additionalDetails)||void 0===H||null===(j=H.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"},{title:t("NOC_DISTRICT_LABEL"),value:(null==e||null===(z=e.nocDetails)||void 0===z||null===(V=z.additionalDetails)||void 0===V||null===(G=V.siteDetails)||void 0===G||null===(Y=G.district)||void 0===Y?void 0:Y.name)||(null==e||null===(K=e.nocDetails)||void 0===K||null===(q=K.additionalDetails)||void 0===q||null===(X=q.siteDetails)||void 0===X?void 0:X.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(Q=e.nocDetails)||void 0===Q||null===(J=Q.additionalDetails)||void 0===J||null===(Z=J.siteDetails)||void 0===Z||null===($=Z.zone)||void 0===$?void 0:$.name)||(null==e||null===(ee=e.nocDetails)||void 0===ee||null===(te=ee.additionalDetails)||void 0===te||null===(ne=te.siteDetails)||void 0===ne?void 0:ne.zone)||"N/A"},{title:t("NOC_SITE_WARD_NO_LABEL"),value:(null==e||null===(le=e.nocDetails)||void 0===le||null===(ie=le.additionalDetails)||void 0===ie||null===(oe=ie.siteDetails)||void 0===oe?void 0:oe.wardNo)||"N/A"},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue?void 0:ue.villageName)||"N/A"},{title:t("NOC_SITE_COLONY_NAME_LABEL"),value:(null==e||null===(de=e.nocDetails)||void 0===de||null===(se=de.additionalDetails)||void 0===se||null===(ce=se.siteDetails)||void 0===ce?void 0:ce.colonyName)||"N/A"},{title:t("NOC_SITE_VASIKA_NO_LABEL"),value:(null==e||null===(ve=e.nocDetails)||void 0===ve||null===(me=ve.additionalDetails)||void 0===me||null===(pe=me.siteDetails)||void 0===pe?void 0:pe.vasikaNumber)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(fe=e.nocDetails)||void 0===fe||null===(Ee=fe.additionalDetails)||void 0===Ee||null===(_e=Ee.siteDetails)||void 0===_e?void 0:_e.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(ge=e.nocDetails)||void 0===ge||null===(he=ge.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae||null===(Se=Ae.buildingStatus)||void 0===Se?void 0:Se.name)||(null==e||null===(Ne=e.nocDetails)||void 0===Ne||null===(be=Ne.additionalDetails)||void 0===be||null===(Ce=be.siteDetails)||void 0===Ce?void 0:Ce.buildingStatus)||"N/A"},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(De=e.nocDetails)||void 0===De||null===(ye=De.additionalDetails)||void 0===ye||null===(Le=ye.siteDetails)||void 0===Le||null===(Oe=Le.isBasementAreaAvailable)||void 0===Oe?void 0:Oe.code)||(null==e||null===(Te=e.nocDetails)||void 0===Te||null===(Ie=Te.additionalDetails)||void 0===Ie||null===(we=Ie.siteDetails)||void 0===we?void 0:we.isBasementAreaAvailable)||"N/A"}];var je,ze,Ve,Ge,Ye,Ke,qe,Xe,Qe,Je;return"Built Up"==(null==e||null===(Re=e.nocDetails)||void 0===Re||null===(Pe=Re.additionalDetails)||void 0===Pe||null===(xe=Pe.siteDetails)||void 0===xe?void 0:xe.buildingStatus)&&He.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(je=e.nocDetails)||void 0===je||null===(ze=je.additionalDetails)||void 0===ze||null===(Ve=ze.siteDetails)||void 0===Ve?void 0:Ve.basementArea)||"N/A"}),"Built UP"==(null==e||null===(Be=e.nocDetails)||void 0===Be||null===(Fe=Be.additionalDetails)||void 0===Fe||null===(Me=Fe.siteDetails)||void 0===Me?void 0:Me.buildingStatus)&&(null==e||null===(Ge=e.nocDetails)||void 0===Ge||null===(Ye=Ge.additionalDetails)||void 0===Ye||null===(Ke=Ye.siteDetails)||void 0===Ke||null===(qe=Ke.floorArea)||void 0===qe||qe.map((e,n)=>He.push({title:Nt(n,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(Ue=e.nocDetails)||void 0===Ue||null===(ke=Ue.additionalDetails)||void 0===ke||null===(We=ke.siteDetails)||void 0===We?void 0:We.buildingStatus)&&He.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(Xe=e.nocDetails)||void 0===Xe||null===(Qe=Xe.additionalDetails)||void 0===Qe||null===(Je=Qe.siteDetails)||void 0===Je?void 0:Je.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:He}},Dt=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T,I,w,R;let P=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name)||(null==e||null===(d=e.nocDetails)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.siteDetails)||void 0===c?void 0:c.specificationBuildingCategory)||"N/A"},{title:t("NOC_NOC_TYPE_LABEL"),value:(null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p||null===(f=p.specificationNocType)||void 0===f?void 0:f.name)||(null==e||null===(E=e.nocDetails)||void 0===E||null===(_=E.additionalDetails)||void 0===_||null===(g=_.siteDetails)||void 0===g?void 0:g.specificationNocType)||"N/A"},{title:t("NOC_RESTRICTED_AREA_LABEL"),value:(null==e||null===(h=e.nocDetails)||void 0===h||null===(A=h.additionalDetails)||void 0===A||null===(S=A.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(C=b.additionalDetails)||void 0===C||null===(D=C.siteDetails)||void 0===D?void 0:D.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(y=e.nocDetails)||void 0===y||null===(L=y.additionalDetails)||void 0===L||null===(O=L.siteDetails)||void 0===O||null===(T=O.specificationIsSiteUnderMasterPlan)||void 0===T?void 0:T.code)||(null==e||null===(I=e.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(R=w.siteDetails)||void 0===R?void 0:R.specificationIsSiteUnderMasterPlan)||"N/A"}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:P}},yt=(e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m;let p=[{title:t("COMMON_LATITUDE1_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.coordinates)||void 0===i?void 0:i.Latitude1)||"N/A"},{title:t("COMMON_LONGITUDE1_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.coordinates)||void 0===r?void 0:r.Longitude1)||"N/A"},{title:t("COMMON_LATITUDE2_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.coordinates)||void 0===s?void 0:s.Latitude2)||"N/A"},{title:t("COMMON_LONGITUDE2_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.coordinates)||void 0===m?void 0:m.Longitude2)||"N/A"}];return{title:t("NOC_SITE_COORDINATES_LABEL"),values:p}},Lt=function(e,t){try{var n;function l(n){var l;return{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e||null===(l=e.documents)||void 0===l?void 0:l.length)>0?e.documents.map((e,l)=>{let i=g(null==n?void 0:n.data,null==e?void 0:e.uuid);return console.log("doc link",i),{title:t((null==e?void 0:e.documentType)||t("CS_NA")),value:E(i,l)||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(l):l(o))}catch(e){return Promise.reject(e)}},Ot=function(e,t,n){try{var l,i,o,a;const u=e||{};console.log("appData here in DownloadACK",u);let d=[];return null!=u&&null!==(l=u.nocDetails)&&void 0!==l&&null!==(i=l.additionalDetails)&&void 0!==i&&null!==(o=i.applicationDetails)&&void 0!==o&&o.professionalName&&d.push(((e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,m,p,f,E;let _=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:(null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.applicationDetails)||void 0===s?void 0:s.professionalRegId)||"N/A"},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.professionalMobileNumber)||"N/A"},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:_}})(u,n)),Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(r=n("ULBGRADE_"+(null==t||null===(a=t.city)||void 0===a?void 0:a.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),r.toLowerCase().split(" ").map(St).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("NOC_REGISTRATION_CERTIFICATE"),applicationNumber:(null==u?void 0:u.applicationNo)||"NA",details:[...d,bt(u,n),Ct(u,n),Dt(u,n),yt(u,n),Lt(u,n)]})}catch(e){return Promise.reject(e)}var r},Tt=e=>{var n,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];window.localStorage.getItem("Employee.tenant-id"),console.log("nocData in Response",m);const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=d.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/employee/noc/inbox")}}))))},It=e=>{let{location:n}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},wt=e=>{var a,r,u,d,s,v,m,p,f,E;let{path:_}=e;const g=i.useLocation(),h=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),A=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NOCInbox"),S=null===(s=Digit)||void 0===s||null===(v=s.ComponentRegistryService)||void 0===v?void 0:v.getComponent("NewNOCStepperForm"),N=null===(m=Digit)||void 0===m||null===(p=m.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview"),b=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("NewNOCEditApplication"),C=window.location.href.includes("/response"),D=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,C?null:l.createElement("div",{style:window.location.href.includes("application-overview")||D?{marginLeft:"10px"}:{}},l.createElement(It,{location:g})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:_+"/inbox/application-overview/:id",component:N}),l.createElement(t.PrivateRoute,{path:_+"/search/application-overview/:id",component:h}),l.createElement(t.PrivateRoute,{path:_+"/new-application",component:S}),l.createElement(t.PrivateRoute,{path:_+"/edit-application/:id",component:b}),l.createElement(t.PrivateRoute,{path:_+"/inbox",component:e=>l.createElement(A,c({},e,{parentRoute:_}))}),l.createElement(t.PrivateRoute,{path:_+"/search",component:e=>l.createElement(At,c({},e,{parentRoute:_}))}),l.createElement(t.PrivateRoute,{path:_+"/response/:id",component:Tt})))};function Rt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Pt=e=>l.createElement("h1",{className:"heading-m"},e.label),xt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Bt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xt,null)),Ft=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:g}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,A]=n.useState({}),[S,N]=n.useState({}),[b,C]=n.useState([]),[D,y]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,R]=n.useState(null),[P,x]=n.useState([]),[B,F]=n.useState(null),[M,U]=n.useState(!1);function k(e){O(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&x(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",L,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(){R(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[L]),n.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:B,setSelectedFinancialYear:F}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:D,setSelectedApprover:y,selectFile:k,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,b,P,B,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Bt,{onClick:d}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:E||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==B?void 0:B.name,propertyId:null==v?void 0:v.propertyId,tenantId:u,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:T}]),s({Property:c({},v,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Mt=e=>l.createElement("h1",{className:"heading-m"},e.label),Ut=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),kt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ut,null)),Wt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,g]=n.useState({}),[h,A]=n.useState({}),[S,N]=n.useState([]),[b,C]=n.useState({}),[D,y]=n.useState(null),[L,O]=n.useState(null),[T,I]=n.useState(null),[w,R]=n.useState([]),[P,x]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&R(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function F(e){y(e.target.files[0])}return n.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:F,uploadedFile:L,setUploadedFile:O,businessService:m}))},[r,S,w,P,L]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Mt,{label:a(_.label.heading)}),headerBarEnd:l.createElement(kt,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:L?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:L}]:null}),s({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Ht=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),jt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),zt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jt,null)),Vt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState({}),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:w,uploadedFile:y,setUploadedFile:L,businessService:m,error:O}))},[r,A,y,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ht,{label:a(E.label.heading)}),headerBarEnd:l.createElement(zt,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null,wfDocuments:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:null}),s({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Gt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Yt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Kt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yt,null)),qt=e=>{var i,o,r,u,d,s,v,m,p,f,E,_;let{t:g,action:h,tenantId:A,closeModal:S,submitAction:N,applicationDetails:b,applicationData:C,businessService:D,workflowDetails:y,blockReason:L}=e;console.log("applicationData_BPAACTIONMODAL",C),console.log("workflowDetails_BPAACTIONMODAL",y),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:A,!1);const{data:O,isLoading:T}=Digit.Hooks.useEmployeeSearch(A,{roles:null==y||null===(v=y.data)||void 0===v||null===(m=v.initialActionState)||void 0===m||null===(p=m.nextActions)||void 0===p||null===(f=p.filter(e=>(null==e?void 0:e.action)==(null==h?void 0:h.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=h&&h.isTerminateState)}),[I,w]=(a.useQueryClient(),n.useState({})),[R,P]=n.useState({}),[x,B]=n.useState([]),[F,M]=n.useState([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,K]=n.useState(null),[q,X]=n.useState(null),Q=!!Digit.Utils.browser.isMobile();function J(e){z(e.target.files[0])}n.useEffect(()=>{var e;B(null==O||null===(e=O.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[O]),n.useEffect(()=>{!function(){try{K(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)K(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))K(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==A?void 0:A.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):K(g("CS_FILE_UPLOAD_ERROR"))})},function(){K(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[j]);const Z=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{M(null==L?void 0:L.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),h&&w((e=>{var n,i,o,a,r,u,d;let{t:s,action:c,approvers:v,selectedApprover:m,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:_,uploadedFile:g,setUploadedFile:h,assigneeLabel:A,businessService:S,error:N,blockReasonFiltered:b}=e,C=!1;return"REVOCATE"!=(null==c?void 0:c.action)&&"REJECT"!=(null==c?void 0:c.action)&&"SKIP_PAYMENT"!=c.action&&"SEND_BACK_TO_CITIZEN"!=(null==c?void 0:c.action)&&"APPROVE"!=(null==c?void 0:c.action)||(C=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+S+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(i=c.state)||void 0===i?void 0:i.state)?null:s(A||"WF_ROLE_"+(null===(o=c.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:p,selected:m})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(d=c.state)||void 0===d?void 0:d.state)?l.createElement(t.Dropdown,{option:b,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:_,onDelete:()=>{h(null)},message:g?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:N})}]}]}})({t:g,action:h,approvers:x,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:J,uploadedFile:V,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:F}))},[h,x,q,V,Y]),h&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Gt,{label:g(I.label.heading)}),headerBarEnd:l.createElement(Kt,{onClick:S}),actionCancelLabel:g(I.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:g(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Q?{width:"720px"}:{},style:Q?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Q?{paddingLeft:"5px"}:{}},T?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,u,d,s,v,m,p,f,E,_,A,D,L,O,T,I,w,R,P,x,B,F,M,k,H,z,G,Y,K,q,X,Q,J,Z,$,ne;if(C=c({},C,{documents:null===(t=C)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(n=C)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:te(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==h?void 0:h.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(o=y.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==y||null===(d=y.data)||void 0===d||null===(s=d.processInstances)||void 0===s||null===(v=s[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(p=y.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.state)||void 0===_?void 0:_.applicationStatus)?[null==y||null===(A=y.data)||void 0===A||null===(D=A.processInstances)||void 0===D||null===(L=D[0])||void 0===L||null===(O=L.assigner)||void 0===O?void 0:O.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==h?void 0:h.action,riskType:null===(T=C)||void 0===T||null===(I=T.additionalDetails)||void 0===I?void 0:I.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==y||null===(w=y.data)||void 0===w||null===(R=w.processInstances)||void 0===R||null===(P=R[0])||void 0===P||null===(x=P.state)||void 0===x?void 0:x.applicationStatus)?[null==y||null===(B=y.data)||void 0===B||null===(F=B.processInstances)||void 0===F||null===(M=F[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(H=C)||void 0===H||null===(z=H.additionalDetails)||void 0===z||null===(G=z.selfCertificationCharges)||void 0===G?void 0:G.BPA_MALBA_CHARGES)+parseInt(null===(Y=C)||void 0===Y||null===(K=Y.additionalDetails)||void 0===K||null===(q=K.selfCertificationCharges)||void 0===q?void 0:q.BPA_LABOUR_CESS)+parseInt(null===(X=C)||void 0===X||null===(Q=X.additionalDetails)||void 0===Q||null===(J=Q.selfCertificationCharges)||void 0===J?void 0:J.BPA_WATER_CHARGES)+parseInt(null===(Z=C)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(ne=$.selfCertificationCharges)||void 0===ne?void 0:ne.BPA_GAUSHALA_CHARGES_CESS))S(),alert(g("Enterd Less Adjustment amount is invalid"));else{var le,ie;const e=null==b||null===(le=b.nocData)||void 0===le?void 0:le.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];if(e&&e.map(e=>{var t,o,a,r,u,d,s,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?N({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(S(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else N({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(t.Loader,null)},Xt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Qt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qt,null)),Zt=e=>{var o,r;let{t:u,action:d,tenantId:s,closeModal:v,submitAction:m,applicationData:p,businessService:f}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.assigneeRoles)||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[g,h]=(a.useQueryClient(),n.useState({})),[A,S]=n.useState({}),[N,b]=n.useState([]),[C,D]=n.useState({}),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function P(e){L(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;b(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",y,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(u("CS_FILE_UPLOAD_ERROR"))})},function(){w(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{d&&h((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:d,approvers:N,selectedApprover:C,setSelectedApprover:D,selectFile:P,uploadedFile:O,setUploadedFile:T,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[d,N,O,I]),d&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xt,{label:u(g.label.heading)}),headerBarEnd:l.createElement(Jt,{onClick:v}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=p)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=p)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),p=c({},p,{workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:O?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null},documents:o}),m({Noc:p},!1,{isNoc:!0})},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},$t=e=>l.createElement("h1",{className:"heading-m"},e.label),en=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),tn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(en,null)),nn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},ln=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState({}),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{v(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m,error:O})):r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m,error:O}))},[r,A,y,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement($t,{label:a(E.label.heading)}),headerBarEnd:l.createElement(tn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,d,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,_,g,h,A,S,b,D,L;const t=c({},null===(E=v)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=c({},null===(g=v)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(A=h.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=v)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=v)&&void 0!==D&&null!==(L=D.applicationType)&&void 0!==L&&L.includes("WATER")?"WS":"SW",assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:[]}});s({AmendmentUpdate:n})}else{if(v=c({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:[],assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],wfDocuments:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:null,processInstance:c({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:y?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ht(null==e?void 0:e.date);v.disconnectionExecutionDate=nn(t)}else if(null!=e&&e.date){const t=ht(null==e?void 0:e.date);v.connectionExecutionDate=nn(t)}var O;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=v)||void 0===d||null===(m=d.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=v)||void 0===O?void 0:O.serviceType)?s({WaterConnection:v,disconnectRequest:!0}):s({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))s({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))s({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,R,P,x,B,F,M,U,k,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?s({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},on=e=>l.createElement("h1",{className:"heading-m"},e.label),an=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),rn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(an,null)),un=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m}))},[r,A,y]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(on,{label:a(E.label.heading)}),headerBarEnd:l.createElement(rn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};v.creationReason="CREATE",s({PetRegistrationApplications:[c({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],y&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]),s({PetRegistrationApplications:[c({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},dn=e=>l.createElement("h1",{className:"heading-m"},e.label),sn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),cn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sn,null)),vn=e=>{var i,o,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:v,businessService:m}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[_,g]=n.useState({}),[h,A]=n.useState({}),[S,N]=n.useState([]),[b,C]=n.useState(""),[D,y]=n.useState([]),[L,O]=n.useState(null),T=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=n.useMemo(()=>{var e;if(E||!f||!T.length)return[];const t=new Set(T.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[E,f,T]);return console.log("years",I),n.useEffect(()=>{u&&g((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:C,businessService:m}))},[u,I,D,L]),u&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dn,{label:r(_.label.heading)}),headerBarEnd:l.createElement(cn,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=c({},v,{financialYear:i,action:"INITIATE",additionalDetail:c({},v.additionalDetail,{validityYears:b.length>0?parseInt(b):""})}),s({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},mn=e=>l.createElement("h1",{className:"heading-m"},e.label),pn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),fn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pn,null)),En=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){w(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:d})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m,isUploading:I}))},[r,A,y]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(mn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(fn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null};y&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:y}]),s({streetVendingDetail:c({},v,{workflow:n})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},_n=e=>l.createElement("h1",{className:"heading-m"},e.label),gn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(gn,null)),An=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[A,S]=n.useState([]),[N,b]=n.useState(null),[C,D]=n.useState(null),[y,L]=n.useState(null),[O,T]=n.useState(null),[I,w]=n.useState(!1);function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:R,uploadedFile:y,setUploadedFile:L,businessService:m}))},[r,A,y]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(_n,{label:a(E.label.heading)}),headerBarEnd:l.createElement(hn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};y&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:y}]),s({hallsBookingApplication:[c({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Sn=e=>l.createElement("h1",{className:"heading-m"},e.label),Nn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Nn,null)),Cn=e=>{var o,a,r;let{t:u,action:d,tenantId:s,closeModal:v,submitAction:m,applicationData:p,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),g=i.useHistory(),[h,A]=n.useState({}),[S,N]=n.useState({}),[b,C]=n.useState([]),[D,y]=n.useState(null),[L,O]=n.useState(null);return n.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:b,selectedApprover:D,setSelectedApprover:y,uploadedFile:L,setUploadedFile:O,businessService:f}))},[d,b,L]),d&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Sn,{label:u(h.label.heading)}),headerBarEnd:l.createElement(bn,{onClick:v}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};L&&(t.documents=[]),m({Asset:c({},p,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Dn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ft,e):null!=e&&e.businessService.includes("ptr")?l.createElement(un,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Wt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(vn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Vt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(qt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Zt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(ln,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(En,e):null!=e&&e.businessService.includes("chb")?l.createElement(An,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Cn,e):void 0;var yn=D(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",b="[object Float64Array]",D="[object Int8Array]",y="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,F=RegExp(x.source),M=RegExp(B.source),U=/<%-([\s\S]+?)%>/g,k=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,$=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",me="["+se+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+fe+"|"+Ee+")",be="(?:"+Se+"|"+Ee+")",Ce="(?:"+me+"|"+_e+")?",De="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",ye="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+De,Le="(?:"+[ge+me+"?",me,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),Te=RegExp(me,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Le+De,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+Ne,"$"].join("|")+")",Se+"?"+Ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pe,ye].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,Fe={};Fe[N]=Fe[b]=Fe[D]=Fe[y]=Fe[L]=Fe[O]=Fe["[object Uint8ClampedArray]"]=Fe[T]=Fe[I]=!0,Fe[o]=Fe[a]=Fe[A]=Fe[r]=Fe[S]=Fe[u]=Fe[d]=Fe[s]=Fe[v]=Fe[m]=Fe[p]=Fe[f]=Fe[E]=Fe[_]=Fe[h]=!1;var Me={};Me[o]=Me[a]=Me[A]=Me[S]=Me[r]=Me[u]=Me[N]=Me[b]=Me[D]=Me[y]=Me[L]=Me[v]=Me[m]=Me[p]=Me[f]=Me[E]=Me[_]=Me[g]=Me[O]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[d]=Me[s]=Me[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof C&&C&&C.Object===Object&&C,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ye=Ge&&Ge.exports===Ve,Ke=Ye&&He.process,qe=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Xe=qe&&qe.isArrayBuffer,Qe=qe&&qe.isDate,Je=qe&&qe.isMap,Ze=qe&&qe.isRegExp,$e=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function At(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Dt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function yt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Lt(e){return function(t){return e(t)}}function Ot(e,t){return dt(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=Nt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=Nt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Bt(e){return"\\"+Ue[e]}function Ft(e){return Re.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ut(e,t){return function(n){return e(t(n))}}function kt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function jt(e){return Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Gt=Nt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var C=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,K=t.Date,se=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,_e=C.prototype,ge=me.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Se=ge.hasOwnProperty,Ne=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,De=Ae.call(me),ye=ze._,Le=pe("^"+Ae.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,Re=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=ge.propertyIsEnumerable,Ke=_e.splice,qe=Re?Re.isConcatSpreadable:void 0,pt=Re?Re.iterator:void 0,Nt=Re?Re.toStringTag:void 0,Kt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=K&&K.now!==ze.Date.now&&K.now,Qt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=ve.ceil,Zt=ve.floor,$t=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=_e.join,ln=Ut(me.keys,me),on=ve.max,an=ve.min,rn=K.now,un=t.parseInt,dn=ve.random,sn=_e.reverse,cn=Ji(t,"DataView"),vn=Ji(t,"Map"),mn=Ji(t,"Promise"),pn=Ji(t,"Set"),fn=Ji(t,"WeakMap"),En=Ji(me,"create"),_n=fn&&new fn,gn={},hn=Lo(cn),An=Lo(vn),Sn=Lo(mn),Nn=Lo(pn),bn=Lo(fn),Cn=Re?Re.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,yn=Cn?Cn.toString:void 0;function Ln(e){if(Va(e)&&!Pa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Se.call(e,"__wrapped__"))return Oo(e)}return new In(e)}var On=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=Pa(e),l=!n&&Ra(e),i=!n&&!l&&Ma(e),o=!n&&!l&&!i&&Za(e),a=n||l||i||o,r=a?Dt(e.length,fe):[],u=r.length;for(var d in e)!t&&!Se.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Un(e){var t=e.length;return t?e[xl(0,t-1)]:void 0}function kn(e,t){return No(fi(e),qn(t,0,e.length))}function Wn(e){return No(fi(e))}function Hn(e,t,n){(void 0!==n&&!Ta(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];Se.call(e,t)&&Ta(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Ta(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return $n(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&Ei(t,Ar(t),e)}function Yn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,i=C(l),o=null==e;++n<l;)i[n]=o?void 0:fr(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var d,h=1&t,C=2&t,w=4&t;if(n&&(d=i?n(e,l,i,a):n(e)),void 0!==d)return d;if(!za(e))return e;var R=Pa(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return fi(e,d)}else{var P=eo(e),x=P==s||P==c;if(Ma(e))return di(e,h);if(P==p||P==o||x&&!i){if(d=C||x?{}:no(e),!h)return C?function(e,t){return Ei(e,$i(e),t)}(e,function(e,t){return e&&Ei(t,Sr(t),e)}(d,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Gn(d,e))}else{if(!Me[P])return i?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case A:return si(e);case r:case u:return new l(+e);case S:return function(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case b:case D:case y:case L:case O:case"[object Uint8ClampedArray]":case T:case I:return ci(e,n);case v:return new l;case m:case _:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case g:return Dn?me(Dn.call(e)):{}}}(e,P,h)}}a||(a=new Fn);var B=a.get(e);if(B)return B;a.set(e,d),Xa(e)?e.forEach(function(l){d.add(Xn(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){d.set(i,Xn(l,t,n,i,e,a))});var F=R?void 0:(w?C?Vi:zi:C?Sr:Ar)(e);return lt(F||e,function(l,i){F&&(l=e[i=l]),jn(d,i,Xn(l,t,n,i,e,a))}),d}function Qn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new Ee(n);return go(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;n&&(t=dt(t,Lt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Bn(t));e:for(;++i<r;){var s=e[i],c=null==n?s:n(s);if(s=l||0!==s?s:0,a&&c==c){for(var v=d;v--;)if(t[v]===c)continue e;u.push(s)}else o(t,c,l)||u.push(s)}return u}Ln.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:Ln}},(Ln.prototype=Tn.prototype).constructor=Ln,(In.prototype=On(Tn.prototype)).constructor=In,(wn.prototype=On(Tn.prototype)).constructor=wn,Rn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Se.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return zn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||Pn),string:new Rn}},xn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},xn.prototype.get=function(e){return Xi(this,e).get(e)},xn.prototype.has=function(e){return Xi(this,e).has(e)},xn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new xn(l)}return n.set(e,t),this.size=n.size,this};var $n=hi(rl),el=hi(ul,!0);function tl(e,t){var n=!0;return $n(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return $n(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):st(i,r):l||(i[i.length]=r)}return i}var ol=Ai(),al=Ai(!0);function rl(e,t){return e&&ol(e,t,Ar)}function ul(e,t){return e&&al(e,t,Ar)}function dl(e,t){return at(t,function(t){return Wa(e[t])})}function sl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[yo(t[n++])];return n&&n==l?e:void 0}function cl(e,t,n){var l=t(e);return Pa(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in me(e)?function(e){var t=Se.call(e,Nt),n=e[Nt];try{e[Nt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Nt]=n:delete e[Nt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Se.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=C(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Lt(t))),u=an(s.length,u),r[a]=!n&&(t||i>=120&&s.length>=120)?new Bn(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&d.length<u;){var m=s[c],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Tt(v,p):l(d,p,n))){for(a=o;--a;){var f=r[a];if(!(f?Tt(f,p):l(e[a],p,n)))continue e}v&&v.push(p),d.push(m)}}return d}function _l(e,t,n){var l=null==(e=po(e,t=oi(t,e)))?e:e[yo(ko(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Va(e)&&vl(e)==o}function hl(e,t,n,l,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var c=Pa(e),h=Pa(t),N=c?a:eo(e),b=h?a:eo(t),C=(N=N==o?p:N)==p,D=(b=b==o?p:b)==p,y=N==b;if(y&&Ma(e)){if(!Ma(t))return!1;c=!0,C=!1}if(y&&!C)return s||(s=new Fn),c||Za(e)?Hi(e,t,n,l,i,s):function(e,t,n,l,i,o,a){switch(n){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case u:case m:return Ta(+e,+t);case d:return e.name==t.name&&e.message==t.message;case f:case _:return e==t+"";case v:var s=Mt;case E:if(s||(s=Wt),e.size!=t.size&&!(1&l))return!1;var c=a.get(e);if(c)return c==t;l|=2,a.set(e,t);var p=Hi(s(e),s(t),l,i,o,a);return a.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,N,n,l,i,s);if(!(1&n)){var L=C&&Se.call(e,"__wrapped__"),O=D&&Se.call(t,"__wrapped__");if(L||O){var T=L?e.value():e,I=O?t.value():t;return s||(s=new Fn),i(T,I,n,l,s)}}return!!y&&(s||(s=new Fn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Se.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++d<u;){var f=e[s=r[d]],E=t[s];if(l)var _=a?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===_?f===E||i(f,E,n,l,o):_)){m=!1;break}p||(p="constructor"==s)}if(m&&!p){var g=e.constructor,h=t.constructor;g==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,s))}(e,t,n,l,hl,i))}function Al(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Fn;if(l)var v=l(d,s,u,e,t,c);if(!(void 0===v?hl(s,d,3,l,c):v))return!1}}return!0}function Sl(e){return!(!za(e)||(t=e,be&&be in t))&&(Wa(e)?Le:ie).test(Lo(e));var t}function Nl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Ll(e[0],e[1]):yl(e):tu(e)}function bl(e){if(!so(e))return ln(e);var t=[];for(var n in me(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=Ba(e)?C(e.length):[];return $n(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function yl(e){var t=Qi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Al(n,e,t)}}function Ll(e,t){return ao(e)&&co(t)?vo(yo(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):hl(t,l,3)}}function Ol(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Fn),za(o))!function(e,t,n,l,i,o,a){var r=Eo(e,n),u=Eo(t,n),d=a.get(u);if(d)Hn(e,n,d);else{var s=o?o(r,u,n+"",e,t,a):void 0,c=void 0===s;if(c){var v=Pa(u),m=!v&&Ma(u),p=!v&&!m&&Za(u);s=u,v||m||p?Pa(r)?s=r:Fa(r)?s=fi(r):m?(c=!1,s=di(u,!0)):p?(c=!1,s=ci(u,!0)):s=[]:Ka(u)||Ra(u)?(s=r,Ra(r)?s=ar(r):za(r)&&!Wa(r)||(s=no(u))):c=!1}c&&(a.set(u,s),i(s,u,l,o,a),a.delete(u)),Hn(e,n,s)}}(e,t,a,n,Ol,l,i);else{var r=l?l(Eo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hn(e,a,r)}},Sr)}function Tl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?dt(t,function(e){return Pa(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=dt(t,Lt(qi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,i){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=sl(e,a);n(r,a)&&kl(o,oi(a,e),r)}return o}function Rl(e,t,n,l){var i=l?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),n&&(r=dt(e,Lt(n)));++o<a;)for(var u=0,d=t[o],s=n?n(d):d;(u=i(r,s,u,l))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?Ke.call(e,i,1):Jl(e,i)}}return e}function xl(e,t){return e+Zt(dn()*(t-e+1))}function Bl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fl(e,t){return ho(mo(e,t,Yr),e+"")}function Ml(e){return Un(Tr(e))}function Ul(e,t){var n=Tr(e);return No(n,qn(t,0,n.length))}function kl(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=yo(t[i]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=l?l(s,u,r):void 0)&&(d=za(s)?s:io(t[i+1])?[]:{})}jn(r,u,d),r=r[u]}return e}var Wl=_n?function(e,t){return _n.set(e,t),e}:Yr,Hl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return No(Tr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=C(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return $n(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=n(e[s]),v=void 0!==c,m=null===c,p=c==c,f=Ja(c);if(a)var E=l||p;else E=d?p&&(l||v):r?p&&v&&(l||!m):u?p&&v&&!m&&(l||!f):!m&&!f&&(l?c<=t:c<t);E?i=s+1:o=s}return an(o,4294967294)}function Kl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ta(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function ql(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Pa(e))return dt(e,Xl)+"";if(Ja(e))return yn?yn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ql(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var d=t?null:Bi(e);if(d)return Wt(d);a=!1,i=Tt,u=new Bn}else u=t?[]:r;e:for(;++l<o;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,a&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,n)||(u!==r&&u.push(c),r.push(s))}return r}function Jl(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[yo(ko(t))]}function Zl(e,t,n,l){return kl(e,t,n(sl(e,t)),l)}function $l(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof wn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Ql(e[0]):[];for(var i=-1,o=C(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Zn(o[i]||a,e[r],t,n));return Ql(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Fa(e)?e:[]}function ii(e){return"function"==typeof e?e:Yr}function oi(e,t){return Pa(e)?e:ao(e,t)?[e]:Do(rr(e))}var ai=Fl;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=qt||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function si(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function ci(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,d=Ja(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!d&&e<t||d&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,d=on(o-a,0),s=C(u+d),c=!l;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[n[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function pi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,d=t.length,s=on(o-r,0),c=C(s+d),v=!l;++i<s;)c[i]=e[i];for(var m=i;++u<d;)c[m+u]=t[u];for(;++a<r;)(v||i<o)&&(c[m+n[a]]=e[i++]);return c}function fi(e,t){var n=-1,l=e.length;for(t||(t=C(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Yn(n,r,u):jn(n,r,u)}return n}function _i(e,t){return function(n,l){var i=Pa(n)?nt:Vn,o=t?t():{};return i(n,e,qi(l,2),o)}}function gi(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function hi(e,t){return function(n,l){if(null==n)return n;if(!Ba(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Ai(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function Si(e){return function(t){var n=Ft(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function Ni(e){return function(t){return ct(Wr(Rr(t).replace(Oe,"")),e,"")}}function bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=On(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!Ba(t)){var o=qi(n,3);t=Ar(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return ji(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Ee(n);if(o&&!r&&"wrapper"==Yi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=Yi(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Yi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Pa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function yi(e,t,n,l,i,o,a,r,u,d){var s=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:bi(e);return function E(){for(var _=arguments.length,g=C(_),h=_;h--;)g[h]=arguments[h];if(m)var A=Ki(E),S=Rt(g,A);if(l&&(g=mi(g,l,i,m)),o&&(g=pi(g,o,a,m)),_-=S,m&&_<d){var N=kt(g,A);return Pi(e,t,yi,E.placeholder,n,g,N,r,u,d-_)}var b=c?n:this,D=v?b[e]:e;return _=g.length,r?g=fo(g,r):p&&_>1&&g.reverse(),s&&u<_&&(g.length=u),this&&this!==ze&&this instanceof E&&(D=f||bi(D)),D.apply(b,g)}}function Li(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Oi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function Ti(e){return ji(function(t){return t=dt(t,Lt(qi())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Bl(t,e):t;var l=Bl(t,Jt(e/jt(t)));return Ft(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n,l){for(var i=-1,o=on(Jt((t-e)/(n||1)),0),a=C(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=or(t),n=or(n)),e(t,n)}}function Pi(e,t,n,l,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],v=n.apply(void 0,c);return ro(e)&&_o(v,c),v.placeholder=l,Ao(v,e,t)}function xi(e){var t=ve[e];return function(e,n){if(e=or(e),(n=null==n?0:an(lr(n),292))&&tn(e)){var l=(rr(e)+"e").split("e");return+((l=(rr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Bi=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Jr;function Fi(e){return function(t){var n=eo(t);return n==v?Mt(t):n==E?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(n);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:on(lr(u),0),d=void 0===d?d:lr(d),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=s?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,u,d];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?kt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:on(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=bi(e);return function i(){for(var o=arguments.length,a=C(o),r=o,u=Ki(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:kt(a,u);if((o-=d.length)<n)return Pi(e,t,yi,i.placeholder,void 0,a,d,void 0,void 0,n-o);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?yi.apply(void 0,f):function(e,t,n,l){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=l.length,s=C(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=l[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=bi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return Ao((p?Wl:_o)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ta(e,ge[n])&&!Se.call(l,n)?t:e}function ki(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ol(e,t,void 0,ki,o),o.delete(t)),e}function Wi(e){return Ka(e)?void 0:e}function Hi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,m=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,o):l(p,f,c,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,xo),e+"")}function zi(e){return cl(e,Ar,Zi)}function Vi(e){return cl(e,Sr,$i)}var Gi=_n?function(e){return _n.get(e)}:Jr;function Yi(e){for(var t=e.name+"",n=gn[t],l=Se.call(gn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(Se.call(Ln,"placeholder")?Ln:e).placeholder}function qi(){var e=Ln.iteratee||Kr;return e=e===Kr?Nl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Qi(e){for(var t=Ar(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Zi=$t?function(e){return null==e?[]:(e=me(e),at($t(e),function(t){return Ge.call(e,t)}))}:iu,$i=$t?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=yo(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Pa(e)||Ra(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:On(je(e))}function lo(e){return Pa(e)||Ra(e)||!!(qe&&e&&e[qe])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Ba(n)&&io(t,n.length):"string"==l&&t in n)&&Ta(n[t],e)}function ao(e,t){if(Pa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||j.test(e)||!H.test(e)||null!=t&&e in me(t)}function ro(e){var t=Yi(e),n=Ln[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(cn&&eo(new cn(new ArrayBuffer(1)))!=S||vn&&eo(new vn)!=v||mn&&"[object Promise]"!=eo(mn.resolve())||pn&&eo(new pn)!=E||fn&&eo(new fn)!=h)&&(eo=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Lo(n):"";if(l)switch(l){case hn:return S;case An:return v;case Sn:return"[object Promise]";case Nn:return E;case bn:return h}return t});var uo=he?Wa:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!za(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=C(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=C(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=So(Wl),go=Qt||function(e,t){return ze.setTimeout(e,t)},ho=So(Hl);function Ao(e,t,n){var l=t+"";return ho(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Q):[]}(l),n)))}function So(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function No(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=xl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var bo,Co,Do=(bo=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace($,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=bo.cache,bo);function yo(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Lo(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Fl(function(e,t){return Fa(e)?Zn(e,il(t,1,Fa,!0)):[]}),Io=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),qi(n,2)):[]}),wo=Fl(function(e,t){var n=ko(t);return Fa(n)&&(n=void 0),Fa(e)?Zn(e,il(t,1,Fa,!0),void 0,n):[]});function Ro(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),Et(e,qi(t,3),i)}function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=lr(n),i=n<0?on(l+i,0):an(i,l-1)),Et(e,qi(t,3),i,!0)}function xo(e){return null!=e&&e.length?il(e,1):[]}function Bo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=dt(e,li);return t.length&&t[0]===e[0]?El(t):[]}),Mo=Fl(function(e){var t=ko(e),n=dt(e,li);return t===ko(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,qi(t,2)):[]}),Uo=Fl(function(e){var t=ko(e),n=dt(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ko(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wo=Fl(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Pl(e,dt(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function zo(e){return null==e?e:sn.call(e)}var Vo=Fl(function(e){return Ql(il(e,1,Fa,!0))}),Go=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),Ql(il(e,1,Fa,!0),qi(t,2))}),Yo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,Ql(il(e,1,Fa,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=on(e.length,t),!0}),Dt(t,function(t){return dt(e,St(t))})}function qo(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fa(e)?Zn(e,t):[]}),Qo=Fl(function(e){return ti(at(e,Fa))}),Jo=Fl(function(e){var t=ko(e);return Fa(t)&&(t=void 0),ti(at(e,Fa),qi(t,2))}),Zo=Fl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,ti(at(e,Fa),void 0,t)}),$o=Fl(Ko),ea=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qo(e,n)});function ta(e){var t=Ln(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,n){Se.call(e,n)?++e[n]:Yn(e,n,1)}),oa=Ci(Ro),aa=Ci(Po);function ra(e,t){return(Pa(e)?lt:$n)(e,qi(t,3))}function ua(e,t){return(Pa(e)?it:el)(e,qi(t,3))}var da=_i(function(e,t,n){Se.call(e,n)?e[n].push(t):Yn(e,n,[t])}),sa=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Ba(e)?C(e.length):[];return $n(e,function(e){o[++l]=i?tt(t,e,n):_l(e,t,n)}),o}),ca=_i(function(e,t,n){Yn(e,n,t)});function va(e,t){return(Pa(e)?dt:Dl)(e,qi(t,3))}var ma=_i(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ga=Fl(function(e,t,n){var l=1;if(n.length){var i=kt(n,Ki(ga));l|=32}return Mi(e,l,t,n,i)}),ha=Fl(function(e,t,n){var l=3;if(n.length){var i=kt(n,Ki(ha));l|=32}return Mi(t,l,e,n,i)});function Aa(e,t,l){var i,o,a,r,u,d,s=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new Ee(n);function p(t){var n=i,l=o;return i=o=void 0,s=t,r=e.apply(l,n)}function f(e){return s=e,u=go(_,t),c?p(e):r}function E(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-s>=a}function _(){var e=fa();if(E(e))return g(e);u=go(_,function(e){var n=t-(e-d);return v?an(n,a-(e-s)):n}(e))}function g(e){return u=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=fa(),n=E(e);if(i=arguments,o=this,d=e,n){if(void 0===u)return f(d);if(v)return ui(u),u=go(_,t),p(d)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?on(or(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},h.flush=function(){return void 0===u?r:g(fa())},h}var Sa=Fl(function(e,t){return Jn(e,1,t)}),Na=Fl(function(e,t,n){return Jn(e,or(t)||0,n)});function ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(ba.Cache||xn),l}function Ca(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ba.Cache=xn;var Da=ai(function(e,t){var n=(t=1==t.length&&Pa(t[0])?dt(t[0],Lt(qi())):dt(il(t,1),Lt(qi()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),ya=Fl(function(e,t){return Mi(e,32,void 0,t,kt(t,Ki(ya)))}),La=Fl(function(e,t){return Mi(e,64,void 0,t,kt(t,Ki(La)))}),Oa=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=Ri(ml),wa=Ri(function(e,t){return e>=t}),Ra=gl(function(){return arguments}())?gl:function(e){return Va(e)&&Se.call(e,"callee")&&!Ge.call(e,"callee")},Pa=C.isArray,xa=Xe?Lt(Xe):function(e){return Va(e)&&vl(e)==A};function Ba(e){return null!=e&&ja(e.length)&&!Wa(e)}function Fa(e){return Va(e)&&Ba(e)}var Ma=en||ou,Ua=Qe?Lt(Qe):function(e){return Va(e)&&vl(e)==u};function ka(e){if(!Va(e))return!1;var t=vl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Wa(e){if(!za(e))return!1;var t=vl(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==lr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Je?Lt(Je):function(e){return Va(e)&&eo(e)==v};function Ya(e){return"number"==typeof e||Va(e)&&vl(e)==m}function Ka(e){if(!Va(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==De}var qa=Ze?Lt(Ze):function(e){return Va(e)&&vl(e)==f},Xa=$e?Lt($e):function(e){return Va(e)&&eo(e)==E};function Qa(e){return"string"==typeof e||!Pa(e)&&Va(e)&&vl(e)==_}function Ja(e){return"symbol"==typeof e||Va(e)&&vl(e)==g}var Za=et?Lt(et):function(e){return Va(e)&&ja(e.length)&&!!Fe[vl(e)]},$a=Ri(Cl),er=Ri(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Ba(e))return Qa(e)?zt(e):fi(e);if(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=eo(e);return(t==v?Mt:t==E?Wt:Tr)(e)}function nr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function lr(e){var t=nr(e),n=t%1;return t==t?n?t-n:t:0}function ir(e){return e?qn(lr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return Ei(e,Sr(e))}function rr(e){return null==e?"":Xl(e)}var ur=gi(function(e,t){if(so(t)||Ba(t))Ei(t,Ar(t),e);else for(var n in t)Se.call(t,n)&&jn(e,n,t[n])}),dr=gi(function(e,t){Ei(t,Sr(t),e)}),sr=gi(function(e,t,n,l){Ei(t,Sr(t),e,l)}),cr=gi(function(e,t,n,l){Ei(t,Ar(t),e,l)}),vr=ji(Kn),mr=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=Sr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ta(s,ge[d])&&!Se.call(e,d))&&(e[d]=o[d])}return e}),pr=Fl(function(e){return e.push(void 0,ki),tt(br,void 0,e)});function fr(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function Er(e,t){return null!=e&&to(e,t,fl)}var _r=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),gr=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},qi),hr=Fl(_l);function Ar(e){return Ba(e)?Mn(e):bl(e)}function Sr(e){return Ba(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var Nr=gi(function(e,t,n){Ol(e,t,n)}),br=gi(function(e,t,n,l){Ol(e,t,n,l)}),Cr=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Dr=ji(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function yr(e,t){if(null==e)return{};var n=dt(Vi(e),function(e){return[e]});return t=qi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Lr=Fi(Ar),Or=Fi(Sr);function Tr(e){return null==e?[]:Ot(e,Ar(e))}var Ir=Ni(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function Rr(e){return(e=rr(e))&&e.replace(re,Pt).replace(Te,"")}var Pr=Ni(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),xr=Ni(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Br=Si("toLowerCase"),Fr=Ni(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=Ni(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=Ni(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Si("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Hr=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new se(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=yo(t),Yn(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Di(),Gr=Di(!0);function Yr(e){return e}function Kr(e){return Nl("function"==typeof e?e:Xn(e,1))}var qr=Fl(function(e,t){return function(n){return _l(n,e,t)}}),Xr=Fl(function(e,t){return function(n){return _l(e,n,t)}});function Qr(e,t,n){var l=Ar(t),i=dl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=dl(t,Ar(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Zr=Ti(dt),$r=Ti(ot),eu=Ti(mt);function tu(e){return ao(e)?St(yo(e)):function(e){return function(t){return sl(t,e)}}(e)}var nu=wi(),lu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Oi(function(e,t){return e+t},0),uu=xi("ceil"),du=Oi(function(e,t){return e/t},1),su=xi("floor"),cu=Oi(function(e,t){return e*t},1),vu=xi("round"),mu=Oi(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Ea,Ln.assign=ur,Ln.assignIn=dr,Ln.assignInWith=sr,Ln.assignWith=cr,Ln.at=vr,Ln.before=_a,Ln.bind=ga,Ln.bindAll=jr,Ln.bindKey=ha,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},Ln.chain=ta,Ln.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(lr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=C(Jt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},Ln.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Ln.concat=function(){var e=arguments.length;if(!e)return[];for(var t=C(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(Pa(n)?fi(n):[n],il(t,1))},Ln.cond=function(e){var t=null==e?0:e.length,l=qi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Ln.conforms=function(e){return function(e){var t=Ar(e);return function(n){return Qn(n,e,t)}}(Xn(e,1))},Ln.constant=zr,Ln.countBy=ia,Ln.create=function(e,t){var n=On(e);return null==t?n:Gn(n,t)},Ln.curry=function e(t,n,l){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.curryRight=function e(t,n,l){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Ln.debounce=Aa,Ln.defaults=mr,Ln.defaultsDeep=pr,Ln.defer=Sa,Ln.delay=Na,Ln.difference=To,Ln.differenceBy=Io,Ln.differenceWith=wo,Ln.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:lr(t))<0?0:t,l):[]},Ln.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t):[]},Ln.dropRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0,!0):[]},Ln.dropWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!0):[]},Ln.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=lr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:lr(l))<0&&(l+=i),l=n>l?0:ir(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Ln.filter=function(e,t){return(Pa(e)?at:ll)(e,qi(t,3))},Ln.flatMap=function(e,t){return il(va(e,t),1)},Ln.flatMapDeep=function(e,t){return il(va(e,t),1/0)},Ln.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),il(va(e,t),n)},Ln.flatten=xo,Ln.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Ln.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:lr(t)):[]},Ln.flip=function(e){return Mi(e,512)},Ln.flow=Vr,Ln.flowRight=Gr,Ln.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Ln.functions=function(e){return null==e?[]:dl(e,Ar(e))},Ln.functionsIn=function(e){return null==e?[]:dl(e,Sr(e))},Ln.groupBy=da,Ln.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Ln.intersection=Fo,Ln.intersectionBy=Mo,Ln.intersectionWith=Uo,Ln.invert=_r,Ln.invertBy=gr,Ln.invokeMap=sa,Ln.iteratee=Kr,Ln.keyBy=ca,Ln.keys=Ar,Ln.keysIn=Sr,Ln.map=va,Ln.mapKeys=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},Ln.mapValues=function(e,t){var n={};return t=qi(t,3),rl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},Ln.matches=function(e){return yl(Xn(e,1))},Ln.matchesProperty=function(e,t){return Ll(e,Xn(t,1))},Ln.memoize=ba,Ln.merge=Nr,Ln.mergeWith=br,Ln.method=qr,Ln.methodOf=Xr,Ln.mixin=Qr,Ln.negate=Ca,Ln.nthArg=function(e){return e=lr(e),Fl(function(t){return Tl(t,e)})},Ln.omit=Cr,Ln.omitBy=function(e,t){return yr(e,Ca(qi(t)))},Ln.once=function(e){return _a(2,e)},Ln.orderBy=function(e,t,n,l){return null==e?[]:(Pa(t)||(t=null==t?[]:[t]),Pa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Ln.over=Zr,Ln.overArgs=Da,Ln.overEvery=$r,Ln.overSome=eu,Ln.partial=ya,Ln.partialRight=La,Ln.partition=ma,Ln.pick=Dr,Ln.pickBy=yr,Ln.property=tu,Ln.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Ln.pull=Wo,Ln.pullAll=Ho,Ln.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,qi(n,2)):e},Ln.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Ln.pullAt=jo,Ln.range=nu,Ln.rangeRight=lu,Ln.rearg=Oa,Ln.reject=function(e,t){return(Pa(e)?at:ll)(e,Ca(qi(t,3)))},Ln.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=qi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},Ln.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:lr(t))},Ln.reverse=zo,Ln.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),(Pa(e)?kn:Ul)(e,t)},Ln.set=function(e,t,n){return null==e?e:kl(e,t,n)},Ln.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},Ln.shuffle=function(e){return(Pa(e)?Wn:jl)(e)},Ln.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},Ln.sortBy=pa,Ln.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Ln.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,qi(t,2)):[]},Ln.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!qa(t))&&!(t=Xl(t))&&Ft(e)?ri(zt(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Fl(function(n){var l=n[t],i=ri(n,0,t);return l&&st(i,l),tt(e,this,i)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t,l):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?$l(e,qi(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?$l(e,qi(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Aa(e,t,{leading:i,maxWait:t,trailing:o})},Ln.thru=na,Ln.toArray=tr,Ln.toPairs=Lr,Ln.toPairsIn=Or,Ln.toPath=function(e){return Pa(e)?dt(e,yo):Ja(e)?[e]:fi(Do(rr(e)))},Ln.toPlainObject=ar,Ln.transform=function(e,t,n){var l=Pa(e),i=l||Ma(e)||Za(e);if(t=qi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Wa(o)?On(je(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},Ln.unary=function(e){return Ea(e,1)},Ln.union=Vo,Ln.unionBy=Go,Ln.unionWith=Yo,Ln.uniq=function(e){return e&&e.length?Ql(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?Ql(e,qi(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Ql(e,void 0,t):[]},Ln.unset=function(e,t){return null==e||Jl(e,t)},Ln.unzip=Ko,Ln.unzipWith=qo,Ln.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},Ln.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},Ln.values=Tr,Ln.valuesIn=function(e){return null==e?[]:Ot(e,Sr(e))},Ln.without=Xo,Ln.words=Wr,Ln.wrap=function(e,t){return ya(ii(t),e)},Ln.xor=Qo,Ln.xorBy=Jo,Ln.xorWith=Zo,Ln.zip=$o,Ln.zipObject=function(e,t){return ni(e||[],t||[],jn)},Ln.zipObjectDeep=function(e,t){return ni(e||[],t||[],kl)},Ln.zipWith=ea,Ln.entries=Lr,Ln.entriesIn=Or,Ln.extend=dr,Ln.extendWith=sr,Qr(Ln,Ln),Ln.add=ru,Ln.attempt=Hr,Ln.camelCase=Ir,Ln.capitalize=wr,Ln.ceil=uu,Ln.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=or(n))==n?n:0),void 0!==t&&(t=(t=or(t))==t?t:0),qn(or(e),t,n)},Ln.clone=function(e){return Xn(e,4)},Ln.cloneDeep=function(e){return Xn(e,5)},Ln.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Ln.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Ln.conformsTo=function(e,t){return null==t||Qn(e,t,Ar(t))},Ln.deburr=Rr,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=du,Ln.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:qn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Ln.eq=Ta,Ln.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(B,xt):e},Ln.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Ln.every=function(e,t,n){var l=Pa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.find=oa,Ln.findIndex=Ro,Ln.findKey=function(e,t){return ft(e,qi(t,3),rl)},Ln.findLast=aa,Ln.findLastIndex=Po,Ln.findLastKey=function(e,t){return ft(e,qi(t,3),ul)},Ln.floor=su,Ln.forEach=ra,Ln.forEachRight=ua,Ln.forIn=function(e,t){return null==e?e:ol(e,qi(t,3),Sr)},Ln.forInRight=function(e,t){return null==e?e:al(e,qi(t,3),Sr)},Ln.forOwn=function(e,t){return e&&rl(e,qi(t,3))},Ln.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},Ln.get=fr,Ln.gt=Ia,Ln.gte=wa,Ln.has=function(e,t){return null!=e&&to(e,t,pl)},Ln.hasIn=Er,Ln.head=Bo,Ln.identity=Yr,Ln.includes=function(e,t,n,l){e=Ba(e)?e:Tr(e),n=n&&!l?lr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Qa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Ln.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),_t(e,t,i)},Ln.inRange=function(e,t,n){return t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=or(e),t,n)},Ln.invoke=hr,Ln.isArguments=Ra,Ln.isArray=Pa,Ln.isArrayBuffer=xa,Ln.isArrayLike=Ba,Ln.isArrayLikeObject=Fa,Ln.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},Ln.isBuffer=Ma,Ln.isDate=Ua,Ln.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ka(e)},Ln.isEmpty=function(e){if(null==e)return!0;if(Ba(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Ra(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(so(e))return!bl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Ln.isEqual=function(e,t){return hl(e,t)},Ln.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?hl(e,t,void 0,n):!!l},Ln.isError=ka,Ln.isFinite=function(e){return"number"==typeof e&&tn(e)},Ln.isFunction=Wa,Ln.isInteger=Ha,Ln.isLength=ja,Ln.isMap=Ga,Ln.isMatch=function(e,t){return e===t||Al(e,t,Qi(t))},Ln.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Al(e,t,Qi(t),n)},Ln.isNaN=function(e){return Ya(e)&&e!=+e},Ln.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Ln.isNil=function(e){return null==e},Ln.isNull=function(e){return null===e},Ln.isNumber=Ya,Ln.isObject=za,Ln.isObjectLike=Va,Ln.isPlainObject=Ka,Ln.isRegExp=qa,Ln.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Ln.isSet=Xa,Ln.isString=Qa,Ln.isSymbol=Ja,Ln.isTypedArray=Za,Ln.isUndefined=function(e){return void 0===e},Ln.isWeakMap=function(e){return Va(e)&&eo(e)==h},Ln.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},Ln.join=function(e,t){return null==e?"":nn.call(e,t)},Ln.kebabCase=Pr,Ln.last=ko,Ln.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=lr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,ht,i,!0)},Ln.lowerCase=xr,Ln.lowerFirst=Br,Ln.lt=$a,Ln.lte=er,Ln.max=function(e){return e&&e.length?nl(e,Yr,ml):void 0},Ln.maxBy=function(e,t){return e&&e.length?nl(e,qi(t,2),ml):void 0},Ln.mean=function(e){return At(e,Yr)},Ln.meanBy=function(e,t){return At(e,qi(t,2))},Ln.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},Ln.minBy=function(e,t){return e&&e.length?nl(e,qi(t,2),Cl):void 0},Ln.stubArray=iu,Ln.stubFalse=ou,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=cu,Ln.nth=function(e,t){return e&&e.length?Tl(e,lr(t)):void 0},Ln.noConflict=function(){return ze._===this&&(ze._=ye),this},Ln.noop=Jr,Ln.now=fa,Ln.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Zt(i),n)+e+Ii(Jt(i),n)},Ln.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+Ii(t-l,n):e},Ln.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Ln.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},Ln.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nr(e),void 0===t?(t=e,e=0):t=nr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=dn();return an(e+i*(t-e+ke("1e-"+((i+"").length-1))),t)}return xl(e,t)},Ln.reduce=function(e,t,n){var l=Pa(e)?ct:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,$n)},Ln.reduceRight=function(e,t,n){var l=Pa(e)?vt:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},Ln.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),Bl(rr(e),t)},Ln.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[yo(t[l])];void 0===o&&(l=i,o=n),e=Wa(o)?o.call(e):o}return e},Ln.round=vu,Ln.runInContext=e,Ln.sample=function(e){return(Pa(e)?Un:Ml)(e)},Ln.size=function(e){if(null==e)return 0;if(Ba(e))return Qa(e)?jt(e):e.length;var t=eo(e);return t==v||t==E?e.size:bl(e).length},Ln.snakeCase=Fr,Ln.some=function(e,t,n){var l=Pa(e)?mt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Ln.sortedIndex=function(e,t){return Gl(e,t)},Ln.sortedIndexBy=function(e,t,n){return Yl(e,t,qi(n,2))},Ln.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Ta(e[l],t))return l}return-1},Ln.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Ln.sortedLastIndexBy=function(e,t,n){return Yl(e,t,qi(n,2),!0)},Ln.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Ta(e[n],t))return n}return-1},Ln.startCase=Mr,Ln.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:qn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Ln.subtract=mu,Ln.sum=function(e){return e&&e.length?Ct(e,Yr):0},Ln.sumBy=function(e,t){return e&&e.length?Ct(e,qi(t,2)):0},Ln.template=function(e,t,n){var l=Ln.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=rr(e),t=sr({},t,l,Ui);var i,o,a=sr({},t.imports,l.imports,Ui),r=Ar(a),u=Ot(a,r),d=0,s=t.interpolate||ue,c="__p += '",v=pe((t.escape||ue).source+"|"+s.source+"|"+(s===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),c+=e.slice(d,u).replace(de,Bt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Se.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(R,"$1").replace(P,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Hr(function(){return ce(r,m+"return "+c).apply(void 0,u)});if(f.source=c,ka(f))throw f;return f},Ln.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Dt(l,t=qi(t));++n<e;)t(n);return i},Ln.toFinite=nr,Ln.toInteger=lr,Ln.toLength=ir,Ln.toLower=function(e){return rr(e).toLowerCase()},Ln.toNumber=or,Ln.toSafeInteger=function(e){return e?qn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},Ln.toString=rr,Ln.toUpper=function(e){return rr(e).toUpperCase()},Ln.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return yt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ri(l,It(l,i),wt(l,i)+1).join("")},Ln.trimEnd=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,0,wt(l,zt(t))+1).join("")},Ln.trimStart=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,It(l,zt(t))).join("")},Ln.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=rr(e)).length;if(Ft(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-jt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),qa(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=pe(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xl(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Ln.unescape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,Gt):e},Ln.uniqueId=function(e){var t=++Ne;return rr(e)+t},Ln.upperCase=Ur,Ln.upperFirst=kr,Ln.each=ra,Ln.eachRight=ua,Ln.first=Bo,Qr(Ln,(au={},rl(Ln,function(e,t){Se.call(Ln.prototype,t)||(au[t]=e)}),au),{chain:!1}),Ln.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(lr(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Yr)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return _l(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ca(qi(e)))},wn.prototype.slice=function(e,t){e=lr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=lr(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},rl(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Ln[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Ln.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],d=r||Pa(t),s=function(e){var t=i.apply(Ln,st([e],a));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&d){t=p?t:new wn(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[s],thisArg:void 0}),new In(f,c)}return m&&p?e.apply(this,a):(f=this.thru(s),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Pa(i)?i:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Ln[t];if(n){var l=n.name+"";Se.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[yi(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=l?r:a-1,s=this.__iteratees__,c=s.length,v=0,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&v<m;){for(var f=-1,E=e[d+=t];++f<c;){var _=s[f],g=_.type,h=(0,_.iteratee)(E);if(2==g)E=h;else if(!h){if(1==g)continue e;break e}}p[v++]=E}return p},Ln.prototype.at=la,Ln.prototype.chain=function(){return ta(this)},Ln.prototype.commit=function(){return new In(this.value(),this.__chain__)},Ln.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var l=Oo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zo)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,pt&&(Ln.prototype[pt]=function(){return this}),Ln}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(C)});function Ln(e){let{documents:n,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==n?void 0:n.map((e,i)=>{var o,s,c;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const On=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,g]=n.useState([]),[h,A]=n.useState(!0),[S,N]=n.useState(!1),[b,C]=n.useState(!1),{isLoading:D,data:y}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:L,data:O}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=y&&null!==(e=y.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==y||null===(o=y.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==O||null===(t=O["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),g(d)},[!D,!L]),n.useEffect(()=>{let e=0;_.map(t=>{let n=!1;m.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),A("0"!=e&&0!=e||!(m.length>0))},[m,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Tn,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:N,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:b}))))};function Tn(e){var i,o;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:v,checkEnablingDocs:m}=e;const p=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,_]=n.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,h]=n.useState(null),[A,S]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[N,b]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==E?void 0:E.code,fileStoreId:A,documentUid:A,fileName:(null==g?void 0:g.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),n.useEffect(()=>{try{N.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],N.map(e=>{var t,n,l;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[N,E]),n.useEffect(()=>{},[g]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Ln,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&b(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function In(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Ln,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function wn(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=Rt(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Rn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==d?void 0:d.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[g,h]=n.useState([]),[A,S]=n.useState([]),[N,b]=n.useState(!1),[C,D]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[y,L]=n.useState(null),O=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,s,c;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(n=d.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,g]),n.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:O?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Ln,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),N&&(null==A?void 0:A.map((e,t)=>l.createElement(wn,{key:t,document:e,t:o,error:y,setError:L,setNocDocuments:D,nocDocuments:C,checkEnablingDocs:N}))))},Pn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[d,s,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?c({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==d?void 0:d.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function xn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:a}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Bn(e){let{floors:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},i(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Fn(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=o.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=c({},u,{maxWidth:"950px"}),u=c({},u,{maxWidth:"950px"}),s={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:d},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Mn=e=>{var i,a;let{scrutinyDetails:r,paymentsList:u=[],additionalDetails:d,applicationData:s}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==s?void 0:s.status))&&window.location.href.includes("bpa");const[c,v]=n.useState(),[m,p]=n.useState(),[f,E]=n.useState(),_=Digit.ULBService.getStateId(),[g,h]=n.useState(),[A,S]=n.useState(),[N,b]=n.useState([]),[C,D]=n.useState(),[y,L]=n.useState(""),[O,T]=n.useState(null),[I,w]=n.useState({}),[R,P]=n.useState(!1),[x,B]=n.useState(!1);n.useEffect(()=>{!function(){try{T(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(C.size>=2e6)T(F("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b([...N,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):T(F("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else T(F("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(N))},[N]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=d&&null!==(e=d.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==d?void 0:d.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==d||null===(n=d.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==d||null===(l=d.lessAdjustmentFeeFiles[(null==d||null===(i=d.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,_).then(e=>w(null==e?void 0:e.data))}v(null==d||null===(t=d.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==d||null===(n=d.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),p(null==d||null===(l=d.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==d||null===(i=d.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==d||null===(o=d.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==d||null===(a=d.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==d?void 0:d.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==d?void 0:d.otherFeesDiscription),b(null==d?void 0:d.lessAdjustmentFeeFiles)},[d]);const{t:F}=o.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},F(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?F(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void F("NA");return l.createElement(n.Fragment,null,!(null!=r&&r.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==r||null===(i=r.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+F(""+e.title),text:null!=e&&e.value?M(e)+" "+F(null==e?void 0:e.isUnit):F("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+F(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},F(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},F(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},Un=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=o.useTranslation(),m=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>p.map(e=>({Header:v(""+e.name),accessor:f(e.id),id:e.id})));function _(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:Number(null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea).toFixed(2),FloorArea:Number(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function g(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:E,getCellProps:e=>({style:{}})})))})))},kn=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Wn=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,v]=n.useState(!1),{t:m}=o.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(kn,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{v(!0)},style:{color:"#800000"}},m("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},m("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Hn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function jn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const zn=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation();let v=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const p=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:h}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var n;return l.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Vn=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Gn=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Yn=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[A,S]=n.useState(!1),[N,b]=n.useState(v||{}),[C,D]=n.useState(null),[y,L]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[O,T]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=c({},null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,s,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(s=v.billDetails)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.taxAmount)}];T(e),L(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),b(i)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),P=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),B=function(e,t,n){void 0===t&&(t=!1);let l=c({},N);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},O&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==O?void 0:O.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==y?void 0:y.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,A&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{b(v),S(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(v),S(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=N&&N.adhocPenalty?Number(null==N?void 0:N.adhocPenalty):0,n=null!=N&&N.adhocRebate?Number(null==N?void 0:N.adhocRebate):0;var l,i;if(t||n)if(n>(null==d||null===(l=d.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,h,A;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n=c({},null==d||null===(v=d.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,N);d.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==d||null===(f=d.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(h=d.additionalDetails)||void 0===h||null===(A=h.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,d,s,c,v,p,f,g,h;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const A=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(ht(e.Calculation[0])),L(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(A),N.billDetails=null==e?void 0:e.Calculation,m(N),S(!1)}).catch(e=>{var t,n,l,i,o,a;D({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Vn,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==N?void 0:N.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==N||null===(r=N.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==N?void 0:N.adhocPenaltyComment)||"",onChange:e=>B("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==N?void 0:N.adhocPenalty)||"",onChange:e=>B("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Gn,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==N?void 0:N.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==N||null===(u=N.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==N?void 0:N.adhocRebateComment)||"",onChange:e=>B("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==N?void 0:N.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:s(null==C?void 0:C.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},Kn=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:c({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},qn=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(Kn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Xn=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:m}=o.useTranslation(),[p,f]=n.useState(!1),[E,_]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),h=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(h,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),_(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(A,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Qn={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Jn=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Qn.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Qn.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:c({},Qn.cell,Qn.cellLeft,Qn.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:c({},Qn.cell,n.length==t+1?Qn.cellRight:{},Qn.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:c({},Qn.cell,Qn.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,i)=>l.createElement("td",{style:c({},Qn.cell,{textAlign:"left"},n.length==i+1?Qn.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:c({},Qn.cell,Qn.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:c({},Qn.cell,Qn.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:c({},Qn.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Qn.cell,key:t,numeric:!0})))))))},Zn={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},$n=e=>{var t,i,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(i=s)||void 0===i?void 0:i.reduce((e,t,n)=>e+t.amount,0))||0;let v="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let m={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{m[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let p=[];p=Object.keys(m),p.sort((e,t)=>m[e]-m[t]);const[f,E]=n.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Zn.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Jn,{headers:[...p],values:d,arrears:v}),!f&&l.createElement("div",{style:Zn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Zn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},el=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))};function tl(e){var a,r,u,d,s,v,m,p,f,E,g,h,A,S,N,b;let{applicationDetails:C,demandData:D,workflowDetails:y,isDataLoading:L,applicationData:O,businessService:T,timelineStatusPrefix:I,showTimeLine:w=!0,statusAttribute:R="status",paymentsList:P,oldValue:x,isInfoLabel:B=!1,propertyId:F,moduleCode:M}=e;const{t:U}=o.useTranslation(),k=i.useHistory(),W=Digit.ULBService.getCurrentTenantId(),[H,j]=n.useState(null),[z,V]=n.useState([]);let G=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function Y(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",C);const[K,q]=n.useState({}),[X,Q]=n.useState(),[J,Z]=n.useState([]),[$,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.status)||$.loading||$.loaded||$.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==$||!$.canLoad||$.loading||$.loaded||(ee({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const o=Array.from(l.values());return Z(o),console.log(o),Q(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||W,null==O?void 0:O.propertyId,q,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ne=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==O||null===(i=O.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(Wn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},s=null==n?void 0:n[t-1],c={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,comment:U(null==e?void 0:e.comment),wfComment:s?null==s?void 0:s.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Wn,{data:c,OpenImage:Y,privacy:i})}{var s,c,v,m,p;const t={date:te(null==O||null===(s=O.auditDetails)||void 0===s?void 0:s.lastModifiedTime),name:null==e||null===(c=e.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(m=e.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.mobileNumber};return l.createElement(Wn,{data:t})}},le=(e,t)=>e?t?e:U(e):U("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+U(null==e?void 0:e.isUnit):U("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):U("N/A"),[de,se]=n.useState(!1);console.log("demand Data arr",D),null==D||D.reduce((e,t)=>e+t.demandInterest,0),null==D||D.reduce((e,t)=>e+t.demandPenality,0),null==D||D.reduce((e,t)=>e+t.collectionTax,0),null==D||D.reduce((e,t)=>e+t.collectionInterest,0),null==D||D.reduce((e,t)=>e+t.collectionPenality,0),null==D||D.reduce((e,t)=>e+t.balanceTax,0),null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0);const ce=function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},l)},W,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},ve=null==C?void 0:C.applicationData,me=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C,T),console.log("infolabel",B),console.log("assessment details",X),n.useEffect(()=>{try{let e={consumerCodes:F};const t=!0;"BPREG"===M?Digit.OBPSService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)}):Digit.PTService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},B?l.createElement(qn,{t:U,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,o)=>{var a,r,u,d,s,c,v,m,p,f,E,_,g,h,A,S,N,b,D,L,O,T,I,w,R,B,F,M,k,W,H,j,z,V,Y,q,X,Q;return l.createElement(l.Fragment,{key:o},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:ie?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==o||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==o&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+U(e.title):U(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},U(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},U(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},U(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},U(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,o)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:U(n.title),label:U(n.title),text:l.createElement("img",{src:U(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:U(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},U(null==n?void 0:n.title)))):oe||ae?""+U(n.title):U(n.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:o===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+U(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:U(n.title),label:U(n.title),text:ue(n),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement($n,{bill:null===(r=K.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(Mn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(d=C.applicationData)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(In,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Bn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&l.createElement(Fn,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(jn,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(Hn,{units:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories}),!G&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==y||null===(D=y.data)||void 0===D||null===(L=D.nextActions)||void 0===L?void 0:L.length)>0&&l.createElement(Pn,{applicationData:null==C?void 0:C.applicationData,t:U,permissions:null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(On,{t:U,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:y})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(Rn,{t:U,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:y}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(Mn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Mn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Un,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.documentsWithUrl)&&l.createElement(Ln,{documents:null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(xn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(zn,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(z=e.additionalDetails)||void 0===z||null===(V=z.redirectUrl)||void 0===V?void 0:V.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(Y=e.additionalDetails)||void 0===Y||null===(q=Y.redirectUrl)||void 0===q?void 0:q.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Yn,{wsAdditionalDetails:e,workflowDetails:y}),(null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.estimationDetails)&&l.createElement(Xn,{wsAdditionalDetails:e,workflowDetails:y}))}),(null==X?void 0:X.length)>0&&l.createElement(el,{assessmentData:J}),w&&(null==y||null===(d=y.data)||void 0===d||null===(s=d.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==y?void 0:y.isLoading)||L)&&l.createElement(t.Loader,null),!(null!=y&&y.isLoading)&&!L&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},U("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=y&&null!==(v=y.data)&&void 0!==v&&v.timeline&&1===(null==y||null===(m=y.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:U(""+I+(null==y||null===(f=y.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(null==y||null===(g=y.data)||void 0===g?void 0:g.timeline[0],null==y||null===(h=y.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==y||null===(A=y.data)||void 0===A?void 0:A.timeline)&&(null==y||null===(S=y.data)||void 0===S?void 0:S.timeline.slice(0,de?null==y?void 0:y.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,d,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=y&&null!==(r=y.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=y&&null!==(s=y.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:U(""+I+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[R])+a),customChild:ne(e,n,null==y||null===(o=y.data)||void 0===o?void 0:o.timeline)}))}))),(null==y||null===(N=y.data)||void 0===N||null===(b=N.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(t.LinkButton,{label:U(de?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{se(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(ve,"ACTIVE",me):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(ve,"INACTIVE",me):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&k.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),H&&l.createElement(t.Toast,{error:H.isError,label:U(H.label),onClose:()=>{j(null)},isDleteBtn:"false"}))}function nl(e){var n,i,o,a,r,u,d,s,c,v,m,p,f,E,_,g,h,A;let{t:S,showToast:N,closeToast:b,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var D;let e="";switch(null==N||null===(D=N.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==N?void 0:N.key)?null==N||null===(n=N.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==N?void 0:N.key)?null==N||null===(i=N.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==N?void 0:N.key)?null==N||null===(o=N.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==N?void 0:N.key)?null==N||null===(a=N.error)||void 0===a?void 0:a.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==N?void 0:N.key)?null==N||null===(r=N.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==N?void 0:N.key)?null==N||null===(u=N.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==N?void 0:N.key)?null==N||null===(d=N.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==N?void 0:N.key)?null==N||null===(s=N.error)||void 0===s?void 0:s.message:S("ES_"+C+"_"+(null==N||null===(c=N.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:e,onClose:b}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var y;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==N||null===(y=N.action)||void 0===y?void 0:y.action){case"REVOCATE":n="error"===(null==N?void 0:N.key)?null==N||null===(v=N.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==N?void 0:N.key)?null==N||null===(m=N.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==N?void 0:N.key)?null==N||null===(p=N.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==N?void 0:N.key)?null==N||null===(f=N.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==N?void 0:N.key)?null==N||null===(E=N.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==N?void 0:N.key)?null==N||null===(_=N.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==N?void 0:N.key)?null==N||null===(g=N.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==N?void 0:N.key)?null==N||null===(h=N.error)||void 0===h?void 0:h.message:S("ES_"+C+"_"+(null==N||null===(A=N.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:n,onClose:b}))}{var L,O;const e="error"===(null==N?void 0:N.key)?null==N||null===(L=N.error)||void 0===L?void 0:L.message:"ES_"+C+"_"+(null==N||null===(O=N.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,N&&l.createElement(t.Toast,{error:"error"===N.key,label:S(e),onClose:b}))}}function ll(e){var i,a,r,u,d,s,v,m,p,f,E,_,g,h,A,S;let{workflowDetails:N,displayMenu:b,onActionSelect:C,setDisplayMenu:D,businessService:y,forcedActionPrefix:L,ActionBarStyle:O={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=Digit.UserService.getUser();const R=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const P=null===(i=w)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,B=!1,F=(null==N||null===(u=N.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==N||null===(v=N.data)||void 0===v||null===(m=v.nextActions)||void 0===m?void 0:m.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",N),Digit.Hooks.useClickOutside(R,()=>{D(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(p=F[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(B=!1,x=!0):(null==F?void 0:F.length)>0&&(B=!0,x=!1),l.createElement(l.Fragment,null,!(null!=N&&N.isLoading)&&B&&!x&&l.createElement(t.ActionBar,{style:c({},O)},b&&(null!=N&&null!==(E=N.data)&&void 0!==E&&null!==(_=E.actionState)&&void 0!==_&&_.nextActions||null!=N&&null!==(g=N.data)&&void 0!==g&&g.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:L||"WF_EMPLOYEE_"+(null==y?void 0:y.toUpperCase()),options:F,optionKey:"action",t:I,onSelect:C,style:T}):null,l.createElement(t.SubmitBar,{ref:R,label:I("WF_TAKE_ACTION"),onSubmit:()=>D(!b)})),!(null!=N&&N.isLoading)&&!B&&x&&l.createElement(t.ActionBar,{style:c({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(h=F[0])||void 0===h?void 0:h.action,value:null==F||null===(A=F[0])||void 0===A?void 0:A.action,onClick:e=>{C((null==F?void 0:F[0])||{})}},I((L||"WF_EMPLOYEE_"+(null==y?void 0:y.toUpperCase()))+"_"+(null==F||null===(S=F[0])||void 0===S?void 0:S.action)))))}const il=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ol=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(il,null));function al(e){let{action:n,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(ol,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const rl=e=>{var r,u;console.log("props",e);let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),f=i.useHistory();let{id:E}=i.useParams();const[_,g]=n.useState(!1),[h,A]=n.useState(null),[S,N]=n.useState(!1),[b,C]=n.useState(!1),[D,y]=n.useState(!1),{data:L}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:R,setShowToast:P,isLoading:x,isDataLoading:B,applicationData:F,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:K,MenuStyle:q,paymentsList:X,showTimeLine:Q=!0,oldValue:J,isInfoLabel:Z=!1,clearDataDetails:$,propertyId:ee}=e;n.useEffect(()=>{R&&k.revalidate()},[R]);const te=a.useQueryClient(),ne=()=>{A(null),N(!1)};return console.log("ActionsInPayment2",k),x||b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,x?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(tl,{applicationDetails:O,demandData:T,id:W,workflowDetails:k,isDataLoading:B,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:Q,oldValue:J,isInfoLabel:Z,propertyId:ee,moduleCode:z}),S?l.createElement(Dn,{t:p,action:h,tenantId:s,state:v,id:E,applicationDetails:O,applicationData:null==O?void 0:O.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,d,s,v,m,E,_,g,A,S,N,b,D,y){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(d=e.Licenses)||void 0===d||null===(s=d[0])||void 0===s||null===(v=s.additionalDetail)||void 0===v||null===(m=v.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(_=E[0])||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(S=A.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(N=e.SewerageConnection)||void 0===N||null===(b=N.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(y=D.comment)||void 0===y?void 0:y.length)){var L,O;"INITIATE"===(null==e||null===(L=e.Licenses)||void 0===L||null===(O=L[0])||void 0===O?void 0:O.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function d(t){if(l)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),P({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,v,m,E,_,g;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,S,N;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(A=e.Licenses[0])&&void 0!==A&&null!==(S=A.businessService)&&void 0!==S&&S.includes("BPAREG")?(P({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(N=e.Licenses[0])||void 0===N?void 0:N.applicationNumber)));P({key:"success",action:h}),$&&setTimeout($,3e3),setTimeout(j,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=Rt(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,d,s,c,v,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;ne(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(d):d(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==k||null===(r=k.data)||void 0===r?void 0:r.timeline,businessService:H,workflowDetails:k,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(al,{action:h,workflowDetails:k,businessService:H,isWarningPop:D,closeWarningPopup:()=>{y(!1)}}):null,l.createElement(nl,{t:p,showToast:R,closeToast:j,businessService:H}),l.createElement("div",null,d?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==F?void 0:F.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==L||null===(t=L.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==O||null===(n=O.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==O||null===(o=O.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const d=function(e,t,n,l,i,o,a,r,d,c,v,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(ll,{workflowDetails:k,displayMenu:_,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)y(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var d,s;f.push(""+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var v;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(v=e.redirectionUrll)||void 0===v?void 0:v.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),N(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:c({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else N(!0);A(e),g(!1)},setDisplayMenu:g,businessService:H,forcedActionPrefix:G,ActionBarStyle:K,MenuStyle:q}))))};function ul(e){var i;let{t:o,document:a,setNocDocuments:r,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{null!=c&&c.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==c?void 0:c.code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}])},[f,c]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t),l=n&&(null==n?void 0:n.map(e=>{var t,n,l;return{documentType:null==c?void 0:c.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,fileName:(null==e||null===(l=e.file)||void 0===l?void 0:l.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(i=n[n.length-1])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const dl=e=>{let{width:t=20,height:n=20,style:i}=e;return l.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},l.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function sl(e){var t;let{value:n={}}=e;const{t:i}=o.useTranslation(),{data:a}=Digit.Hooks.noc.useNOCDocumentSearch({value:n},{value:n});let r=[];return null!=n&&n.workflowDocs&&(r=null==n?void 0:n.workflowDocs),a.pdfFiles&&0!==Object.keys(a.pdfFiles).length?l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{var n,o;let r=g(null==a?void 0:a.pdfFiles,(null==e?void 0:e.documentAttachment)||(null==e?void 0:e.documentUid));return l.createElement("a",{target:"_",href:r,style:{width:"120px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",textDecoration:"none",color:"inherit"},key:t},l.createElement(dl,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",fontSize:"12px",wordWrap:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i(null==e||null===(n=e.documentType)||void 0===n||null===(o=n.replace(".","_"))||void 0===o?void 0:o.toUpperCase())))})))):l.createElement("div",null,i("NOC_NO_DOCUMENTS_MSG"))}const cl=e=>l.createElement("h1",{className:"heading-m"},e.label),vl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(vl,null)),pl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationDetails:v,applicationData:m,businessService:p,showToast:f,setShowToast:E,closeToast:_,showErrorToast:g,errorOne:h,closeToastOne:A}=e;const[S,N]=n.useState({}),[b,C]=n.useState({}),[D,y]=n.useState([]),[L,O]=n.useState({}),[T,I]=n.useState(null),[w,R]=n.useState(null),[P,x]=n.useState(null),[B,F]=n.useState([]),[M,U]=n.useState(null),{data:k}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{data:W}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;W&&W["egf-master"]&&F(null===(e=W["egf-master"])||void 0===e?void 0:e.FinancialYear)},[W]);const{data:H}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function j(e){I(e.target.files[0])}return n.useEffect(()=>{if(k&&H){var e;const t=H["common-masters"].Department;y(null==k||null===(e=k.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[k]),console.log("approverData",k),console.log("approvers",D),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{if("SENDBACKTOCITIZEN"===(null==r?void 0:r.action)){var e,t,n;const l=(null==v||null===(e=v.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(n=t.auditDetails)||void 0===n?void 0:n.createdBy)||null;O({uuid:l})}},[r]),console.log("selectedApprover",L),n.useEffect(()=>{r&&N((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SENDBACK"!=(null==i?void 0:i.action)||(c=!1),i.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NOC_CANCEL"},form:[{body:[{label:c?n("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:c?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:c?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:D,selectedApprover:L,setSelectedApprover:O,selectFile:j,uploadedFile:w,setUploadedFile:R,businessService:p}))},[r,D,B,M,w]),r&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(cl,{label:a(S.label.heading)}),headerBarEnd:l.createElement(ml,{onClick:d}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;console.log("data here in Modal",e);let n=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==r?void 0:r.action);null!=r&&r.isTerminateState&&(n=!0);const l=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim();null!=L&&L.uuid?!n||l?(m=c({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=L&&L.uuid?[null==L?void 0:L.uuid]:null,wfDocuments:w?[{documentType:null==T?void 0:T.type,fileName:null==T?void 0:T.name,documentUid:w,filestoreId:w,documentAttachment:w}]:null}),console.log("uploadedFile here in NOCModal",w),s({Licenses:[m]})):E({key:"true",warning:!0,message:a("COMMON_COMMENTS_REQUIRED_LABEL")}):E({key:"true",warning:!0,message:a("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")})},defaultValues:b,formId:"modal-action"}),f&&l.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,label:null==f?void 0:f.message,onClose:_,isDleteBtn:!0}),g&&l.createElement(t.Toast,{error:!0,label:h,isDleteBtn:!0,onClose:A})):l.createElement(t.Loader,null)},fl=(e,n,i,o)=>{var a,r,u,d,s;console.log("checkpoint here",e);const{wfComment:c,thumbnailsToShow:v,wfDocuments:m}=e;console.log("wfDocuments",m);const p={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(r=e.assigner)||void 0===r?void 0:r.name,mobileNumber:null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber,source:null==e||null===(d=e.assigner)||void 0===d?void 0:d.source};return l.createElement("div",null,(null==c?void 0:c.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,o("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},c)),(null==v||null===(s=v.thumbs)||void 0===s?void 0:s.length)>0&&l.createElement(t.DisplayPhotos,{srcs:v.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=v.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==m?void 0:m.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(sl,{value:{workflowDocs:m},index:n}))),l.createElement("div",{style:{marginTop:"8px"}},p.date&&l.createElement("p",null,p.date),p.name&&l.createElement("p",null,p.name),p.mobileNumber&&l.createElement("p",null,p.mobileNumber),p.source&&l.createElement("p",null,o("ES_COMMON_FILED_VIA_"+p.source.toUpperCase()))))},El=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},_l=e=>{let{statuses:i,controlFilterForm:a,applicationTypesOfBPA:u}=e;const{t:d}=o.useTranslation(),s=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+d("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+d("ES_INBOX_ASSIGNED_TO_ALL")}]);return null==u||u.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)}),console.log("status heres===>",i),l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:a,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:s.filter(t=>t.code===e.value)[0],optionsKey:"name",options:s})})),l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:a,defaultValue:[],render:e=>l.createElement(n.Fragment,null,null==i?void 0:i.map((n,i)=>l.createElement(t.CheckBox,{key:n.applicationstatus,label:d(n.applicationstatus)+" - "+n.count,value:n.applicationstatus,checked:e.value.includes(n.applicationstatus),onChange:()=>{var t;e.value.includes(t=n.applicationstatus)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t])},index:i})))})))};function gl(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function hl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Al(e){hl(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Sl(e,t){hl(2,arguments);var n=Al(e).getTime(),l=gl(t);return new Date(n+l)}function Nl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function bl(e){return hl(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Cl(e){if(hl(1,arguments),!bl(e)&&"number"!=typeof e)return!1;var t=Al(e);return!isNaN(Number(t))}var Dl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function yl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,l=e.formats[n]||e.formats[e.defaultWidth];return l}}var Ll={date:yl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:yl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:yl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ol={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Tl(e){return function(t,n){var l,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;l=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function Il(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,i=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?Rl(u,function(e){return e.test(r)}):wl(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=n.valueCallback?n.valueCallback(a):a;var s=t.slice(r.length);return{value:a,rest:s}}}function wl(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Rl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var Pl,xl={code:"en-US",formatDistance:function(e,t,n){var l,i=Dl[e];return l="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:Ll,formatRelative:function(e,t,n,l){return Ol[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Tl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Tl({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Tl({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Tl({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Tl({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Pl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(Pl.matchPattern);if(!n)return null;var l=n[0],i=e.match(Pl.parsePattern);if(!i)return null;var o=Pl.valueCallback?Pl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(l.length);return{value:o,rest:a}}),era:Il({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Il({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Il({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Il({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Il({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Bl(e,t){hl(2,arguments);var n=gl(t);return Sl(e,-n)}function Fl(e){hl(1,arguments);var t=1,n=Al(e),l=n.getUTCDay(),i=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function Ml(e){hl(1,arguments);var t=Al(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var i=Fl(l),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Fl(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Ul(e){hl(1,arguments);var t=Ml(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=Fl(n);return l}function kl(e,t){hl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.weekStartsOn,o=null==i?0:gl(i),a=null==n.weekStartsOn?o:gl(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Al(e),u=r.getUTCDay(),d=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-d),r.setUTCHours(0,0,0,0),r}function Wl(e,t){hl(1,arguments);var n=Al(e),l=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:gl(a),u=null==i.firstWeekContainsDate?r:gl(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(l+1,0,u),d.setUTCHours(0,0,0,0);var s=kl(d,t),c=new Date(0);c.setUTCFullYear(l,0,u),c.setUTCHours(0,0,0,0);var v=kl(c,t);return n.getTime()>=s.getTime()?l+1:n.getTime()>=v.getTime()?l:l-1}function Hl(e,t){hl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.firstWeekContainsDate,o=null==i?1:gl(i),a=null==n.firstWeekContainsDate?o:gl(n.firstWeekContainsDate),r=Wl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=kl(u,t);return d}function jl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var zl={G:function(e,t,n){var l=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var l=e.getUTCFullYear();return n.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),l=n>0?n:1-n;return jl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var i=Wl(e,l),o=i>0?i:1-i;return"YY"===t?jl(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):jl(o,t.length)},R:function(e,t){return jl(Ml(e),t.length)},u:function(e,t){return jl(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return jl(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return jl(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,t,n){var l=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):jl(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(e,t,n){var l=e.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return jl(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(e,t,n,l){var i=function(e,t){hl(1,arguments);var n=Al(e),l=kl(n,t).getTime()-Hl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):jl(i,t.length)},I:function(e,t,n){var l=function(e){hl(1,arguments);var t=Al(e),n=Fl(t).getTime()-Ul(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):jl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return jl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){hl(1,arguments);var t=Al(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),i=n-l;return Math.floor(i/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):jl(l,t.length)},E:function(e,t,n){var l=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return jl(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return jl(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),i=0===l?7:l;switch(t){case"i":return String(i);case"ii":return jl(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(e,t,n){var l=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var l,i=e.getUTCHours();switch(l=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var l,i=e.getUTCHours();switch(l=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var l=e.getUTCHours()%12;return 0===l&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return function(e,t){return jl(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return jl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):jl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):jl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return jl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return jl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return jl(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Gl(i);case"XXXX":case"XX":return Yl(i);case"XXXXX":case"XXX":default:return Yl(i,":")}},x:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Gl(i);case"xxxx":case"xx":return Yl(i);case"xxxxx":case"xxx":default:return Yl(i,":")}},O:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vl(i,":");case"OOOO":default:return"GMT"+Yl(i,":")}},z:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vl(i,":");case"zzzz":default:return"GMT"+Yl(i,":")}},t:function(e,t,n,l){return jl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return jl((l._originalDate||e).getTime(),t.length)}};function Vl(e,t){var n=e>0?"-":"+",l=Math.abs(e),i=Math.floor(l/60),o=l%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+jl(o,2)}function Gl(e,t){return e%60==0?(e>0?"-":"+")+jl(Math.abs(e)/60,2):Yl(e,t)}function Yl(e,t){var n=t||"",l=e>0?"-":"+",i=Math.abs(e);return l+jl(Math.floor(i/60),2)+n+jl(i%60,2)}function Kl(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function ql(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Xl={p:ql,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],i=l[1],o=l[2];if(!o)return Kl(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Kl(i,t)).replace("{{time}}",ql(o,t))}},Ql=["D","DD"],Jl=["YY","YYYY"];function Zl(e){return-1!==Ql.indexOf(e)}function $l(e){return-1!==Jl.indexOf(e)}function ei(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var ti=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ni=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,li=/^'([^]*?)'?$/,ii=/''/g,oi=/[a-zA-Z]/;function ai(e,t,n){hl(2,arguments);var l=String(t),i=n||{},o=i.locale||xl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:gl(a),u=null==i.firstWeekContainsDate?r:gl(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:gl(d),c=null==i.weekStartsOn?s:gl(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var v=Al(e);if(!Cl(v))throw new RangeError("Invalid time value");var m=Nl(v),p=Bl(v,m),f={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},E=l.match(ni).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Xl[t])(e,o.formatLong,f):e}).join("").match(ti).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return ri(n);var a=zl[l];if(a)return!i.useAdditionalWeekYearTokens&&$l(n)&&ei(n,t,e),!i.useAdditionalDayOfYearTokens&&Zl(n)&&ei(n,t,e),a(p,n,o.localize,f);if(l.match(oi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function ri(e){return e.match(li)[1].replace(ii,"'")}const ui=e=>{var i,a;const{register:u,control:d,setValue:s,getValues:c,reset:v,formState:m}=r.useFormContext(),{t:p}=o.useTranslation(),E=f();return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_APP_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_SOURCE_MODULE_NUMBER")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_TYPE_LABEL")),l.createElement(r.Controller,{control:d,name:"nocType",render:e=>l.createElement(t.Dropdown,{selected:1==(null==E?void 0:E.length)?E[0]:e.value,select:e.onChange,onBlur:e.onBlur,option:E||[],optionKey:"i18nKey",t:p,disable:1==(null==E?void 0:E.length)})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"nocNo",inputRef:u({})})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var t,n;s("applicationNo",null),s("sourceRefId",null),s("mobileNumber",null),s("nocType",null==E||null===(t=E[0])||void 0===t?void 0:t.code),s("offset",0),s("limit",10),s("sortBy","commencementDate"),s("sortOrder","DESC"),s("isSubmitSuccessful","false"),v({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),s("offset",c("offset")-c("limit")),null==e||e.onSubmit({nocType:null==E||null===(n=E[0])||void 0===n?void 0:n.code,offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},p("ES_COMMON_CLEAR_ALL"))))},di=["currentlyActiveMobileModal"],si=["currentlyActiveMobileModal"],ci=e=>{var i,a;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=r.useFormContext(),[_,g]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{g({type:"remove"})},A=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),S=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,di);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(A,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,si)))},[_]);return s?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),_?l.createElement(t.PopUp,null,l.createElement(S,{onSubmit:e=>{g({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:_,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(a=m[0])||void 0===a?void 0:a.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APP_NO_LABEL")}))},vi=e=>{let{columns:i,SearchFormFieldsComponent:a,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:v,setValue:m,getValues:p}=r.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:_}=o.useTranslation(),g=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},A=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){m("limit",Number(e.target.value)),v(u)()}function N(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function b(){m("offset",Number(p("offset"))-Number(p("limit"))),v(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?l.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},_(null==d||null===(n=d[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:_,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:g,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(a,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},mi={step:1,isValid:!1,formData:{},coordinates:{}},pi=function(e,t){switch(void 0===e&&(e=mi),t.type){case"UPDATE_NOCNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return mi;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});default:return e}},fi=["path","url"],Ei=[],_i=()=>{var e,n,a,r,u,d;const s=i.useRouteMatch(),{path:c}=s,m=(v(s,fi),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm")),p=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),f=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),E=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview"),_=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewNOCEditApplication");return l.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,(void 0===(g=Ei)&&(g=[]),g.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:c+"/new-application",component:m}),l.createElement(t.PrivateRoute,{path:c+"/response/:id",component:p}),l.createElement(t.PrivateRoute,{path:c+"/my-application",component:f}),l.createElement(t.PrivateRoute,{path:c+"/edit-application/:id",component:_}),l.createElement(t.PrivateRoute,{path:c+"/search/application-overview/:id",component:E}))));var g},gi=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},d={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},s={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},c=(window.Digit.Utils.browser.isMobile(),i.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(c)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===c?null:l.createElement("div",{className:"step-number",style:d}),l.createElement("div",{className:"step-label",style:u},a(i[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<c-1&&l.createElement("div",{style:s})));var o})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},hi=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function d(){i<r.length?c():i===r.length&&n()}function s(){i>1&&v()}const c=()=>a(i+1),v=()=>a(i-1);return l.createElement(gi,{currentStep:i,nextStep:c,prevStep:v,stepsList:r},(()=>{var e,t;const n=r[i-1],{component:o,key:a,texts:c,currStepConfig:v}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:c,component:o,currStepNumber:i,currStepConfig:v},onGoNext:d,onBackClick:s,t:u}))})())},Ai=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],Si=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Ni=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),bi=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Ci=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Ai.filter(t=>t.stepNumber===e.stepNumber)})),Di=e=>{var i,o,a,r,u,d;const{t:s,currentStepData:c,Controller:v,control:m,setValue:p,errors:f,errorStyle:E}=e,_=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:g}=Digit.Hooks.obps.useMDMS(_,"common-masters",["GenderType"]);let h=[];g&&g["common-masters"].GenderType.filter(e=>e.active).map(e=>{h.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),n.useEffect(()=>{console.log("currentStepData1",c);const e=null==c?void 0:c.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;p(t,n)})},[c,p]);const[A,S]=n.useState(""),[N,b]=n.useState(null),[C,D]=n.useState(null);n.useEffect(()=>{C&&Object.entries(C).forEach(e=>{let[t,n]=e;if("name"===t)p("applicantOwnerOrFirmName",n,{shouldValidate:!0,shouldDirty:!0});else if("emailId"===t)p("applicantEmailId",n,{shouldValidate:!0,shouldDirty:!0});else if("gender"===t){const e=h.find(e=>e.code===n);p("applicantGender",e,{shouldValidate:!0,shouldDirty:!0})}else"dob"===t?p("applicantDateOfBirth",n,{shouldValidate:!0,shouldDirty:!0}):"fatherOrHusbandName"===t?p("applicantFatherHusbandName",n):"permanentAddress"===t&&p("applicantAddress",n,{shouldValidate:!0,shouldDirty:!0})})},[C]);const y=window.location.pathname.includes("edit");return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_APPLICANT_DETAILS")),l.createElement("div",null,y&&l.createElement(t.CardSectionSubText,{style:{color:"red",margin:"10px 0px"}}," To update your Mobile No, Name, Email, Date of Birth, or Gender, please go the Citizen's Edit Profile section"),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantMobileNumber",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value),S(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:y})})),l.createElement("div",{className:"search-icon",onClick:y?null:function(){try{return""===A||10!==A.length?(b({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve()):Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:A},{})).then(function(e){var t,n;0===(null==e||null===(t=e.user)||void 0===t?void 0:t.length)?b({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"}):D(null==e||null===(n=e.user)||void 0===n?void 0:n[0])})}catch(e){return Promise.reject(e)}}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabelError,{style:E},(null==f||null===(i=f.applicantMobileNumber)||void 0===i?void 0:i.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_FIRM_OWNER_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantOwnerOrFirmName",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.name),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:y})}))),l.createElement(t.CardLabelError,{style:E},null!=f&&f.applicantOwnerOrFirmName?f.applicantOwnerOrFirmName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantEmailId",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:s("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.emailId),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:y})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(o=f.applicantEmailId)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantFatherHusbandName",render:e=>l.createElement(t.TextInput,{value:e.value||(null==C?void 0:C.fatherOrHusbandName),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_PROPERTY_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantPropertyId",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(a=f.applicantPropertyId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantAddress",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value||(null==C?void 0:C.permanentAddress),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(r=f.applicantAddress)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_DOB_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantDateOfBirth",rules:{required:s("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth(),o=t.getDate()-n.getDate();return l>=18||18===l&&(i>0||0===i&&o>=0)||s("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value||(null==C?void 0:C.dob),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],disabled:y})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(u=f.applicantDateOfBirth)||void 0===u?void 0:u.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_GENDER_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:m,name:"applicantGender",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.RadioButtons,{t:s,options:h,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:y})}))),l.createElement(t.CardLabelError,{style:E},(null==f||null===(d=f.applicantGender)||void 0===d?void 0:d.message)||"")),N&&l.createElement(t.Toast,{error:null==N?void 0:N.error,warning:null==N?void 0:N.warning,label:s(null==N?void 0:N.message),isDleteBtn:!0,onClose:()=>{b(null)}}))},yi=e=>{var i,o,a,r,u,d,s;const{t:c,currentStepData:v,Controller:m,control:p,setValue:f,errors:E,errorStyle:_}=e,g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",v);const e=null==v?void 0:v.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[v,f]);const{data:h}=Digit.Hooks.noc.useTenants(),[A,S]=n.useState(h);return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},c("NOC_PROFESSIONAL_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+c("NOC_PROFESSIONAL_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalName",defaultValue:null==g||null===(i=g.info)||void 0===i?void 0:i.name,rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:_},null!=E&&E.professionalName?E.professionalName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalEmailId",defaultValue:null==g||null===(o=g.info)||void 0===o?void 0:o.emailId,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:c("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(a=E.professionalEmailId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalRegId",rules:{required:c("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(r=E.professionalRegId)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalMobileNumber",defaultValue:null==g||null===(u=g.info)||void 0===u?void 0:u.mobileNumber,rules:{required:c("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:c("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:c,disable:"true"})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(d=E.professionalMobileNumber)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("NOC_PROFESSIONAL_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(m,{control:p,name:"professionalAddress",rules:{required:c("REQUIRED_FIELD"),maxLength:{value:100,message:c("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:c})}))),l.createElement(t.CardLabelError,{style:_},(null==E||null===(s=E.professionalAddress)||void 0===s?void 0:s.message)||""))},Li=e=>{var i,o,a,r,u,d,s,v,m,p,f,E,_,g,h,A,S,N,b,C;let D;D=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const y=Digit.ULBService.getStateId(),{t:L,currentStepData:O,Controller:T,control:I,setValue:w,errors:R,errorStyle:P,useFieldArray:x,watch:B}=e,[F,M]=n.useState("0.00"),U=B("netPlotAreaAfterWidening"),k=B("areaLeftForRoadWidening");n.useEffect(()=>{const e=parseFloat(U),t=parseFloat(k),n=((isNaN(e)?0:e)+(isNaN(t)?0:t)).toFixed(2);M(n),w("netTotalArea",n)},[U,k]);const[W,H]=n.useState("0.00"),{fields:j,append:z,remove:V}=x({control:I,name:"floorArea"}),G=B("floorArea"),Y=B("basementArea");n.useEffect(()=>{const e=null==G?void 0:G.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(Y)?0:Y,n=(e+parseFloat(t)).toFixed(2);H(n),w("totalFloorArea",n)},[G,Y]);const[K,q]=n.useState((null==O||null===(i=O.siteDetails)||void 0===i?void 0:i.ulbName)||null),[X,Q]=n.useState((null==O||null===(o=O.siteDetails)||void 0===o?void 0:o.ulbType)||""),[J,Z]=n.useState((null==O||null===(a=O.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:$,isLoading:ee}=Digit.Hooks.noc.useBuildingType(y),{data:te,isLoading:ne}=Digit.Hooks.noc.useRoadType(y),{data:le,isLoading:ie}=Digit.Hooks.useTenants(),oe=null==le?void 0:le.map(e=>c({},e,{displayName:L(e.i18nKey)}));n.useEffect(()=>{if(K){var e;const t=null==K||null===(e=K.city)||void 0===e?void 0:e.ulbType;Q(t),w("ulbType",t)}},[K,w]);const[ae,re]=n.useState((null==O||null===(r=O.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),ue=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],de=Digit.Hooks.noc.useTenants(),[se,ce]=n.useState(de),[ve,me]=n.useState((null==O||null===(u=O.siteDetails)||void 0===u?void 0:u.district)||null),[pe,fe]=n.useState([]),{data:Ee}=Digit.Hooks.useBoundaryLocalities(null==ve?void 0:ve.code,"revenue",{enabled:!!ve},L);return n.useEffect(()=>{(null==Ee?void 0:Ee.length)>0&&fe(Ee)},[Ee]),n.useEffect(()=>{if(D&&(null==de?void 0:de.length)>0){const e=de.find(e=>e.code===D);e&&(me(e),w("district",e))}},[D,de]),n.useEffect(()=>{const e=null==O?void 0:O.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&w(t,n)}),Array.isArray(e.floorArea))){for(let e=j.length-1;e>=0;e--)V(e);e.floorArea.forEach(e=>{z({value:e.value||""})})}},[O,w,z,V]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},L("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"plotNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.plotNo?R.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},L("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"proposedSiteAddress",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:200,message:L("MAX_200_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.proposedSiteAddress?R.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ULB_NAME_LABEL"),"*"),!ie&&l.createElement(T,{control:I,name:"ulbName",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{q(t),e.onChange(t)},selected:e.value,option:oe,optionKey:"displayName"})})),l.createElement(t.CardLabelError,{style:P},null!=R&&R.ulbName?R.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:X||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"khasraNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(d=R.khasraNo)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"hadbastNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(s=R.hadbastNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ROAD_TYPE_LABEL"),"*"),!ne&&l.createElement(T,{control:I,name:"roadType",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:te,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(v=R.roadType)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"areaLeftForRoadWidening",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(m=R.areaLeftForRoadWidening)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"netPlotAreaAfterWidening",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(p=R.netPlotAreaAfterWidening)||void 0===p?void 0:p.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_NET_TOTAL_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"netTotalArea",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},defaultValue:F,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:"true"})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(f=R.netTotalArea)||void 0===f?void 0:f.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"roadWidthAtSite",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.roadWidthAtSite?R.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_BUILDING_STATUS_LABEL"),"*"),!ee&&l.createElement(T,{control:I,name:"buildingStatus",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{Z(t),e.onChange(t)},selected:e.value,option:$,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(E=R.buildingStatus)||void 0===E?void 0:E.message)||""),"BUILTUP"===(null==J?void 0:J.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(T,{control:I,name:"isBasementAreaAvailable",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{re(t),e.onChange(t)},selected:e.value,option:ue,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(_=R.isBasementAreaAvailable)||void 0===_?void 0:_.message)||""),"BUILTUP"===(null==J?void 0:J.code)&&"YES"===(null==ae?void 0:ae.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"basementArea",rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},null!=R&&R.basementArea?R.basementArea.message:""),"BUILTUP"===(null==J?void 0:J.code)&&j.map((e,n)=>l.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},l.createElement(t.CardLabel,{className:"card-label-smaller"},0===n?"Ground":""+n," Floor Area(sq mt)*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(T,{control:I,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:L("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:L("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;return l.createElement(l.Fragment,null,l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==R||null===(i=R.floorArea)||void 0===i||null===(o=i[n])||void 0===o?void 0:o.value)&&l.createElement(t.CardLabelError,{className:P},R.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>V(n)},"❌")))),"BUILTUP"===(null==J?void 0:J.code)&&l.createElement("button",{type:"button",onClick:()=>z({value:""})},"➕ Add Floor"),"BUILTUP"===(null==J?void 0:J.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"totalFloorArea",defaultValue:W,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"wardNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(g=R.wardNo)||void 0===g?void 0:g.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_DISTRICT_LABEL"),"*"),l.createElement(T,{control:I,name:"district",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{me(t),e.onChange(t)},selected:e.value,option:se.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name",disable:"true"})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(h=R.district)||void 0===h?void 0:h.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_ZONE_LABEL"),"*"),l.createElement(T,{control:I,name:"zone",rules:{required:L("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:pe,optionKey:"i18nkey"})})),l.createElement(t.CardLabelError,{style:P},(null==R||null===(A=R.zone)||void 0===A?void 0:A.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"villageName",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(S=R.villageName)||void 0===S?void 0:S.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_COLONY_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"colonyName",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(N=R.colonyName)||void 0===N?void 0:N.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_VASIKA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"vasikaNumber",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(b=R.vasikaNumber)||void 0===b?void 0:b.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+L("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(T,{control:I,name:"khewatAndKhatuniNo",rules:{required:L("REQUIRED_FIELD"),maxLength:{value:100,message:L("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:P},(null==R||null===(C=R.khewatAndKhatuniNo)||void 0===C?void 0:C.message)||"")),l.createElement(t.BreakLine,null)))},Oi=e=>{var i,o,a,r;const{t:u,currentStepData:d,Controller:s,control:c,setValue:v,errors:m,errorStyle:p}=e,f=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[E,_]=n.useState((null==d||null===(i=d.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||null),{data:g,isLoading:h}=Digit.Hooks.noc.useBuildingCategory(f),{data:A,isLoading:S}=Digit.Hooks.noc.useNocType(f),N=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return n.useEffect(()=>{console.log("currentStepData4",d);const e=null==d?void 0:d.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;v(t,n)})},[d,v]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,u("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(s,{control:c,name:"specificationPlotArea",rules:{required:u("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:u("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:u("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:u})}))),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationPlotArea?m.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_BUILDING_CATEGORY_LABEL"),"*"),!h&&g.length>0&&l.createElement(s,{control:c,name:"specificationBuildingCategory",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{_(t),e.onChange(t)},selected:e.value,option:g,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:p},null!=m&&m.specificationBuildingCategory?m.specificationBuildingCategory.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_NOC_TYPE_LABEL"),"*"),!S&&l.createElement(s,{control:c,name:"specificationNocType",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:A,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(o=m.specificationNocType)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_RESTRICTED_AREA_LABEL")," *"),l.createElement(s,{control:c,name:"specificationRestrictedArea",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(a=m.specificationRestrictedArea)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL")," *"),l.createElement(s,{control:c,name:"specificationIsSiteUnderMasterPlan",rules:{required:u("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:p},(null==m||null===(r=m.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.message)||"")))};function Ti(e){var n,o,a,r,u,s,c,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T,I,w,R,P,x,B,F,M,U,k,W,H,j,z,V,G,Y,K,q,X,Q,J,Z,$,ee,te,ne,le,ie,oe,ae,re,ue,de,se,ce,ve,me,pe;let{currentStepData:fe,t:Ee}=e;i.useLocation(),i.useHistory(),d.useDispatch(),console.log("formData in Summary Page",fe);const _e=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates in summary page",_e);const ge={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},he={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},Ae={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},Se={fontWeight:"bold",color:"#555"},Ne=(e,n)=>l.createElement("div",{style:he},l.createElement(t.CardLabel,{style:Se},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let be=null==fe||null===(n=fe.documents)||void 0===n||null===(o=n.documents)||void 0===o?void 0:o.documents;return console.log("documents here in summary",be),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:Ae},Ee("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:ge},Ne(Ee("NOC_FIRM_OWNER_NAME_LABEL"),null==fe||null===(a=fe.applicationDetails)||void 0===a?void 0:a.applicantOwnerOrFirmName),Ne(Ee("NOC_APPLICANT_EMAIL_LABEL"),null==fe||null===(r=fe.applicationDetails)||void 0===r?void 0:r.applicantEmailId),Ne(Ee("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==fe||null===(u=fe.applicationDetails)||void 0===u?void 0:u.applicantFatherHusbandName),Ne(Ee("NOC_APPLICANT_PROPERTY_ID_LABEL"),null==fe||null===(s=fe.applicationDetails)||void 0===s?void 0:s.applicantPropertyId),Ne(Ee("NOC_APPLICANT_MOBILE_NO_LABEL"),null==fe||null===(c=fe.applicationDetails)||void 0===c?void 0:c.applicantMobileNumber),Ne(Ee("NOC_APPLICANT_DOB_LABEL"),null==fe||null===(v=fe.applicationDetails)||void 0===v?void 0:v.applicantDateOfBirth),Ne(Ee("NOC_APPLICANT_GENDER_LABEL"),null==fe||null===(m=fe.applicationDetails)||void 0===m||null===(p=m.applicantGender)||void 0===p?void 0:p.code),Ne(Ee("NOC_APPLICANT_ADDRESS_LABEL"),null==fe||null===(f=fe.applicationDetails)||void 0===f?void 0:f.applicantAddress)),(null==fe||null===(E=fe.applicationDetails)||void 0===E?void 0:E.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:Ae},Ee("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:ge},Ne(Ee("NOC_PROFESSIONAL_NAME_LABEL"),null==fe||null===(_=fe.applicationDetails)||void 0===_?void 0:_.professionalName),Ne(Ee("NOC_PROFESSIONAL_EMAIL_LABEL"),null==fe||null===(g=fe.applicationDetails)||void 0===g?void 0:g.professionalEmailId),Ne(Ee("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==fe||null===(h=fe.applicationDetails)||void 0===h?void 0:h.professionalRegId),Ne(Ee("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==fe||null===(A=fe.applicationDetails)||void 0===A?void 0:A.professionalMobileNumber),Ne(Ee("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==fe||null===(S=fe.applicationDetails)||void 0===S?void 0:S.professionalAddress))),l.createElement("h2",{style:Ae},Ee("NOC_SITE_DETAILS")),l.createElement("div",{style:ge},Ne(Ee("NOC_PLOT_NO_LABEL"),null==fe||null===(N=fe.siteDetails)||void 0===N?void 0:N.plotNo),Ne(Ee("NOC_PROPOSED_SITE_ADDRESS"),null==fe||null===(b=fe.siteDetails)||void 0===b?void 0:b.proposedSiteAddress),Ne(Ee("NOC_ULB_NAME_LABEL"),null==fe||null===(C=fe.siteDetails)||void 0===C||null===(D=C.ulbName)||void 0===D?void 0:D.name),Ne(Ee("NOC_ULB_TYPE_LABEL"),null==fe||null===(y=fe.siteDetails)||void 0===y?void 0:y.ulbType),Ne(Ee("NOC_KHASRA_NO_LABEL"),null==fe||null===(L=fe.siteDetails)||void 0===L?void 0:L.khasraNo),Ne(Ee("NOC_HADBAST_NO_LABEL"),null==fe||null===(O=fe.siteDetails)||void 0===O?void 0:O.hadbastNo),Ne(Ee("NOC_ROAD_TYPE_LABEL"),null==fe||null===(T=fe.siteDetails)||void 0===T||null===(I=T.roadType)||void 0===I?void 0:I.name),Ne(Ee("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==fe||null===(w=fe.siteDetails)||void 0===w?void 0:w.areaLeftForRoadWidening),Ne(Ee("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==fe||null===(R=fe.siteDetails)||void 0===R?void 0:R.netPlotAreaAfterWidening),Ne(Ee("NOC_NET_TOTAL_AREA_LABEL"),null==fe||null===(P=fe.siteDetails)||void 0===P?void 0:P.netTotalArea),Ne(Ee("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==fe||null===(x=fe.siteDetails)||void 0===x?void 0:x.roadWidthAtSite),Ne(Ee("NOC_BUILDING_STATUS_LABEL"),null==fe||null===(B=fe.siteDetails)||void 0===B||null===(F=B.buildingStatus)||void 0===F?void 0:F.name),Ne(Ee("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==fe||null===(M=fe.siteDetails)||void 0===M||null===(U=M.isBasementAreaAvailable)||void 0===U?void 0:U.code),"BUILTUP"===(null==fe||null===(k=fe.siteDetails)||void 0===k||null===(W=k.buildingStatus)||void 0===W?void 0:W.code)&&Ne(Ee("NOC_BASEMENT_AREA_LABEL"),null==fe||null===(H=fe.siteDetails)||void 0===H?void 0:H.basementArea),"BUILTUP"===(null==fe||null===(j=fe.siteDetails)||void 0===j||null===(z=j.buildingStatus)||void 0===z?void 0:z.code)&&(null==fe||null===(V=fe.siteDetails)||void 0===V||null===(G=V.floorArea)||void 0===G?void 0:G.map((e,t)=>Ne((e=>0===e?Ee("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+Ee("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==fe||null===(Y=fe.siteDetails)||void 0===Y||null===(K=Y.buildingStatus)||void 0===K?void 0:K.code)&&Ne(Ee("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),null==fe||null===(q=fe.siteDetails)||void 0===q?void 0:q.totalFloorArea),Ne(Ee("NOC_DISTRICT_LABEL"),null==fe||null===(X=fe.siteDetails)||void 0===X||null===(Q=X.district)||void 0===Q?void 0:Q.name),Ne(Ee("NOC_ZONE_LABEL"),null==fe||null===(J=fe.siteDetails)||void 0===J||null===(Z=J.zone)||void 0===Z?void 0:Z.name),Ne(Ee("NOC_SITE_WARD_NO_LABEL"),null==fe||null===($=fe.siteDetails)||void 0===$?void 0:$.wardNo),Ne(Ee("NOC_SITE_VILLAGE_NAME_LABEL"),null==fe||null===(ee=fe.siteDetails)||void 0===ee?void 0:ee.villageName),Ne(Ee("NOC_SITE_COLONY_NAME_LABEL"),null==fe||null===(te=fe.siteDetails)||void 0===te?void 0:te.colonyName),Ne(Ee("NOC_SITE_VASIKA_NO_LABEL"),null==fe||null===(ne=fe.siteDetails)||void 0===ne?void 0:ne.vasikaNumber),Ne(Ee("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),null==fe||null===(le=fe.siteDetails)||void 0===le?void 0:le.khewatAndKhatuniNo)),l.createElement("h2",{style:Ae},Ee("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:ge},Ne(Ee("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==fe||null===(ie=fe.siteDetails)||void 0===ie?void 0:ie.specificationPlotArea),Ne(Ee("NOC_BUILDING_CATEGORY_LABEL"),null==fe||null===(oe=fe.siteDetails)||void 0===oe||null===(ae=oe.specificationBuildingCategory)||void 0===ae?void 0:ae.name),Ne(Ee("NOC_NOC_TYPE_LABEL"),null==fe||null===(re=fe.siteDetails)||void 0===re||null===(ue=re.specificationNocType)||void 0===ue?void 0:ue.name),Ne(Ee("NOC_RESTRICTED_AREA_LABEL"),null==fe||null===(de=fe.siteDetails)||void 0===de||null===(se=de.specificationRestrictedArea)||void 0===se?void 0:se.code),Ne(Ee("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),null==fe||null===(ce=fe.siteDetails)||void 0===ce||null===(ve=ce.specificationIsSiteUnderMasterPlan)||void 0===ve?void 0:ve.code)),l.createElement("h2",{style:Ae},Ee("NOC_SITE_COORDINATES_LABEL")),l.createElement("div",{style:ge},Ne(Ee("COMMON_LATITUDE1_LABEL"),null==_e?void 0:_e.Latitude1),Ne(Ee("COMMON_LONGITUDE1_LABEL"),null==_e?void 0:_e.Longitude1),Ne(Ee("COMMON_LATITUDE2_LABEL"),null==_e?void 0:_e.Latitude2),Ne(Ee("COMMON_LONGITUDE2_LABEL"),null==_e?void 0:_e.Longitude2)),l.createElement("h2",{style:Ae},Ee("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:ge},Array.isArray(null==fe||null===(me=fe.documents)||void 0===me||null===(pe=me.documents)||void 0===pe?void 0:pe.documents)&&fe.documents.documents.documents.length>0?l.createElement("div",{className:"documentsContainerStyle"},l.createElement(sl,{value:{workflowDocs:fe.documents.documents.documents}})):l.createElement("div",null,Ee("NOC_NO_DOCUMENTS_MSG"))))}function Ii(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:d,action:v,formData:m,handleSubmit:p,id:f,geocoordinates:E,setGeoCoordinates:_,dispatch:g,previewLink:h}=e;const A=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[S,N]=(Digit.ULBService.getCurrentTenantId(),n.useState(A?c({},A,{active:!0===(null==a?void 0:a.active),code:null==A?void 0:A.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[b,C]=n.useState(null),[D,y]=n.useState(()=>(null==A?void 0:A.filestoreId)||null);function L(e){const t=e.target.files[0];C(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),n=s.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&n){const l=x(e).toFixed(6),i=x(n).toFixed(6);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(bi("Latitude1",e.latitude)),g(bi("Longitude1",e.longitude)),_(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(g(bi("Latitude1","")),g(bi("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(bi("Latitude2",e.latitude)),g(bi("Longitude2",e.longitude)),_(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(g(bi("Latitude2","")),g(bi("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:O}=a;var T=O;const[I,w]=n.useState(!1),[R,P]=n.useState(!1);function x(e){return e[0]+e[1]/60+e[2]/3600}return n.useEffect(()=>{null!=S&&S.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==D?void 0:D.length)||null===D?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==D))||[],{documentType:null==S?void 0:S.code,filestoreId:D,documentUid:D,documentAttachment:D}]})},[D,S]),n.useEffect(()=>{(null==d?void 0:d.length)>0&&(console.log("documents here",d),p())},[d]),n.useEffect(()=>{if("update"===v){var e,t;const n=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(N(l),y(null==n?void 0:n.fileStoreId)):w(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||N({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(b){P(!0);const e=function(){if(b.size>=5242880)P(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",b,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;P(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?y(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){P(!1),u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),n.useEffect(()=>{I&&y(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},R&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:S,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>N(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.UploadFile,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{onUpload:L,onDelete:()=>{y(null)},id:f,message:D?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!D}:{onUpload:L,onDelete:()=>{y(null)},id:f,message:D?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!D}),h&&l.createElement("div",{style:{cursor:"pointer",padding:"10px",marginLeft:"25px"},onClick:e=>{e.preventDefault(),window.open(h,"_blank")}},l.createElement(t.ViewsIcon,null)),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude1),l.createElement("p",null,"Longitude: ",E.Longitude1))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&l.createElement(t.CardLabel,null,l.createElement("div",{style:{paddingLeft:"30px"}},l.createElement("p",null,"Latitude: ",E.Latitude2),l.createElement("p",null,"Longitude: ",E.Longitude2)))))}const wi=l.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:d,documents:v,formData:m,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",v);const _=(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",_);const g=Digit.ULBService.getStateId(),[h,A]=n.useState(_?c({},_,{active:!0,code:null==_?void 0:_.documentType,i18nKey:null==_?void 0:_.documentType}):(null==u||null===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[S,N]=n.useState(null),[b,C]=n.useState(()=>(null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[D,y]=n.useState([]),[L,O]=n.useState([]),[T,I]=n.useState([]||(null==m||null===(o=m.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,R]=n.useState(null),[P,x]=n.useState(null);function B(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==v?void 0:v.length)>0&&E()},[v]),n.useEffect(()=>{L.length>0&&null!=h&&h.code&&(d(e=>{if(null===b||null==(null==b?void 0:b.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId);let n=[];return L&&L.map((e,t)=>{var l,i;n.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:P},documentUid:e.fileStoreId,fileName:(null===(l=T[t])||void 0===l?void 0:l.name)||"",id:v?null===(i=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),O([])),null!=h&&h.code&&d(e=>{var t;return null===b||null==(null==b?void 0:b.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.split(".")[1])==(null==h||null===(l=h.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:b.fileStoreId,documentUid:b.fileStoreId,fileName:(null==S?void 0:S.name)||b.fileName||"document",id:v?null===(t=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[b,h]),n.useEffect(()=>{h.code||null===b||O([...L,b])},[b]);const F=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",m);let n=[];return null==m||null===(e=m.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:g}}])),console.log("selectedUplDocs here",n),n},[m]);return l.createElement("div",null,l.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:g,getFormState:function(e){let t,n,l=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),n=s.getTag(this,"GPSLongitude");if(e&&n){const l=B(e),i=B(n);t({latitude:l,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),R(i.latitude),x(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==m||null===(o=m.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),y(n);let s=[];null==e||e.map((e,t)=>{var n,l,o,a;s.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(l=n.fileStoreId)||void 0===l?void 0:l.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:v?null===(a=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const c=[...v.filter(e=>e.documentType!==l),...s];d(c),null===(r=n)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=l,function(e,t){e&&N(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...v.filter(e=>e.documentType!==l)];d(e)}},setuploadedstate:F,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Ln,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),f(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),f(!0)," ")))}),Ri=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Ai.filter(t=>t.stepNumber===e.stepNumber)})),Pi=(e,t,n,i)=>{var o,a,r,u,d;console.log("checkpoint here",e);const{wfComment:s,thumbnailsToShow:c,wfDocuments:v}=e;console.log("wfDocuments",v);const m={date:null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.lastModified,name:null==e||null===(a=e.assigner)||void 0===a?void 0:a.name,mobileNumber:null==e||null===(r=e.assigner)||void 0===r?void 0:r.mobileNumber,source:null==e||null===(u=e.assigner)||void 0===u?void 0:u.source};return l.createElement("div",null,(null==s?void 0:s.length)>0&&l.createElement("div",{className:"TLComments"},l.createElement("h3",null,i("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},s)),(null==c||null===(d=c.thumbs)||void 0===d?void 0:d.length)>0&&l.createElement(DisplayPhotos,{srcs:c.thumbs,onClick:(e,t)=>{var n;let l=(null===(n=c.fullImage)||void 0===n?void 0:n[t])||e;Digit.Utils.zoomImage(l)}}),(null==v?void 0:v.length)>0&&l.createElement("div",null,l.createElement("div",null,l.createElement(sl,{value:{workflowDocs:v},index:t}))),l.createElement("div",{style:{marginTop:"8px"}},m.date&&l.createElement("p",null,m.date),m.name&&l.createElement("p",null,m.name),m.mobileNumber&&l.createElement("p",null,m.mobileNumber),m.source&&l.createElement("p",null,i("ES_COMMON_FILED_VIA_"+m.source.toUpperCase()))))},xi=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const d=[{link:n+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:d,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Bi=e=>{let{stateCode:n,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:n,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),d?l.createElement(t.Loader,null):"citizen"===o?l.createElement(_i,null):l.createElement(wt,{path:r,stateCode:n})},Fi={NOCModule:Bi,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.useLocation(),d=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const s={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:v,data:{totalCount:m,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},s),config:{enabled:(null==s||null===(e=s.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),E=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const _=n.useMemo(()=>({Icon:l.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:v?"":m,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:m,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[v,m]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,_):null},NOCLinks:xi,NOCApplicationOverview:()=>{var e,a,r,u,d,s,v,f,E;const{id:_}=i.useParams(),{t:g}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[S,N]=n.useState({}),[b,C]=n.useState(null),D={},[y]=n.useState(()=>(null==D?void 0:D.fileStoreId)||null),[L,O]=n.useState(null),[T,I]=n.useState([]),[w,R]=n.useState([]),[P,x]=n.useState([]),[B,F]=n.useState([]),[M,U]=n.useState([]),[k,W]=n.useState({}),[H,j]=n.useState(()=>[]),[z,V]=n.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:Y}=Digit.Hooks.obps.useMDMS(A,"NOC",["DocumentTypeMapping"]),{data:K}=Digit.Hooks.obps.useMDMS(A,"common-masters",["DocumentType"]),{isLoading:q,data:X}=Digit.Hooks.noc.useNOCDetails(g,h,{applicationNo:_}),{mutate:Q}=Digit.Hooks.noc.useNOCApplicationActions(h),J=Digit.Hooks.useWorkflowDetails({tenantId:h,id:_,moduleCode:"NOC"});var Z,$;null!=J&&null!==(e=J.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!J.isLoading&&(J.data.actionState.nextActions=[...null==J||null===(r=J.data)||void 0===r?void 0:r.nextActions]),J&&J.data&&!J.isLoading&&(J.data.initialActionState=(null==J||null===(Z=J.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==J||null===($=J.data)||void 0===$?void 0:$.actionState)||{},J.data.actionState=c({},J.data)),n.useEffect(()=>{R([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;x(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;F(null==K||null===(e=K["common-masters"])||void 0===e?void 0:e.DocumentType)},[K]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),n.useEffect(()=>{if(null!=w&&w.length&&null!=P&&P.length){let e=[];w.map(t=>{var n,l;const i=P.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(n=i[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],B.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,P,B]),n.useEffect(()=>{var e,t;let n=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,l)=>{n.push(null==e?void 0:e.fileStoreId)}),j(null==n?void 0:n.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),n.useEffect(()=>{null!=H&&H.length&&Digit.UploadServices.Filefetch(H,Digit.ULBService.getStateId()).then(e=>{W(null==e?void 0:e.data)})},[H]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,d,s,c,v,f,E,_,g,h,A,S,N,b,C,D,y,I,w;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return l.createElement(n.Fragment,null,l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+p(null==a||null===(d=a[0])||void 0===d?void 0:d.code,".","_")+"_LABEL")),l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(s=o[0])||void 0===s?void 0:s.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(c=o[0])||void 0===c?void 0:c.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(v=o[0])||void 0===v?void 0:v.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(f=o[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(E=o[0])&&void 0!==E&&null!==(_=E.additionalDetails)&&void 0!==_&&_.SubmittedOn?m(Number(null==o||null===(g=o[0])||void 0===g||null===(h=g.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(A=o[0])||void 0===A?void 0:A.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?m(Number(null==o||null===(S=o[0])||void 0===S||null===(N=S.auditDetails)||void 0===N?void 0:N.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(b=o[0])&&void 0!==b&&b.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(D=o[0])||void 0===D||null===(y=D.documents)||void 0===y?void 0:y.map((e,n)=>{var o,r;return l.createElement("a",{target:"_",href:null===(o=k[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):l.createElement("div",null,l.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==J||null===(I=J.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>l.createElement(ul,{key:t,document:e,t:i,error:L,setError:O,setNocDocuments:U,nocDocuments:M})):null)))}return l.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>l.createElement(n.Fragment,null,l.createElement("div",{style:{maxWidth:"950px"}},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>l.createElement(t.Row,{className:"border-none",label:""+g(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return n.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;N(c({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:g,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,y,H,k]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},g("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(rl,{applicationDetails:S,isLoading:q||z,isDataLoading:q,applicationData:null==X?void 0:X.applicationData,mutate:Q,workflowDetails:J,businessService:null!=J&&null!==(d=J.data)&&void 0!==d&&d.applicationBusinessService?null==J||null===(s=J.data)||void 0===s?void 0:s.applicationBusinessService:null==X||null===(v=X.applicationData)||void 0===v?void 0:v.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:a}=e;const{t:u}=o.useTranslation(),d=window.localStorage.getItem("Employee.tenant-id"),s={mobileNumber:"",applicationNo:""},v={moduleName:"noc-service",applicationStatus:[],businessService:"obpas_noc",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},m={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:v,searchForm:s,tableForm:m},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[_,g]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{searchForm:t.data})),c({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{filterForm:t.data})),c({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{tableForm:t.data})),c({},e,{tableForm:t.data})}},E),{data:h,isLoading:A}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:N}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},_)});n.useEffect(()=>{N&&N.revalidate()},[]),console.log("data in noc==>",N);const[b,C]=n.useState([]),[D,y]=n.useState([]),[L,O]=n.useState(0);n.useEffect(()=>{N&&(y((null==N?void 0:N.statuses)||[]),C((null==N?void 0:N.table)||[]),O((null==N?void 0:N.totalCount)||0))},[N]);const T={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},I=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(El,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),w=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(_l,{statuses:D,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[D,S,h,A]),R={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},m)}),g({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),g({action:"mutateSearchForm",data:s})}},P={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},m)}),g({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),g({action:"mutateFilterForm",data:v})}},x=(e=>{var t,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:v,totalCount:m,table:p,dispatch:f,onSortingByData:E}=e;const{t:_}=o.useTranslation(),g=n.useMemo(()=>[{Header:_("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:d+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(ai(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:_("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>_(null==e?void 0:e.status),disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:(null===(t=v.tableForm)||void 0===t?void 0:t.offset)/(null===(a=v.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=v.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:m,onSearch:null==v||null===(u=v.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:c({},v.tableForm,{offset:10*Math.ceil(m/10)-parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:c({},v.tableForm,{offset:0})}),data:p,columns:g}})(c({},{parentRoute:a,onPageSizeChange:e=>{g({action:"mutateTableForm",data:c({},_.tableForm,{limit:e.target.value})})},formState:_,totalCount:L,table:b,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===l||g({action:"mutateTableForm",data:c({},_.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:n,table:i}=e;const{t:a}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:n,locality:l,status:i}=e;return{[a("NOC_APPLICATION_NUMBER")]:t,[a("TL_COMMON_TABLE_COL_APP_DATE")]:ai(new Date(n),"dd/MM/yyyy"),[a("PT_COMMON_TABLE_COL_STATUS_LABEL")]:a(i),[a("ES_INBOX_LOCALITY")]:a(l)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:a("NOC_APPLICATION_NUMBER"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=r.useFormContext();return l.createElement(t.SearchField,null,l.createElement(r.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:i,value:o}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:a,table:b}),F={onMobileSortOrderData:e=>{const{sortOrder:t}=e;g({action:"mutateTableForm",data:c({},_.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),g({action:"mutateTableForm",data:m})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),L?l.createElement("p",{className:"inbox-count"},L):null),l.createElement(t.InboxComposer,c({isInboxLoading:S,PropsForInboxLinks:T},R,P,F,{propsForInboxTable:x,propsForInboxMobileCards:B,formState:_})))},NOCSearchApplication:e=>{let{t:t,onSubmit:a,data:u,error:d,isLoading:s,Count:c}=e;const[v,m]=n.useState(null),p=r.useForm({defaultValues:{}});n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","commencementDate"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation(),t=e=>l.createElement("span",{className:"cell-text"},e);return n.useMemo(()=>[{Header:e("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/noc/search/application-overview/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:e("NOC_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.auditDetails)&&void 0!==n&&n.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"-")}},{Header:e("NOC_APPLICANTS_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.applicantName?null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName:"-")}},{Header:e("NOC_SOURCE_MODULE_LABEL"),disableSortBy:!0,accessor:n=>t(e("MODULE_"+(null==n?void 0:n.source)||"-"))},{Header:e("NOC_SOURCE_MODULE_NUMBER"),disableSortBy:!0,accessor:e=>t((null==e?void 0:e.sourceRefId)||"-")},{Header:e("NOC_STATUS_LABEL"),accessor:n=>t(e((null==n?void 0:n.applicationStatus)&&""+n.applicationStatus||"-")),disableSortBy:!0},{Header:e("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:n=>{var l,i;return t(e((null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.currentOwner)&&""+(null==n||null===(i=n.additionalDetails)||void 0===i?void 0:i.currentOwner)||"-"))},disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),_=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,l,i;return{[t("NOC_APP_NO_LABEL")]:e.applicationNo,[t("NOC_COMMON_TABLE_COL_APP_DATE_LABEL")]:Digit.DateUtils.ConvertEpochToDate(null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime)||"-",[t("NOC_APPLICANTS_NAME_LABEL")]:(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName)||"-",[t("NOC_SOURCE_MODULE_LABEL")]:e.source?t("MODULE_"+e.source):"-",[t("NOC_SOURCE_MODULE_NUMBER")]:(null==e?void 0:e.sourceRefId)||"-",[t("WF_INBOX_HEADER_CURRENT_OWNER")]:(null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return l.createElement(r.FormProvider,p,E?l.createElement(ci,{SearchFormFieldsComponent:ui,propsMobileInboxCards:_,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(vi,{columns:f,SearchFormFieldsComponent:ui,onSubmit:a,data:u,error:d,isLoading:s,Count:c}))},NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.useTranslation(),a=d.useDispatch(),[r,u]=n.useState(null),s=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),l.createElement(hi,{stepsList:Ci,onSubmit:e=>{console.log("dataGet===",e)},step:s,setStep:e=>{a(Ni(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var i,a,u;let{config:s,onGoNext:v,onBackClick:m}=e;const p=d.useDispatch(),{t:f}=o.useTranslation(),[E,_]=n.useState(null),[g,h]=n.useState(""),A=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),S=Digit.UserService.getUser(),{control:N,handleSubmit:b,setValue:C,formState:{errors:D},trigger:y,reset:L}=r.useForm(),O={Controller:r.Controller,control:N,setValue:C,errors:D,trigger:y,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:L};function T(e){p(Si(s.key,e)),v()}function I(e){m(s.key,e)}const[w,R]=n.useState((null==A||null===(i=A.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),P=Digit.ULBService.getStateId(),[x,B]=n.useState(!1),F=null==S||null===(a=S.info)||void 0===a||null===(u=a.roles)||void 0===u?void 0:u.map(e=>e.code),{data:M,isLoading:U}=Digit.Hooks.obps.useMDMS(P,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!U){var e,t;let n=[];null==M||null===(e=M.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{n.push(e)})});const l=null==n?void 0:n.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.map(e=>{null!=F&&F.includes(e)&&R(!0)})}},[U]),n.useEffect(()=>{var e;null!=A&&null!==(e=A.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&C("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:b(e=>{y(),D.length>0?console.log("Plz fill mandatory fields in Step1"):T(e)})},l.createElement("div",{className:"employeeCard"},w?l.createElement(l.Fragment,null,l.createElement(yi,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)),l.createElement(Di,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O))):l.createElement(l.Fragment,null,l.createElement(Di,c({onGoBack:I,goNext:T,currentStepData:A,t:f},O)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:g,onClose:()=>{_(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:i,onBackClick:a,onGoNext:u}=e;const{t:s}=o.useTranslation(),v=d.useDispatch(),[m,p]=n.useState(null),[f,E]=n.useState(""),{control:_,handleSubmit:g,setValue:h,formState:{errors:A},trigger:S,watch:N}=(Digit.UserService.getUser(),r.useForm({defaultValues:{floorArea:[{value:""}]}})),b=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C={Controller:r.Controller,control:_,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:r.useFieldArray,watch:N};let D;function y(e){v(Si(i.key,e)),u()}function L(e){a(i.key,e)}return D=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:g(e=>{var t,n,l;S(),(null==e?void 0:e.netTotalArea)!==(null==e?void 0:e.specificationPlotArea)?p({key:"true",error:!0,message:"NOC_PLOT_AREA_SUM_VALIDATION_MESG_LABEL"}):(v(Si(i.key,e)),null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(n=t.Noc)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&l.applicationNo?u():function(e){try{var t,n,l,i,o,a,r,d,s,m,f,E,_,g,h,A,S,N,b,C,y,L,O,T,I,w;const R={applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(t=e.applicationDetails)||void 0===t||null===(n=t.applicantGender)||void 0===n?void 0:n.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(l=e.siteDetails)||void 0===l||null===(i=l.ulbName)||void 0===i?void 0:i.name)||"",roadType:(null==e||null===(o=e.siteDetails)||void 0===o||null===(a=o.roadType)||void 0===a?void 0:a.name)||"",buildingStatus:(null==e||null===(r=e.siteDetails)||void 0===r||null===(d=r.buildingStatus)||void 0===d?void 0:d.name)||"",isBasementAreaAvailable:(null==e||null===(s=e.siteDetails)||void 0===s||null===(m=s.isBasementAreaAvailable)||void 0===m?void 0:m.code)||"",district:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.district)||void 0===E?void 0:E.name)||"",zone:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.zone)||void 0===g?void 0:g.name)||"",specificationBuildingCategory:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.specificationBuildingCategory)||void 0===A?void 0:A.name)||"",specificationNocType:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.specificationNocType)||void 0===N?void 0:N.name)||"",specificationRestrictedArea:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.specificationRestrictedArea)||void 0===C?void 0:C.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(y=e.siteDetails)||void 0===y||null===(L=y.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.code)||""})},P={mobileNumber:(null==R||null===(O=R.applicationDetails)||void 0===O?void 0:O.applicantMobileNumber)||"",name:(null==R||null===(T=R.applicationDetails)||void 0===T?void 0:T.applicantOwnerOrFirmName)||"",emailId:(null==R||null===(I=R.applicationDetails)||void 0===I?void 0:I.applicantEmailId)||"",userName:(null==R||null===(w=R.applicationDetails)||void 0===w?void 0:w.applicantMobileNumber)||""},x={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:D,owners:[P],workflow:{action:"INITIATE"},nocDetails:{additionalDetails:R,tenantId:D}}};console.log("final Payload here==>",x);const B=Rt(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:D,details:x})).then(function(e){var t;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),v(Si("apiData",e)),u()):(console.error("error : create api not executed properly !!!"),p({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},b,{siteDetails:c({},e)})),u())})},l.createElement("div",{className:"employeeCard"},l.createElement(Li,c({onGoBack:L,goNext:y,currentStepData:b,t:s},C)),l.createElement(Oi,c({onGoBack:L,goNext:y,currentStepData:b,t:s},C))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:L}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),m&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==m?void 0:m.error,warning:null==m?void 0:m.warning,label:s(null==m?void 0:m.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=d.useDispatch(),[s,c]=n.useState(!1),[v,m]=n.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),_=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}}),g=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});console.log("coordinates from redux",g);const h=d.useSelector(e=>{var t,n;return null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData})||{};return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:_,config:i.currStepConfig,onSubmit:function(e){var t,n,l,i;const a=function(e){if(!f){var t,n,l,i,o;const a="VACANT"===(null==h||null===(t=h.siteDetails)||void 0===t||null===(n=t.buildingStatus)||void 0===n?void 0:n.code)?null==E||null===(l=E.NOC)||void 0===l?void 0:l.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==E||null===(i=E.NOC)||void 0===i?void 0:i.Documents,r=(null==e||null===(o=e.documents)||void 0===o?void 0:o.documents)||[],u=a.filter(e=>e.required).map(e=>e.code),d=r.map(e=>e.documentType);return u.filter(e=>!d.includes(e))}}(e);return a.length>0?(m(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),void c(!0)):null!=g&&null!==(t=g.Latitude1)&&void 0!==t&&t.trim()&&null!=g&&null!==(n=g.Latitude2)&&void 0!==n&&n.trim()&&null!=g&&null!==(l=g.Longitude1)&&void 0!==l&&l.trim()&&null!=g&&null!==(i=g.Longitude2)&&void 0!==i&&i.trim()?void o():(m(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void c(!0))},onFormValueChange:function(e,t){yn.isEqual(t,_)||u(Si(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),s&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{c(!1),m("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,s,v,m,p,f,E,_,g,h,A;let{config:S,onBackClick:N,t:b}=e;d.useDispatch();const[C,D]=n.useState(null),[y,L]=n.useState(""),[O,T]=n.useState(!1);console.log("selectedCheckBox",O);const I=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData)||{}}),w=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}}),R=n.useRef();let P=Digit.UserService.getUser();const x=null==P||null===(o=P.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[B,F]=n.useState(!1);Digit.Hooks.useClickOutside(R,()=>{F(!1)},B);const M=i.useHistory();let U;U=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const k=e=>{console.log("formData in parent SummaryPage",I),W(I,e)},W=function(e,t){try{if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return D({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),Promise.resolve();const n=function(e,t){var n,l,i,o,a,r,u,d,s,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T,I,R,P,x,B;console.log("nocFormData",e);const F=c({},null==e||null===(n=e.apiData)||void 0===n||null===(l=n.Noc)||void 0===l?void 0:l[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:c({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:c({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails,{applicantGender:(null==e||null===(s=e.applicationDetails)||void 0===s||null===(v=s.applicantGender)||void 0===v?void 0:v.code)||""}),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(m=e.siteDetails)||void 0===m||null===(p=m.ulbName)||void 0===p?void 0:p.name)||"",roadType:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.roadType)||void 0===E?void 0:E.name)||"",buildingStatus:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.buildingStatus)||void 0===g?void 0:g.name)||"",isBasementAreaAvailable:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.isBasementAreaAvailable)||void 0===A?void 0:A.code)||"",district:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.district)||void 0===N?void 0:N.name)||"",zone:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.zone)||void 0===C?void 0:C.name)||"",specificationBuildingCategory:(null==e||null===(D=e.siteDetails)||void 0===D||null===(y=D.specificationBuildingCategory)||void 0===y?void 0:y.name)||"",specificationNocType:(null==e||null===(L=e.siteDetails)||void 0===L||null===(O=L.specificationNocType)||void 0===O?void 0:O.name)||"",specificationRestrictedArea:(null==e||null===(T=e.siteDetails)||void 0===T||null===(I=T.specificationRestrictedArea)||void 0===I?void 0:I.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(R=e.siteDetails)||void 0===R||null===(P=R.specificationIsSiteUnderMasterPlan)||void 0===P?void 0:P.code)||""}),coordinates:c({},w)})}),documents:[]});return((null==e||null===(x=e.documents)||void 0===x||null===(B=x.documents)||void 0===B?void 0:B.documents)||[]).forEach(e=>{F.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})}),{Noc:c({},F)}}(e,t);console.log("finalPayload here==>",n);const l=Rt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:U,details:n})).then(function(e){var n,l,i,o,a,r;"successful"===(null==e||null===(n=e.ResponseInfo)||void 0===n?void 0:n.status)?(console.log("success: Update API "),window.location.href.includes("citizen")?"CANCEL"==t.action?(D({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{M.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),M.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(D({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{M.push("/digit-ui/employee/noc/inbox")},3e3)):M.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:e}}))):(console.error("Submission failed, not moving to next step.",null===(r=res)||void 0===r?void 0:r.response),D({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),D({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function H(e){N(S.key,e)}console.log("currentStepData in StepFour",I);const j=(null==I||null===(r=I.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.applicationNo)||"";console.log("applicationNo here==>",j);const z=Digit.Hooks.useWorkflowDetails({tenantId:U,id:j,moduleCode:"obpas_noc"});console.log("workflow Details here==>",z);let V=(null==z||null===(v=z.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==z||null===(f=z.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",V),l.createElement(l.Fragment,null,l.createElement(Ti,{onGoBack:H,goNext:k,currentStepData:I,t:b}),l.createElement(t.CheckBox,{label:"I hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+((null==I||null===(_=I.applicationDetails)||void 0===_?void 0:_.applicantOwnerOrFirmName)||"NA")+"). I along with with the applicant have read the Policy and understand all the terms and conditions of the Policy. We are committed to fulfill/abide by all the terms and conditions of the Policy. The information/documents submitted are true and correct as per record and no part of it is false and nothing has been concealed/misrepresented therein.",onChange:e=>function(e){T(e.target.checked)}(e),value:O,checked:O}),V&&l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:H}),B&&(null!=z&&null!==(g=z.data)&&void 0!==g&&null!==(h=g.actionState)&&void 0!==h&&h.nextActions||null!=z&&null!==(A=z.data)&&void 0!==A&&A.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:V,optionKey:"action",t:b,onSelect:function(e){k(e)}}):null,O&&l.createElement(t.SubmitBar,{ref:R,label:b("WF_TAKE_ACTION"),onSubmit:()=>F(!B)})),C&&l.createElement(t.Toast,{isDleteBtn:!0,error:null==C?void 0:C.error,warning:null==C?void 0:C.warning,label:b(null==C?void 0:C.message),onClose:()=>{D(null)}}))},NOCApplicantDetails:Di,NOCProfessionalDetails:yi,NOCSiteDetails:Li,NOCSpecificationDetails:Oi,NOCDocumentsRequired:e=>{var i,o,a,r,u,s,v,m;let{t:p,config:f,onSelect:E,formData:_}=e;Digit.ULBService.getStateId();const[h,A]=n.useState(null==_||null===(i=_.documents)||void 0===i?void 0:i.documents);console.log("documents in childStep three",h);const[S,N]=n.useState(null),[b,C]=n.useState(!0),[D,y]=n.useState(!1),[L,O]=n.useState(null),T=Digit.ULBService.getStateId(),I=d.useDispatch(),{isLoading:w,data:R}=Digit.Hooks.pt.usePropertyMDMS(T,"NOC",["Documents"]),P=d.useSelector(function(e){var t,n;return(null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.coordinates)||{}});n.useEffect(()=>{Object.keys(P).length>0&&O(P)},[P]),console.log("coordinates (from redux)",P),console.log("geocoordinates",L);const x=d.useSelector(e=>{var t,n;return null==e||null===(t=e.noc)||void 0===t||null===(n=t.NOCNewApplicationFormReducer)||void 0===n?void 0:n.formData})||{},B="VACANT"===(null==x||null===(o=x.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.code)?null==R||null===(r=R.NOC)||void 0===r||null===(u=r.Documents)||void 0===u?void 0:u.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==R||null===(s=R.NOC)||void 0===s?void 0:s.Documents,F=()=>{let e;e=c({},_.documents,{documents:h}),E(f.key,e)};n.useEffect(()=>{var e,t;let n=0;null==R||null===(e=R.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==h||h.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),C("0"!=n&&0!=n||!((null==h?void 0:h.length)>0))},[h,D]),n.useEffect(()=>{var e,t;"VACANT"===(null==x||null===(e=x.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&A(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==x||null===(v=x.siteDetails)||void 0===v||null===(m=v.buildingStatus)||void 0===m?void 0:m.code]);const M={value:{workflowDocs:null==h?void 0:h.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:U}=Digit.Hooks.noc.useNOCDocumentSearch(M),k=null==h?void 0:h.map(e=>({code:e.documentType,link:g(null==U?void 0:U.pdfFiles,e.filestoreId)}));return l.createElement("div",null,w?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:p,config:f,onSelect:F,onSkip:()=>E(),isDisabled:b,onAdd:function(){}},null==B?void 0:B.map((e,t)=>{var n;return l.createElement(Ii,{key:t,document:e,t:p,error:S,setError:N,setDocuments:A,documents:h,setCheckRequiredFields:y,handleSubmit:F,geocoordinates:L,setGeoCoordinates:O,dispatch:I,previewLink:null==k||null===(n=k.find(t=>t.code===e.code))||void 0===n?void 0:n.link})}),S&&l.createElement(t.Toast,{label:S,isDleteBtn:!0,onClose:()=>N(null),error:!0})))},NOCSummary:Ti,NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:d,formData:s}=e;const v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==s||null===(i=s.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,g]=n.useState(!0),[h,A]=n.useState(!1),[S,N]=n.useState(!1),b=ht((null==s?void 0:s.PrevStateDocuments)||[]),{isLoading:C,data:D}=Digit.Hooks.pt.usePropertyMDMS(v,"NOC",["Documents"]),y=()=>{let e;e=c({},s.documents,{documents:m}),d(u.key,e)};return n.useEffect(()=>{var e,t;const n=null==D||null===(e=D.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),l=null==n?void 0:n.filter(e=>m.reduce((t,n)=>{var l,i,o,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(i=l.split("."))||void 0===i?void 0:i[0])+"."+(null==n||null===(o=n.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));g(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:y,onSkip:()=>d(),onAdd:function(){}},null==D||null===(o=D.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(wi,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:b||[],isNextButtonDisabled:S,setIsNextButtonDisabled:N,handleSubmit:y}))),f&&l.createElement(t.Toast,{label:f,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=s&&s.applicationNo?l.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==s?void 0:s.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var n,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),v=i.useHistory(),m=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];console.log("nocData here",m),window.localStorage.getItem("CITIZEN.CITY");const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=d.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==m||null===(r=m.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==m?void 0:m.applicationStatus)?"":c(p(null==m?void 0:m.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==m?void 0:m.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==m?void 0:m.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=m,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{v.push("/digit-ui/citizen/noc-home")}}))))},NOCCitizenMyApplications:e=>{var a,r,u;const{t:d}=o.useTranslation(),s=(i.useHistory(),(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{}),v=window.localStorage.getItem("CITIZEN.CITY"),m={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC",mobileNumber:""},{isLoading:p,data:f}=Digit.Hooks.noc.useNOCCitizenSearchApplication(c({},m,{mobileNumber:(null==s?void 0:s.mobileNumber)||""}),v);console.log("data herein NOC==>",f);const E=["CS_CF_VIEW","CS_CF_TRACK","TL_VIEW_DETAILS"];return n.useEffect(()=>{f&&f.revalidate()},[]),p?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"applications-list-container"},l.createElement(t.Header,null,""+d("NOC_MY_APPLICATION")),0===(null==f||null===(r=f.data)||void 0===r?void 0:r.length)&&l.createElement(t.Card,{style:{textAlign:"center"}},d("NO_APPLICATIONS_MSG")),null==f||null===(u=f.data)||void 0===u?void 0:u.map((e,n)=>{var o;const a=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return l.createElement("div",{key:"card-"+n},l.createElement(t.Card,null,Object.keys(a).filter(e=>null!==a[e]).map(e=>l.createElement(t.KeyNote,{keyValue:d(e),note:d(a[e])})),l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationNo)},l.createElement(t.SubmitBar,{label:d(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,d,s,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T,I,w,R,P;const{id:x}=i.useParams(),{t:B}=o.useTranslation(),F=i.useHistory(),M=window.localStorage.getItem("CITIZEN.CITY"),[U,k]=n.useState({}),{isLoading:W,data:H}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:x},M),j=null==H?void 0:H.resData;console.log("applicationDetails here==>",j);const{data:z}=Digit.Hooks.useStore.getInitData(),{tenants:V}=z||{};let G=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};G=null==t?void 0:t.value}const Y=null===(e=G)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);n.useEffect(()=>{var e;const t=null==j||null===(e=j.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o,a,r;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,d=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,s=(null==t?void 0:t.documents)||[];console.log("applicantDetails",e),console.log("siteDetails",u),k({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:d?[d]:[],Documents:s.length>0?s:[]})}},[null==j?void 0:j.Noc]),console.log("displayData here",U);const[K,q]=n.useState(null),[X,Q]=n.useState(!1),[J,Z]=n.useState(null),$=n.useRef();Digit.Hooks.useClickOutside($,()=>{Q(!1)},X);const ee=Digit.Hooks.useWorkflowDetails({tenantId:M,id:x,moduleCode:"obpas_noc"});var te,ne;console.log("workflowDetails here=>",ee),null!=ee&&null!==(u=ee.data)&&void 0!==u&&null!==(d=u.actionState)&&void 0!==d&&d.nextActions&&!ee.isLoading&&(ee.data.actionState.nextActions=[...null==ee||null===(s=ee.data)||void 0===s?void 0:s.nextActions]),ee&&ee.data&&!ee.isLoading&&(ee.data.initialActionState=(null==ee||null===(te=ee.data)||void 0===te?void 0:te.initialActionState)||c({},null==ee||null===(ne=ee.data)||void 0===ne?void 0:ne.actionState)||{},ee.data.actionState=c({},ee.data)),n.useEffect(()=>{ee&&ee.revalidate(),H&&H.revalidate()},[]);let le=(null==ee||null===(v=ee.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==Y?void 0:Y.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==ee||null===(f=ee.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==Y?void 0:Y.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",le),W?l.createElement(t.Loader,null):l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},B("NDC_APP_OVER_VIEW_HEADER")),"APPROVED"===(null==j||null===(_=j.Noc)||void 0===_||null===(g=_[0])||void 0===g?void 0:g.applicationStatus)&&l.createElement(t.LinkButton,{label:B("DOWNLOAD_CERTIFICATE"),style:{color:"#A52A2A"},onClick:function(){try{var e;const t=null==j||null===(e=j.Noc)||void 0===e?void 0:e[0];console.log("Property in NOC",j);const n=V.find(e=>e.code===t.tenantId);return Promise.resolve(Ot(t,n,B)).then(function(e){console.log("acknowledgementData",e),Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("NOC_APPLICANT_DETAILS")),null==U||null===(h=U.applicantDetails)||void 0===h?void 0:h.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:B("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"}),l.createElement(t.Row,{label:B("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.applicantPropertyId)||"N/A"})))})),(null==U||null===(A=U.applicantDetails)||void 0===A?void 0:A.professionalName)&&(null==U||null===(S=U.applicantDetails)||void 0===S?void 0:S.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:B("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:B("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:B("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:B("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:B("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("NOC_SITE_DETAILS")),null==U||null===(N=U.siteDetails)||void 0===N?void 0:N.map((e,n)=>{var i,o,a,r,u,d,s;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:B("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:B("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:B("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:B("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:B("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:B("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:B("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:B("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:B("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:B("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),l.createElement(t.Row,{label:B("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:B("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:B("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:B("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,t)=>{(e=>{B(0===e?"NOC_GROUND_FLOOR_AREA_LABEL":"NOC_FLOOR_AREA_LABEL")})(t)})),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:B("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:B("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:B("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:B("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:B("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:B("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:B("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:B("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("NOC_SPECIFICATION_DETAILS")),null==U||null===(b=U.siteDetails)||void 0===b?void 0:b.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:B("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:B("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:B("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:B("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:B("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("NOC_SITE_COORDINATES_LABEL")),null==U||null===(C=U.coordinates)||void 0===C?void 0:C.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:B("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),l.createElement(t.Row,{label:B("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),l.createElement(t.Row,{label:B("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),l.createElement(t.Row,{label:B("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:{display:"flex",gap:"16px"}},Array.isArray(null==U?void 0:U.Documents)&&(null==U||null===(D=U.Documents)||void 0===D?void 0:D.length)>0?l.createElement(sl,{value:{workflowDocs:null==U?void 0:U.Documents}}):l.createElement("div",null,B("NOC_NO_DOCUMENTS_MSG")))),(null==ee||null===(y=ee.data)||void 0===y?void 0:y.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,B("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==ee||null===(L=ee.data)||void 0===L?void 0:L.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:B(null==ee||null===(O=ee.data)||void 0===O||null===(T=O.timeline[0])||void 0===T?void 0:T.status)}):l.createElement(t.ConnectingCheckPoints,null,null==ee||null===(I=ee.data)||void 0===I?void 0:I.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:B("NOC_STATUS_"+e.status),customChild:Pi(e,n,0,B)})))),le&&le.length>0&&l.createElement(t.ActionBar,null,X&&(null!=ee&&null!==(w=ee.data)&&void 0!==w&&null!==(R=w.actionState)&&void 0!==R&&R.nextActions||null!=ee&&null!==(P=ee.data)&&void 0!==P&&P.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:le,optionKey:"action",t:B,onSelect:function(e){var t,n;console.log("selected action",e);const l=null==j||null===(t=j.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?F.push("/digit-ui/citizen/noc/edit-application/"+l):"DRAFT"==(null==e?void 0:e.action)?q({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?function(e){try{var t,n;const l=c({},(null==j||null===(t=j.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments},console.log("updatedApplicant",l);const o={Noc:c({},l)};console.log("final Payload ",o);const a=Rt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:M,details:o})).then(function(e){var t,n,l;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==i?void 0:i.action)?(q({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),ee.revalidate(),Z(null)):(console.log("We are calling citizen response page"),F.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})):(q({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Z(null))})},function(){q({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(i):"PAY"==(null==e?void 0:e.action)?F.push("/digit-ui/citizen/payment/collect/obpas_noc/"+l+"/"+M+"?tenantId="+M):Z(e)}}):null,l.createElement(t.SubmitBar,{ref:$,label:B("WF_TAKE_ACTION"),onSubmit:()=>Q(!X)})),K&&l.createElement(t.Toast,{error:null==K?void 0:K.error,warning:null==K?void 0:K.warning,label:B(null==K?void 0:K.message),isDleteBtn:!0,onClose:()=>{q(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,d,s,v,m,p,f,E,_,g,h,A,S,N,b,C,D,y,L,O,T,I,w,R;const{id:P}=i.useParams(),{t:x}=o.useTranslation(),B=window.localStorage.getItem("Employee.tenant-id"),F=i.useHistory(),M=null==B?void 0:B.split(".")[0],[U,k]=n.useState(null),[W,H]=n.useState(null),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,K]=n.useState({}),[q,X]=n.useState(!1),{isLoading:Q,data:J}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:P},B),Z=null==J?void 0:J.resData;console.log("applicationDetails here==>",Z);const $=Digit.Hooks.useWorkflowDetails({tenantId:B,id:P,moduleCode:"obpas_noc"});var ee,te;console.log("workflowDetails here=>",$),null!=$&&null!==(e=$.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!$.isLoading&&($.data.actionState.nextActions=[...null==$||null===(r=$.data)||void 0===r?void 0:r.nextActions]),$&&$.data&&!$.isLoading&&($.data.initialActionState=(null==$||null===(ee=$.data)||void 0===ee?void 0:ee.initialActionState)||c({},null==$||null===(te=$.data)||void 0===te?void 0:te.actionState)||{},$.data.actionState=c({},$.data));const[ne,le]=n.useState(!1),[ie,oe]=n.useState(null),[ae,re]=n.useState(!1),ue=()=>{k(null)};let de=Digit.UserService.getUser();const se=n.useRef();if(Digit.Hooks.useClickOutside(se,()=>{le(!1)},ne),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};de=null==t?void 0:t.value}const ce=null===(u=de)||void 0===u||null===(d=u.info)||void 0===d||null===(s=d.roles)||void 0===s?void 0:s.map(e=>e.code);n.useEffect(()=>{$&&$.revalidate(),J&&J.revalidate()},[]);let ve=(null==$||null===(v=$.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==ce?void 0:ce.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==$||null===(f=$.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==ce?void 0:ce.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));console.log("actions here",ve),n.useEffect(()=>{var e;const t=null==Z||null===(e=Z.Noc)||void 0===e?void 0:e[0];if(t){var n,l,i,o,a,r;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,d=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,s=(null==t?void 0:t.documents)||[];K({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:d?[d]:[],Documents:s.length>0?s:[]})}},[null==Z?void 0:Z.Noc]);const me=function(e){try{var t,n;const l=c({},(null==Z||null===(t=Z.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];l.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},l)};console.log("final Payload ",o);const a=Rt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:B,details:o})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==i?void 0:i.action))k({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),$.revalidate(),oe(null);else if("APPLY"===(null==i?void 0:i.action)||"RESUBMIT"===(null==i?void 0:i.action)||"DRAFT"===(null==i?void 0:i.action)){var n,l;console.log("We are calling employee response page"),F.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:e}})}else k({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),$.revalidate(),oe(null);else k({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),oe(null)})},function(){k({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},pe=e=>0===e?x("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+x("NOC_FLOOR_AREA_LABEL");return Q?l.createElement(t.Loader,null):(console.log("displayData here",Y),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},x("NDC_APP_OVER_VIEW_HEADER"))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_APPLICANT_DETAILS")),null==Y||null===(_=Y.applicantDetails)||void 0===_?void 0:_.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||(null==e?void 0:e.applicantGender)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"}),l.createElement(t.Row,{label:x("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.applicantPropertyId)||"N/A"})))})),(null==Y||null===(g=Y.applicantDetails)||void 0===g?void 0:g.professionalName)&&(null==Y||null===(h=Y.applicantDetails)||void 0===h?void 0:h.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_SITE_DETAILS")),null==Y||null===(A=Y.siteDetails)||void 0===A?void 0:A.map((e,n)=>{var i,o,a,r,u,d,s;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:x("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),l.createElement(t.Row,{label:x("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:x("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:x("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:x("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),l.createElement(t.Row,{label:x("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:x("NOC_BASEMENT_AREA_LABEL"),text:(null==e?void 0:e.basementArea)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,n)=>l.createElement(t.Row,{label:pe(n),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&l.createElement(t.Row,{label:x("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),l.createElement(t.Row,{label:x("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),l.createElement(t.Row,{label:x("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),l.createElement(t.Row,{label:x("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_SPECIFICATION_DETAILS")),null==Y||null===(S=Y.siteDetails)||void 0===S?void 0:S.map((e,n)=>{var i,o,a,r;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:x("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),l.createElement(t.Row,{label:x("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),l.createElement(t.Row,{label:x("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),l.createElement(t.Row,{label:x("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_SITE_COORDINATES_LABEL")),null==Y||null===(N=Y.coordinates)||void 0===N?void 0:N.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:x("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),l.createElement(t.Row,{label:x("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),l.createElement(t.Row,{label:x("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),l.createElement(t.Row,{label:x("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:{display:"flex",gap:"16px"}},Array.isArray(null==Y?void 0:Y.Documents)&&(null==Y||null===(b=Y.Documents)||void 0===b?void 0:b.length)>0?l.createElement(sl,{value:{workflowDocs:null==Y?void 0:Y.Documents}}):l.createElement("div",null,x("NOC_NO_DOCUMENTS_MSG")))),(null==$||null===(C=$.data)||void 0===C?void 0:C.timeline)&&l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==$||null===(D=$.data)||void 0===D?void 0:D.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:x(null==$||null===(y=$.data)||void 0===y||null===(L=y.timeline[0])||void 0===L?void 0:L.status)}):l.createElement(t.ConnectingCheckPoints,null,null==$||null===(O=$.data)||void 0===O?void 0:O.timeline.map((e,n,i)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:x("NOC_STATUS_"+e.status),customChild:fl(e,n,0,x)})))),(null==ve?void 0:ve.length)>0&&l.createElement(t.ActionBar,null,ne&&(null!=$&&null!==(T=$.data)&&void 0!==T&&null!==(I=T.actionState)&&void 0!==I&&I.nextActions||null!=$&&null!==(w=$.data)&&void 0!==w&&w.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:ve,optionKey:"action",t:x,onSelect:function(e){var t,n;console.log("selected action",e);const l=null==Z||null===(t=Z.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?F.push("/digit-ui/employee/noc/edit-application/"+l):"DRAFT"==(null==e?void 0:e.action)?k({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?me(i):"PAY"==(null==e?void 0:e.action)?F.push("/digit-ui/employee/payment/collect/obpas_noc/"+l+"/"+B+"?tenantId="+B):(re(!0),oe(e))}}):null,l.createElement(t.SubmitBar,{ref:se,label:x("WF_TAKE_ACTION"),onSubmit:()=>le(!ne)})),ae?l.createElement(pl,{t:x,action:ie,tenantId:B,state:M,id:P,applicationDetails:Z,applicationData:null==Z?void 0:Z.Noc,closeModal:()=>{oe(null),re(!1)},submitAction:me,actionData:null==$||null===(R=$.data)||void 0===R?void 0:R.timeline,workflowDetails:$,showToast:U,setShowToast:k,closeToast:ue,errors:W,showErrorToast:j,errorOne:V,closeToastOne:()=>{z(null)}}):null,U&&l.createElement(t.Toast,{error:null==U?void 0:U.error,warning:null==U?void 0:U.warning,label:x(null==U?void 0:U.message),isDleteBtn:!0,onClose:ue})))},NewNOCEditApplication:()=>{var e,a,r,u,s,v,m,p;const{id:f}=i.useParams(),{t:E}=(i.useHistory(),o.useTranslation()),_=d.useDispatch(),[g,h]=n.useState(null),A=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer),S=A.formData,N=A.step;let b;b=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY"),console.log("tenantId here",b);const{isLoading:C,data:D}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:f},b),y=null==D?void 0:D.resData;console.log("applicationDetails here==>",y);const L=(null==y||null===(e=y.Noc)||void 0===e?void 0:e[0])||{},O=(null==L||null===(a=L.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},T=(null==L||null===(u=L.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s?void 0:s.siteDetails)||{},I=(null==L||null===(v=L.documents)||void 0===v?void 0:v.filter(e=>(null==e?void 0:e.documentUid)||(null==e?void 0:e.documentType)))||[],w=(null==L||null===(m=L.nocDetails)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.coordinates)||{},R=Digit.ULBService.getStateId(),{data:P,isLoading:x}=Digit.Hooks.noc.useBuildingType(R),{data:B}=Digit.Hooks.noc.useRoadType(R),{data:F}=Digit.Hooks.noc.useBuildingCategory(R),{data:M}=Digit.Hooks.noc.useNocType(R),{data:U,isLoading:k}=Digit.Hooks.useTenants(),[W,H]=n.useState(Digit.Hooks.noc.useTenants()),j=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],z=null==U?void 0:U.map(e=>c({},e,{displayName:E(e.i18nKey)})),{data:V}=Digit.Hooks.obps.useMDMS(R,"common-masters",["GenderType"]);let G=[];V&&V["common-masters"].GenderType.filter(e=>e.active).map(e=>{G.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const[Y,K]=n.useState(null),{data:q}=Digit.Hooks.useBoundaryLocalities(null==Y?void 0:Y.code,"revenue",{enabled:!!Y},E);return n.useEffect(()=>{if((null==q?void 0:q.length)>0&&null!=T&&T.zone){var e;const t=(null==T||null===(e=T.zone)||void 0===e?void 0:e.name)||(null==T?void 0:T.zone),n=q.find(e=>e.name===t);n&&_(Si("siteDetails",c({},S.siteDetails,{zone:n})))}},[q,null==T?void 0:T.zone]),n.useEffect(()=>{if(_({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!C&&!x&&null!=L&&L.nocDetails&&!k){const e={documents:{documents:null==I?void 0:I.map(e=>({documentType:(null==e?void 0:e.documentType)||"",uuid:(null==e?void 0:e.uuid)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||"",filestoreId:(null==e?void 0:e.uuid)||""}))}};Object.entries(w).forEach(e=>{let[t,n]=e;_(bi(t,n))});const t=c({},O,{applicantGender:G.find(e=>{var t;return e.code===(null==O||null===(t=O.applicantGender)||void 0===t?void 0:t.code)||e.code===(null==O?void 0:O.applicantGender)})}),n=W.find(e=>{var t;return e.name===(null==T||null===(t=T.district)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.district)});K(n);const l=c({},T,{ulbName:z.find(e=>{var t;return e.name===(null==T||null===(t=T.ulbName)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.ulbName)}),roadType:B.find(e=>{var t;return e.name===(null==T||null===(t=T.roadType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.roadType)}),buildingStatus:P.find(e=>{var t;return e.name===(null==T||null===(t=T.buildingStatus)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.buildingStatus)}),isBasementAreaAvailable:j.find(e=>{var t;return e.code===(null==T||null===(t=T.isBasementAreaAvailable)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.isBasementAreaAvailable)}),district:n,specificationBuildingCategory:F.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationBuildingCategory)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationBuildingCategory)}),specificationNocType:M.find(e=>{var t;return e.name===(null==T||null===(t=T.specificationNocType)||void 0===t?void 0:t.name)||e.name===(null==T?void 0:T.specificationNocType)}),specificationRestrictedArea:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationRestrictedArea)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationRestrictedArea)}),specificationIsSiteUnderMasterPlan:j.find(e=>{var t;return e.code===(null==T||null===(t=T.specificationIsSiteUnderMasterPlan)||void 0===t?void 0:t.code)||e.code===(null==T?void 0:T.specificationIsSiteUnderMasterPlan)})});_(Si("applicationDetails",t)),_(Si("siteDetails",l)),_(Si("documents",e)),_(Si("apiData",y))}},[C,y,x]),C||!S.applicationDetails?l.createElement("div",null,l.createElement(t.Loader,null)):l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},E("NOC_REGISTRATION_APPLICATION")),l.createElement(hi,{stepsList:Ri,onSubmit:e=>{},step:N,setStep:e=>{_(Ni(e))}}),g&&l.createElement(t.Toast,{error:g.key,label:E(g.label),onClose:()=>{h(null)},isDleteBtn:"true"}))}};exports.NOCLinks=xi,exports.NOCModule=Bi,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:pi}),exports.initNOCComponents=()=>{Object.entries(Fi).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|