@mseva/digit-ui-module-noc 1.0.8 → 1.0.10
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),o=require("react-router-dom"),i=require("react-i18next"),a=require("react-query"),r=require("react-hook-form"),u=require("redux"),s=require("react-redux"),c=e(require("exif-js"));function d(){return(d=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 m(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 v=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),o=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+o}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=[],o=Digit.UserService.getUser().info.roles;return n.map((t,i)=>{let{roles:a}=t;a.map(t=>{o.map(o=>{var a;o.code===t&&l.push(e?null==n||null===(a=n[i])||void 0===a?void 0:a.code:null==n?void 0:n[i])})})}),l};var E=function(e,t){return e===t||e!=e&&t!=t},g=function(e,t){for(var n=e.length;n--;)if(E(e[n][0],t))return n;return-1},h=Array.prototype.splice;function S(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])}}S.prototype.clear=function(){this.__data__=[],this.size=0},S.prototype.delete=function(e){var t=this.__data__,n=g(t,e);return!(n<0||(n==t.length-1?t.pop():h.call(t,n,1),--this.size,0))},S.prototype.get=function(e){var t=this.__data__,n=g(t,e);return n<0?void 0:t[n][1]},S.prototype.has=function(e){return g(this.__data__,e)>-1},S.prototype.set=function(e,t){var n=this.__data__,l=g(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var b=S,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t){return e(t={exports:{}},t.exports),t.exports}var C,D="object"==typeof A&&A&&A.Object===Object&&A,T="object"==typeof self&&self&&self.Object===Object&&self,N=D||T||Function("return this")(),O=N.Symbol,L=Object.prototype,I=L.hasOwnProperty,w=L.toString,x=O?O.toStringTag:void 0,P=Object.prototype.toString,R=O?O.toStringTag:void 0,F=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?function(e){var t=I.call(e,x),n=e[x];try{e[x]=void 0;var l=!0}catch(e){}var o=w.call(e);return l&&(t?e[x]=n:delete e[x]),o}(e):function(e){return P.call(e)}(e)},B=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=function(e){if(!B(e))return!1;var t=F(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},U=N["__core-js_shared__"],k=(C=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",W=Function.prototype.toString,H=function(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""},j=/^\[object .+?Constructor\]$/,z=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!B(e)||(t=e,k&&k in t))&&(M(e)?z:j).test(H(e));var t}(n)?n:void 0},G=V(N,"Map"),Y=V(Object,"create"),q=Object.prototype.hasOwnProperty,K=Object.prototype.hasOwnProperty;function X(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])}}X.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(Y){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return q.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:K.call(t,e)},X.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this};var $=X,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 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.size=0,this.__data__={hash:new $,map:new(G||b),string:new $}},Q.prototype.delete=function(e){var t=J(this,e).delete(e);return this.size-=t?1:0,t},Q.prototype.get=function(e){return J(this,e).get(e)},Q.prototype.has=function(e){return J(this,e).has(e)},Q.prototype.set=function(e,t){var n=J(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Z=Q;function ee(e){var t=this.__data__=new b(e);this.size=t.size}ee.prototype.clear=function(){this.__data__=new b,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof b){var l=n.__data__;if(!G||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Z(l)}return n.set(e,t),this.size=n.size,this};var te=ee,ne=function(){try{var e=V(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),le=function(e,t,n){"__proto__"==t&&ne?ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},oe=Object.prototype.hasOwnProperty,ie=function(e,t,n){var l=e[t];oe.call(e,t)&&E(l,n)&&(void 0!==n||t in e)||le(e,t,n)},ae=function(e,t,n,l){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),o?le(n,r,u):ie(n,r,u)}return n},re=function(e){return null!=e&&"object"==typeof e},ue=function(e){return re(e)&&"[object Arguments]"==F(e)},se=Object.prototype,ce=se.hasOwnProperty,de=se.propertyIsEnumerable,me=ue(function(){return arguments}())?ue:function(e){return re(e)&&ce.call(e,"callee")&&!de.call(e,"callee")},ve=Array.isArray,pe=function(){return!1},fe=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?N.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||pe}),Ee=/^(?:0|[1-9]\d*)$/,ge=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Ee.test(e))&&e>-1&&e%1==0&&e<t},he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},_e={};_e["[object Float32Array]"]=_e["[object Float64Array]"]=_e["[object Int8Array]"]=_e["[object Int16Array]"]=_e["[object Int32Array]"]=_e["[object Uint8Array]"]=_e["[object Uint8ClampedArray]"]=_e["[object Uint16Array]"]=_e["[object Uint32Array]"]=!0,_e["[object Arguments]"]=_e["[object Array]"]=_e["[object ArrayBuffer]"]=_e["[object Boolean]"]=_e["[object DataView]"]=_e["[object Date]"]=_e["[object Error]"]=_e["[object Function]"]=_e["[object Map]"]=_e["[object Number]"]=_e["[object Object]"]=_e["[object RegExp]"]=_e["[object Set]"]=_e["[object String]"]=_e["[object WeakMap]"]=!1;var Se=function(e){return function(t){return e(t)}},be=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&D.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Ae=be&&be.isTypedArray,ye=Ae?Se(Ae):function(e){return re(e)&&he(e.length)&&!!_e[F(e)]},Ce=Object.prototype.hasOwnProperty,De=function(e,t){var n=ve(e),l=!n&&me(e),o=!n&&!l&&fe(e),i=!n&&!l&&!o&&ye(e),a=n||l||o||i,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&&!Ce.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ge(s,u))||r.push(s);return r},Te=Object.prototype,Ne=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Te)},Oe=function(e,t){return function(n){return e(t(n))}},Le=Oe(Object.keys,Object),Ie=Object.prototype.hasOwnProperty,we=function(e){return null!=e&&he(e.length)&&!M(e)},xe=function(e){return we(e)?De(e):function(e){if(!Ne(e))return Le(e);var t=[];for(var n in Object(e))Ie.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Pe=Object.prototype.hasOwnProperty,Re=function(e){return we(e)?De(e,!0):function(e){if(!B(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ne(e),n=[];for(var l in e)("constructor"!=l||!t&&Pe.call(e,l))&&n.push(l);return n}(e)},Fe=y(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?N.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=i?i(n):new e.constructor(n);return e.copy(l),l}}),Be=function(){return[]},Me=Object.prototype.propertyIsEnumerable,Ue=Object.getOwnPropertySymbols,ke=Ue?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,o=null==t?0:t.length,i=0,a=[];++l<o;){var r=t[l];Me.call(e,r)&&(a[i++]=r)}return a}(Ue(e)))}:Be,We=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},He=Oe(Object.getPrototypeOf,Object),je=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)We(t,ke(e)),e=He(e);return t}:Be,ze=function(e,t,n){var l=t(e);return ve(e)?l:We(l,n(e))},Ve=function(e){return ze(e,xe,ke)},Ge=function(e){return ze(e,Re,je)},Ye=V(N,"DataView"),qe=V(N,"Promise"),Ke=V(N,"Set"),Xe=V(N,"WeakMap"),$e=H(Ye),Je=H(G),Qe=H(qe),Ze=H(Ke),et=H(Xe),tt=F;(Ye&&"[object DataView]"!=tt(new Ye(new ArrayBuffer(1)))||G&&"[object Map]"!=tt(new G)||qe&&"[object Promise]"!=tt(qe.resolve())||Ke&&"[object Set]"!=tt(new Ke)||Xe&&"[object WeakMap]"!=tt(new Xe))&&(tt=function(e){var t=F(e),n="[object Object]"==t?e.constructor:void 0,l=n?H(n):"";if(l)switch(l){case $e:return"[object DataView]";case Je:return"[object Map]";case Qe:return"[object Promise]";case Ze:return"[object Set]";case et:return"[object WeakMap]"}return t});var nt=tt,lt=Object.prototype.hasOwnProperty,ot=N.Uint8Array,it=function(e){var t=new e.constructor(e.byteLength);return new ot(t).set(new ot(e)),t},at=/\w*$/,rt=O?O.prototype:void 0,ut=rt?rt.valueOf:void 0,st=Object.create,ct=function(){function e(){}return function(t){if(!B(t))return{};if(st)return st(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),dt=be&&be.isMap,mt=dt?Se(dt):function(e){return re(e)&&"[object Map]"==nt(e)},vt=be&&be.isSet,pt=vt?Se(vt):function(e){return re(e)&&"[object Set]"==nt(e)},ft={};ft["[object Arguments]"]=ft["[object Array]"]=ft["[object ArrayBuffer]"]=ft["[object DataView]"]=ft["[object Boolean]"]=ft["[object Date]"]=ft["[object Float32Array]"]=ft["[object Float64Array]"]=ft["[object Int8Array]"]=ft["[object Int16Array]"]=ft["[object Int32Array]"]=ft["[object Map]"]=ft["[object Number]"]=ft["[object Object]"]=ft["[object RegExp]"]=ft["[object Set]"]=ft["[object String]"]=ft["[object Symbol]"]=ft["[object Uint8Array]"]=ft["[object Uint8ClampedArray]"]=ft["[object Uint16Array]"]=ft["[object Uint32Array]"]=!0,ft["[object Error]"]=ft["[object Function]"]=ft["[object WeakMap]"]=!1;var Et=function e(t,n,l,o,i,a){var r,u=1&n,s=2&n,c=4&n;if(l&&(r=i?l(t,o,i,a):l(t)),void 0!==r)return r;if(!B(t))return t;var d=ve(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&<.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 m=nt(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(fe(t))return Fe(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!i){if(r=s||v?{}:function(e){return"function"!=typeof e.constructor||Ne(e)?{}:ct(He(e))}(t),!u)return s?function(e,t){return ae(e,je(e),t)}(t,function(e,t){return e&&ae(t,Re(t),e)}(r,t)):function(e,t){return ae(e,ke(e),t)}(t,function(e,t){return e&&ae(t,xe(t),e)}(r,t))}else{if(!ft[m])return i?t:{};r=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return it(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?it(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?it(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,at.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return ut?Object(ut.call(e)):{}}}(t,m,u)}}a||(a=new te);var p=a.get(t);if(p)return p;a.set(t,r),pt(t)?t.forEach(function(o){r.add(e(o,n,l,o,t,a))}):mt(t)&&t.forEach(function(o,i){r.set(i,e(o,n,l,i,t,a))});var f=d?void 0:(c?s?Ge:Ve:s?Re: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(o,i){f&&(o=t[i=o]),ie(r,i,e(o,n,l,i,t,a))}),r},gt=function(e){return Et(e,5)};const ht=e=>{var o,a;const{t:r}=i.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),s=Digit.ComponentRegistryService.getComponent("NOCSearchApplication"),c=f();let m=[];1==(null==c?void 0:c.length)&&(m=[null==c||null===(o=c[0])||void 0===o?void 0:o.code]),(null==c?void 0:c.length)>1&&(null==c||c.forEach(e=>{m.push(e.code)}));const[v,p]=n.useState({offset:0,limit:10,tenantId:u,nocType:m[0]}),E={offset:0,limit:10,tenantId:u,nocType:m[0]},g=window.Digit.Utils.browser.isMobile(),{data:h,isLoading:_,isSuccess:S,error:b}=Digit.Hooks.noc.useNOCSearchApplication(u,v,{});return l.createElement("div",null,l.createElement(t.CardHeader,{styles:g?{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=gt(e),l=E;for(const[t,n]of Object.entries(e))null!=n&&null!=n&&""!=n&&(l=d({},l,{[t]:n}));p(1==t?n:l)},isLoading:_,Count:null==h?void 0:h.count,error:b,data:!_&&S&&(null==h||null===(a=h.Noc)||void 0===a?void 0:a.length)>0?h.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},_t=e=>{var n,a;const{state:r}=e.location,{t:u}=i.useTranslation(),s=o.useHistory(),c=null==r||null===(n=r.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0],d=window.localStorage.getItem("Employee.tenant-id");return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:u("NOC_"+p(null==c?void 0:c.nocType,".","_")+"_"+p(null==c?void 0:c.applicationStatus,".","_")+"_HEADER"),applicationNumber:null==c?void 0:c.nocNo,info:"REJECTED"==(null==c?void 0:c.applicationStatus)?"":u("NOC_"+p(null==c?void 0:c.nocType,".","_")+"_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.applicationStatus)?l.createElement(t.CardText,null,u("NOC_"+p(null==c?void 0:c.nocType,".","_")+"_"+p(null==c?void 0:c.applicationStatus,".","_")+"_SUB_HEADER")):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:u("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{s.push("/digit-ui/employee/noc/inbox")}}),l.createElement(t.SubmitBar,{label:u("COMMON_MAKE_PAYMENT"),onSubmit:()=>{s.push("/digit-ui/employee/payment/collect/NOC/"+ndcCode+"/"+d)}}))))},St=e=>{let{location:n}=e;const{t:o}=i.useTranslation(),a=[{path:"/digit-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:o("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:o("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:o("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:o("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},bt=e=>{var a,r,u,s,c,m;let{path:v}=e;const p=o.useLocation(),f=(i.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),E=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NOCInbox"),g=null===(c=Digit)||void 0===c||null===(m=c.ComponentRegistryService)||void 0===m?void 0:m.getComponent("NewNOCStepperForm"),h=window.location.href.includes("/response"),_=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,h?null:l.createElement("div",{style:window.location.href.includes("application-overview")||_?{marginLeft:"10px"}:{}},l.createElement(St,{location:p})),l.createElement(o.Switch,null,l.createElement(t.PrivateRoute,{path:v+"/inbox/application-overview/:id",component:f}),l.createElement(t.PrivateRoute,{path:v+"/search/application-overview/:id",component:f}),l.createElement(t.PrivateRoute,{path:v+"/new-application",component:g}),l.createElement(t.PrivateRoute,{path:v+"/inbox",component:e=>l.createElement(E,d({},e,{parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/search",component:e=>l.createElement(ht,d({},e,{parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/response/:id",component:_t})))};function At(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 yt=e=>l.createElement("h1",{className:"heading-m"},e.label),Ct=()=>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"})),Dt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ct,null)),Tt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:h}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,S]=n.useState({}),[b,A]=n.useState({}),[y,C]=n.useState([]),[D,T]=n.useState(null),[N,O]=n.useState(null),[L,I]=n.useState(null),[w,x]=n.useState(null),[P,R]=n.useState([]),[F,B]=n.useState(null),[M,U]=n.useState(!1);function k(e){O(e.target.files[0])}return n.useEffect(()=>{var e;h&&h["egf-master"]&&R(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]),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{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,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?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[N]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:o,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+o.action+"_APPLICATION",submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:F,setSelectedFinancialYear:B}):(e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:m,businessService:v}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(m||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:D,setSelectedApprover:T,selectFile:k,uploadedFile:L,setUploadedFile:I,businessService:v}))},[r,y,P,F,L]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yt,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Dt,{onClick:s}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:E||(null==r?void 0:r.docUploadRequired)&&!L,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.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"};m.creationReason="STATUS",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:d({},m,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==m?void 0:m.propertyId,tenantId:u,source:null==m?void 0:m.source,channel:null==m?void 0:m.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],L&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:L}]),c({Property:d({},m,{workflow:t})})}},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},Nt=e=>l.createElement("h1",{className:"heading-m"},e.label),Ot=()=>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"})),Lt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ot,null)),It=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,h]=n.useState({}),[_,S]=n.useState({}),[b,A]=n.useState([]),[y,C]=n.useState({}),[D,T]=n.useState(null),[N,O]=n.useState(null),[L,I]=n.useState(null),[w,x]=n.useState([]),[P,R]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&x(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:F}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){T(e.target.files[0])}return n.useEffect(()=>{if(p&&F){var e;const t=F["common-masters"].Department;A(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,o;const i=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)===i);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.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=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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&&h((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_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:i,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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:y,setSelectedApprover:C,selectFile:B,uploadedFile:N,setUploadedFile:O,businessService:v}))},[r,b,w,P,N]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Nt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(Lt,{onClick:s}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=d({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:N}]:null}),c({Licenses:[m]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},wt=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"})),Pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xt,null)),Rt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[A,y]=n.useState({}),[C,D]=n.useState(null),[T,N]=n.useState(null),[O,L]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{L(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=At(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,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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&&g((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==o?void 0:o.action)&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_BPAREG_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:i,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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:a,action:r,approvers:S,selectedApprover:A,setSelectedApprover:y,selectFile:w,uploadedFile:T,setUploadedFile:N,businessService:v,error:O}))},[r,S,T,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wt,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Pt,{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){m=d({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null}),c({Licenses:[m]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Ft=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Bt=()=>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"})),Mt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bt,null)),Ut=e=>{var o,i,r,u,s,c,m,v,p,f,E,g;let{t:h,action:_,tenantId:S,closeModal:b,submitAction:A,applicationDetails:y,applicationData:C,businessService:D,workflowDetails:T,blockReason:N}=e;console.log("applicationData",C),console.log("workflowDetails",T),Digit.Hooks.obps.useObpsAPI(null!==(o=C)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(r=i.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:S,!1);const{data:O,isLoading:L}=Digit.Hooks.useEmployeeSearch(S,{roles:null==T||null===(m=T.data)||void 0===m||null===(v=m.initialActionState)||void 0===v||null===(p=v.nextActions)||void 0===p||null===(f=p.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[I,w]=(a.useQueryClient(),n.useState({})),[x,P]=n.useState({}),[R,F]=n.useState([]),[B,M]=n.useState([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,q]=n.useState(null),[K,X]=n.useState(null),$=!!Digit.Utils.browser.isMobile();function J(e){z(e.target.files[0])}n.useEffect(()=>{var e;F(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{q(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)q(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))q(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).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?G(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):q(h("CS_FILE_UPLOAD_ERROR"))})},function(){q(h("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 Q=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},Z=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=[],o=[];var i,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),o=o.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)=>{o.push({docs:Q(e.Documents),date:e.InspectionDate,questions:Z(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",o),o=o.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",o)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,o,i,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.values)||void 0===o?void 0:o.length)>0&&(n=[...n,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},ne=()=>{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==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&w((e=>{var n,o,i,a,r,u,s;let{t:c,action:d,approvers:m,selectedApprover:v,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:g,uploadedFile:h,setUploadedFile:_,assigneeLabel:S,businessService:b,error:A,blockReasonFiltered:y}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:"WF_"+(null==d?void 0:d.action)+"_APPLICATION",submit:"WF_"+b+"_"+(null==d?void 0:d.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(o=d.state)||void 0===o?void 0:o.state)?null:c(S||"WF_ROLE_"+(null===(i=d.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:m,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:p,selected:v})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:y,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{_(null)},message:h?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:A})}]}]}})({t:h,action:_,approvers:R,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:B}))},[_,R,K,V,Y]),_&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ft,{label:h(I.label.heading)}),headerBarEnd:l.createElement(Mt,{onClick:b}),actionCancelLabel:h(I.label.cancel),actionCancelOnSubmit:b,actionSaveLabel:h(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:$?{width:"720px"}:{},style:$?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:$?{paddingLeft:"5px"}:{}},L?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,o,i,a,r,u,s,c,m,v,p,f,E,g,D,N,O,L,I,w,x,P,R,F,B;C=d({},C,{documents:te(),additionalDetails:d({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:ne(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(o=T.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==T||null===(u=T.data)||void 0===u||null===(s=u.processInstances)||void 0===s||null===(c=s[0])||void 0===c||null===(m=c.assigner)||void 0===m?void 0:m.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(v=T.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(f=p[0])||void 0===f||null===(E=f.state)||void 0===E?void 0:E.applicationStatus)?[null==T||null===(g=T.data)||void 0===g||null===(D=g.processInstances)||void 0===D||null===(N=D[0])||void 0===N||null===(O=N.assigner)||void 0===O?void 0:O.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(L=T.data)||void 0===L||null===(I=L.processInstances)||void 0===I||null===(w=I[0])||void 0===w||null===(x=w.state)||void 0===x?void 0:x.applicationStatus)?[null==T||null===(P=T.data)||void 0===P||null===(R=P.processInstances)||void 0===R||null===(F=R[0])||void 0===F||null===(B=F.assigner)||void 0===B?void 0:B.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null});const M=function(e,t,n,l,o,i,a,r,u,s,c,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||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===(l=C)||void 0===l||null===(o=l.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.BPA_LABOUR_CESS)+parseInt(null===(a=C)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(u=r.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(s=C)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(m=c.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS))){var v,p,f;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==y||null===(v=y.nocData)||void 0===v?void 0:v.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:d({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(p=e[0])||void 0===p||null===(f=p.Noc)||void 0===f?void 0:f.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var n;let l=!0,o=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,i,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.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!=l&&1!=o||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(o=!1))});let i=[];if(e&&e.map(e=>{var t,n,a,r,u,s,c,d,m,v,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.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===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(m=e.Noc)||void 0===m||null===(v=m.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&o)&&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?A({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(b(),alert(h("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else A({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}b(),alert(h("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:x,formId:"modal-action"})):l.createElement(t.Loader,null)},kt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Wt=()=>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"})),Ht=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Wt,null)),jt=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:m,submitAction:v,applicationData:p,businessService:f}=e;const{data:E,isLoading:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[h,_]=(a.useQueryClient(),n.useState({})),[S,b]=n.useState({}),[A,y]=n.useState([]),[C,D]=n.useState({}),[T,N]=n.useState(null),[O,L]=n.useState(null),[I,w]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function P(e){N(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;y(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(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).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?L(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[T]),n.useEffect(()=>{s&&_((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:m,businessService:v,error:p}=e,f=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(f=!0);let E=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(m||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:s,approvers:A,selectedApprover:C,setSelectedApprover:D,selectFile:P,uploadedFile:O,setUploadedFile:L,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,A,O,I]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(kt,{label:u(h.label.heading)}),headerBarEnd:l.createElement(Ht,{onClick:m}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:x?{width:"720px"}:{},style:x?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:x?{paddingLeft:"5px"}:{}},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(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]:[];o.map((e,t)=>{i.push(e)}),p=d({},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==T?void 0:T.name,fileStoreId:O}]:null},documents:i}),v({Noc:p},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},zt=e=>l.createElement("h1",{className:"heading-m"},e.label),Vt=()=>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"})),Gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Vt,null)),Yt=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}},qt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[A,y]=n.useState({}),[C,D]=n.useState(null),[T,N]=n.useState(null),[O,L]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{L(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).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?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(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,o,i;"DisconnectWSConnection"==(null===(e=m)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=m)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:m,businessService:v,error:p}=e,f=!0,E=!1;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(f=!1),i.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?o("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:o("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,d({onChange:e.onChange,date:e.value},n))}:null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{m(null)},message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:A,setSelectedApprover:y,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:v,error:O})):r&&g((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:m,error:v}=e,p=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:A,setSelectedApprover:y,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:v,error:O}))},[r,S,T,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zt,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Gt,{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,o,i,a,s,v,p,f;if(null!==(t=m)&&void 0!==t&&t.isBillAmend){var E,g,h,_,S,b,y,D,N;const t=d({},null===(E=m)||void 0===E||null===(g=E.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=d({},null===(h=m)||void 0===h?void 0:h.billAmendmentDetails,{workflow:{businessId:null===(_=m)||void 0===_||null===(S=_.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(b=m)&&void 0!==b&&null!==(y=b.applicationType)&&void 0!==y&&y.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=m)&&void 0!==D&&null!==(N=D.applicationType)&&void 0!==N&&N.includes("WATER")?"WS":"SW",assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]}});c({AmendmentUpdate:n})}else{if(m=d({},m,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:[],assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null,processInstance:d({},null===(n=m)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]})}),null!=e&&e.date&&null!==(l=m)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=gt(null==e?void 0:e.date);m.disconnectionExecutionDate=Yt(t)}else if(null!=e&&e.date){const t=gt(null==e?void 0:e.date);m.connectionExecutionDate=Yt(t)}var O;if("DisconnectWSConnection"==(null===(i=m)||void 0===i||null===(a=i.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=m)||void 0===s||null===(v=s.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=m)||void 0===O?void 0:O.serviceType)?c({WaterConnection:m,disconnectRequest:!0}):c({SewerageConnection:m,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=m)||void 0===p?void 0:p.applicationType))c({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=m)||void 0===f?void 0:f.applicationType))c({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!0});else{var L,I,w,x,P,R,F,B,M,U,k,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenalty&&(m.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&&(m.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenaltyReason&&(m.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebate&&(m.additionalDetails.adhocRebate=parseInt(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(m.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&&(m.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=m)||void 0===H?void 0:H.serviceType)?c({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Kt=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"})),$t=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xt,null)),Jt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[A,y]=n.useState(null),[C,D]=n.useState(null),[T,N]=n.useState(null),[O,L]=n.useState(null),[I,w]=n.useState(!1);function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,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?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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&&g((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:S,selectedApprover:A,setSelectedApprover:y,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:v}))},[r,S,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Kt,{label:a(E.label.heading)}),headerBarEnd:l.createElement($t,{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"};m.creationReason="CREATE",c({PetRegistrationApplications:[d({},m,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!A?[]:[A],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),c({PetRegistrationApplications:[d({},m,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Qt=e=>l.createElement("h1",{className:"heading-m"},e.label),Zt=()=>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(Zt,null)),tn=e=>{var o,i,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=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===(o=f.TradeLicense)||void 0===o?void 0:o.TradeType),console.log("applicationData",m);const[g,h]=n.useState({}),[_,S]=n.useState({}),[b,A]=n.useState([]),[y,C]=n.useState(""),[D,T]=n.useState([]),[N,O]=n.useState(null),L=null===(i=m)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",L);const I=n.useMemo(()=>{var e;if(E||!f||!L.length)return[];const t=new Set(L.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,L]);return console.log("years",I),n.useEffect(()=>{u&&h((e=>{let{t:n,action:o,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:y,setSelectedApprover:C,businessService:v}))},[u,I,D,N]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qt,{label:r(g.label.heading)}),headerBarEnd:l.createElement(en,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=m)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],o="20"+Number(l)+"-"+(Number(l)+1);m=d({},m,{financialYear:o,action:"INITIATE",additionalDetail:d({},m.additionalDetail,{validityYears:y.length>0?parseInt(y):""})}),c({Licenses:[m]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},nn=e=>l.createElement("h1",{className:"heading-m"},e.label),ln=()=>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"})),on=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ln,null)),an=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[A,y]=n.useState(null),[C,D]=n.useState(null),[T,N]=n.useState(null),[O,L]=n.useState(null),[I,w]=n.useState(!1);function x(e){w(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).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?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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,m),n.useEffect(()=>{g((e=>{let{t:n,action:o,selectFile:i,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:s,setSelectedApprover:c,isUploading:d}=e;const m=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:c,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(m,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:A,setSelectedApprover:y,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:v,isUploading:I}))},[r,S,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(nn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(on,{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:v,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==m||null===(t=m.auditDetails)||void 0===t?void 0:t.createdBy]:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null};T&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),c({streetVendingDetail:d({},m,{workflow:n})})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},rn=e=>l.createElement("h1",{className:"heading-m"},e.label),un=()=>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"})),sn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(un,null)),cn=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[A,y]=n.useState(null),[C,D]=n.useState(null),[T,N]=n.useState(null),[O,L]=n.useState(null),[I,w]=n.useState(!1);function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,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?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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&&g((e=>{let{t:n,action:o,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.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")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,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:S,selectedApprover:A,setSelectedApprover:y,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:v}))},[r,S,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(rn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(sn,{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:v,moduleName:p};T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:T}]),c({hallsBookingApplication:[d({},m,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},dn=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"})),vn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mn,null)),pn=e=>{var i,a,r;let{t:u,action:s,tenantId:c,closeModal:m,submitAction:v,applicationData:p,businessService:f,moduleCode:E}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.roles)||void 0===i||null===(a=i[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)}),h=o.useHistory(),[_,S]=n.useState({}),[b,A]=n.useState({}),[y,C]=n.useState([]),[D,T]=n.useState(null),[N,O]=n.useState(null);return n.useEffect(()=>{var e;C(null==g||null===(e=g.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}}))},[g]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?h.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):S((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:y,selectedApprover:D,setSelectedApprover:T,uploadedFile:N,setUploadedFile:O,businessService:f}))},[s,y,N]),s&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dn,{label:u(_.label.heading)}),headerBarEnd:l.createElement(vn,{onClick:m}),actionCancelLabel:u(_.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:_.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};N&&(t.documents=[]),v({Asset:d({},p,{workflow:t})})},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},fn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Tt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Jt,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(It,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(tn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Rt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Ut,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(jt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(qt,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(an,e):null!=e&&e.businessService.includes("chb")?l.createElement(cn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(pn,e):void 0;var En=y(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",h="[object Symbol]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",T="[object Int16Array]",N="[object Int32Array]",O="[object Uint8Array]",L="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,B=RegExp(R.source),M=RegExp(F.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+/,q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,Z=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^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,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\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",me="["+de+"]",ve="["+ce+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ae="(?:"+fe+"|"+Ee+")",ye="(?:"+be+"|"+Ee+")",Ce="(?:"+ve+"|"+ge+")?",De="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[he,_e,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Te="(?:"+["[\\u2700-\\u27bf]",_e,Se].join("|")+")"+De,Ne="(?:"+[he+ve+"?",ve,_e,Se,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),Le=RegExp(ve,"g"),Ie=RegExp(ge+"(?="+ge+")|"+Ne+De,"g"),we=RegExp([be+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,be,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,be+Ae,"$"].join("|")+")",be+"?"+Ae+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?: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,Te].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\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 ]/,Re=["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"],Fe=-1,Be={};Be[y]=Be[C]=Be[D]=Be[T]=Be[N]=Be[O]=Be["[object Uint8ClampedArray]"]=Be[L]=Be[I]=!0,Be[i]=Be[a]=Be[S]=Be[r]=Be[b]=Be[u]=Be[s]=Be[c]=Be[m]=Be[v]=Be[p]=Be[f]=Be[E]=Be[g]=Be[_]=!1;var Me={};Me[i]=Me[a]=Me[S]=Me[b]=Me[r]=Me[u]=Me[y]=Me[C]=Me[D]=Me[T]=Me[N]=Me[m]=Me[v]=Me[p]=Me[f]=Me[E]=Me[g]=Me[h]=Me[O]=Me["[object Uint8ClampedArray]"]=Me[L]=Me[I]=!0,Me[s]=Me[c]=Me[_]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof A&&A&&A.Object===Object&&A,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,qe=Ye&&He.process,Ke=function(){try{return Ge&&Ge.require&&Ge.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,$e=Ke&&Ke.isDate,Je=Ke&&Ke.isMap,Qe=Ke&&Ke.isRegExp,Ze=Ke&&Ke.isSet,et=Ke&&Ke.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 o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];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 ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(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,o=0,i=[];++n<l;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,n){for(var l=-1,o=null==e?0:e.length;++l<o;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e}function dt(e,t,n,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function mt(e,t,n,l){var o=null==e?0:e.length;for(l&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function vt(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=bt("length");function ft(e,t,n){var l;return n(e,function(e,n,o){if(t(e,n,o))return l=n,!1}),l}function Et(e,t,n,l){for(var o=e.length,i=n+(l?1:-1);l?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,o=e.length;++l<o;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,_t,n)}function ht(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function _t(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function At(e){return function(t){return null==e?void 0:e[t]}}function yt(e,t,n,l,o){return o(e,function(e,o,i){n=l?(l=!1,e):t(n,e,o,i)}),n}function Ct(e,t){for(var n,l=-1,o=e.length;++l<o;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Dt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Tt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Nt(e){return function(t){return e(t)}}function Ot(e,t){return st(t,function(t){return e[t]})}function Lt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&>(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=At({"À":"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"}),Rt=At({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Ue[e]}function Bt(e){return xe.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,o=e.length,i=0,a=[];++n<o;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[i++]=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 Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Gt=At({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var A=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,ge=A.prototype,he=ve.prototype,_e=t["__core-js_shared__"],Se=de.prototype.toString,be=he.hasOwnProperty,Ae=0,ye=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=he.toString,De=Se.call(ve),Te=ze._,Ne=pe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,xe=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(ve.getPrototypeOf,ve),Ve=ve.create,Ge=he.propertyIsEnumerable,qe=ge.splice,Ke=xe?xe.isConcatSpreadable:void 0,pt=xe?xe.iterator:void 0,At=xe?xe.toStringTag:void 0,qt=function(){try{var e=Qo(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=q&&q.now!==ze.Date.now&&q.now,$t=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=me.ceil,Qt=me.floor,Zt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ut(ve.keys,ve),on=me.max,an=me.min,rn=q.now,un=t.parseInt,sn=me.random,cn=ge.reverse,dn=Qo(t,"DataView"),mn=Qo(t,"Map"),vn=Qo(t,"Promise"),pn=Qo(t,"Set"),fn=Qo(t,"WeakMap"),En=Qo(ve,"create"),gn=fn&&new fn,hn={},_n=Ni(dn),Sn=Ni(mn),bn=Ni(vn),An=Ni(pn),yn=Ni(fn),Cn=xe?xe.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Tn=Cn?Cn.toString:void 0;function Nn(e){if(Va(e)&&!Pa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(be.call(e,"__wrapped__"))return Oi(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 Ln(){}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 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 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 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 Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=Pa(e),l=!n&&xa(e),o=!n&&!l&&Ma(e),i=!n&&!l&&!o&&Qa(e),a=n||l||o||i,r=a?Dt(e.length,fe):[],u=r.length;for(var s in e)!t&&!be.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ii(s,u))||r.push(s);return r}function Un(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function kn(e,t){return Ai(Eo(e),Kn(t,0,e.length))}function Wn(e){return Ai(Eo(e))}function Hn(e,t,n){(void 0!==n&&!La(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];be.call(e,t)&&La(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(La(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Zn(e,function(e,o,i){t(l,e,n(e),i)}),l}function Gn(e,t){return e&&go(t,Sr(t),e)}function Yn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=A(l),i=null==e;++n<l;)o[n]=i?void 0:fr(e,t[n]);return o}function Kn(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,o,a){var s,_=1&t,A=2&t,w=4&t;if(n&&(s=o?n(e,l,o,a):n(e)),void 0!==s)return s;if(!za(e))return e;var x=Pa(e);if(x){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!_)return Eo(e,s)}else{var P=ti(e),R=P==c||P==d;if(Ma(e))return so(e,_);if(P==p||P==i||R&&!o){if(s=A||R?{}:li(e),!_)return A?function(e,t){return go(e,ei(e),t)}(e,function(e,t){return e&&go(t,br(t),e)}(s,e)):function(e,t){return go(e,Zo(e),t)}(e,Gn(s,e))}else{if(!Me[P])return o?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case S:return co(e);case r:case u:return new l(+e);case b:return function(e,t){var n=t?co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case y:case C:case D:case T:case N:case O:case"[object Uint8ClampedArray]":case L:case I:return mo(e,n);case m:return new l;case v:case g: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 h:return Dn?ve(Dn.call(e)):{}}}(e,P,_)}}a||(a=new Bn);var F=a.get(e);if(F)return F;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,o){s.set(o,Xn(l,t,n,o,e,a))});var B=x?void 0:(w?A?Go:Vo:A?br:Sr)(e);return lt(B||e,function(l,o){B&&(l=e[o=l]),jn(s,o,Xn(l,t,n,o,e,a))}),s}function $n(e,t,n){var l=n.length;if(null==e)return!l;for(e=ve(e);l--;){var o=n[l],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new Ee(n);return hi(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var o=-1,i=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,Nt(n))),l?(i=ut,a=!1):t.length>=200&&(i=Lt,a=!1,t=new Fn(t));e:for(;++o<r;){var c=e[o],d=null==n?c:n(c);if(c=l||0!==c?c:0,a&&d==d){for(var m=s;m--;)if(t[m]===d)continue e;u.push(c)}else i(t,d,l)||u.push(c)}return u}Nn.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:Nn}},(Nn.prototype=Ln.prototype).constructor=Nn,(In.prototype=On(Ln.prototype)).constructor=In,(wn.prototype=On(Ln.prototype)).constructor=wn,xn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:be.call(t,e)},xn.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():qe.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},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(mn||Pn),string:new xn}},Rn.prototype.delete=function(e){var t=$o(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return $o(this,e).get(e)},Rn.prototype.has=function(e){return $o(this,e).has(e)},Rn.prototype.set=function(e,t){var n=$o(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pn){var l=n.__data__;if(!mn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(l)}return n.set(e,t),this.size=n.size,this};var Zn=So(rl),el=So(ul,!0);function tl(e,t){var n=!0;return Zn(e,function(e,l,o){return n=!!t(e,l,o)}),n}function nl(e,t,n){for(var l=-1,o=e.length;++l<o;){var i=e[l],a=t(i);if(null!=a&&(void 0===r?a==a&&!Ja(a):n(a,r)))var r=a,u=i}return u}function ll(e,t){var n=[];return Zn(e,function(e,l,o){t(e,l,o)&&n.push(e)}),n}function ol(e,t,n,l,o){var i=-1,a=e.length;for(n||(n=oi),o||(o=[]);++i<a;){var r=e[i];t>0&&n(r)?t>1?ol(r,t-1,n,l,o):ct(o,r):l||(o[o.length]=r)}return o}var il=bo(),al=bo(!0);function rl(e,t){return e&&il(e,t,Sr)}function ul(e,t){return e&&al(e,t,Sr)}function sl(e,t){return at(t,function(t){return Wa(e[t])})}function cl(e,t){for(var n=0,l=(t=io(t,e)).length;null!=e&&n<l;)e=e[Ti(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return Pa(e)?l:ct(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":At&&At in ve(e)?function(e){var t=be.call(e,At),n=e[At];try{e[At]=void 0;var l=!0}catch(e){}var o=Ce.call(e);return l&&(t?e[At]=n:delete e[At]),o}(e):function(e){return Ce.call(e)}(e)}function vl(e,t){return e>t}function pl(e,t){return null!=e&&be.call(e,t)}function fl(e,t){return null!=e&&t in ve(e)}function El(e,t,n){for(var l=n?ut:rt,o=e[0].length,i=e.length,a=i,r=A(i),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,Nt(t))),u=an(c.length,u),r[a]=!n&&(t||o>=120&&c.length>=120)?new Fn(a&&c):void 0}c=e[0];var d=-1,m=r[0];e:for(;++d<o&&s.length<u;){var v=c[d],p=t?t(v):v;if(v=n||0!==v?v:0,!(m?Lt(m,p):l(s,p,n))){for(a=i;--a;){var f=r[a];if(!(f?Lt(f,p):l(e[a],p,n)))continue e}m&&m.push(p),s.push(v)}}return s}function gl(e,t,n){var l=null==(e=pi(e,t=io(t,e)))?e:e[Ti(ki(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Va(e)&&ml(e)==i}function _l(e,t,n,l,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,o,c){var d=Pa(e),_=Pa(t),A=d?a:ti(e),y=_?a:ti(t),C=(A=A==i?p:A)==p,D=(y=y==i?p:y)==p,T=A==y;if(T&&Ma(e)){if(!Ma(t))return!1;d=!0,C=!1}if(T&&!C)return c||(c=new Bn),d||Qa(e)?jo(e,t,n,l,o,c):function(e,t,n,l,o,i,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new Ue(e),new Ue(t)));case r:case u:case v:return La(+e,+t);case s:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case m:var c=Mt;case E:if(c||(c=Wt),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var p=jo(c(e),c(t),l,o,i,a);return a.delete(e),p;case h:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,A,n,l,o,c);if(!(1&n)){var N=C&&be.call(e,"__wrapped__"),O=D&&be.call(t,"__wrapped__");if(N||O){var L=N?e.value():e,I=O?t.value():t;return c||(c=new Bn),o(L,I,n,l,c)}}return!!T&&(c||(c=new Bn),function(e,t,n,l,o,i){var a=1&n,r=Vo(e),u=r.length;if(u!=Vo(t).length&&!a)return!1;for(var s=u;s--;){var c=r[s];if(!(a?c in t:be.call(t,c)))return!1}var d=i.get(e),m=i.get(t);if(d&&m)return d==t&&m==e;var v=!0;i.set(e,t),i.set(t,e);for(var p=a;++s<u;){var f=e[c=r[s]],E=t[c];if(l)var g=a?l(E,f,c,t,e,i):l(f,E,c,e,t,i);if(!(void 0===g?f===E||o(f,E,n,l,i):g)){v=!1;break}p||(p="constructor"==c)}if(v&&!p){var h=e.constructor,_=t.constructor;h==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof _&&_ instanceof _||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,n,l,o,c))}(e,t,n,l,_l,o))}function Sl(e,t,n,l){var o=n.length,i=o,a=!l;if(null==e)return!i;for(e=ve(e);o--;){var r=n[o];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){var u=(r=n[o])[0],s=e[u],c=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Bn;if(l)var m=l(s,c,u,e,t,d);if(!(void 0===m?_l(c,s,3,l,d):m))return!1}}return!0}function bl(e){return!(!za(e)||(t=e,ye&&ye in t))&&(Wa(e)?Ne:oe).test(Ni(e));var t}function Al(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Nl(e[0],e[1]):Tl(e):tu(e)}function yl(e){if(!ci(e))return ln(e);var t=[];for(var n in ve(e))be.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=Fa(e)?A(e.length):[];return Zn(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Tl(e){var t=Jo(e);return 1==t.length&&t[0][2]?mi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Nl(e,t){return ri(e)&&di(t)?mi(Ti(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):_l(t,l,3)}}function Ol(e,t,n,l,o){e!==t&&il(t,function(i,a){if(o||(o=new Bn),za(i))!function(e,t,n,l,o,i,a){var r=Ei(e,n),u=Ei(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var c=i?i(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var m=Pa(u),v=!m&&Ma(u),p=!m&&!v&&Qa(u);c=u,m||v||p?Pa(r)?c=r:Ba(r)?c=Eo(r):v?(d=!1,c=so(u,!0)):p?(d=!1,c=mo(u,!0)):c=[]:qa(u)||xa(u)?(c=r,xa(r)?c=ar(r):za(r)&&!Wa(r)||(c=li(u))):d=!1}d&&(a.set(u,c),o(c,u,l,i,a),a.delete(u)),Hn(e,n,c)}}(e,t,a,n,Ol,l,o);else{var r=l?l(Ei(e,a),i,a+"",e,t,o):void 0;void 0===r&&(r=i),Hn(e,a,r)}},br)}function Ll(e,t){var n=e.length;if(n)return ii(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 cl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=st(t,Nt(Xo())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,o=e.criteria,i=t.criteria,a=o.length,r=n.length;++l<a;){var u=vo(o[l],i[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,o){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,o=t.length,i={};++l<o;){var a=t[l],r=cl(e,a);n(r,a)&&kl(i,io(a,e),r)}return i}function xl(e,t,n,l){var o=l?ht:gt,i=-1,a=t.length,r=e;for(e===t&&(t=Eo(t)),n&&(r=st(e,Nt(n)));++i<a;)for(var u=0,s=t[i],c=n?n(s):s;(u=o(r,c,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var o=t[n];if(n==l||o!==i){var i=o;ii(o)?qe.call(e,o,1):Jl(e,o)}}return e}function Rl(e,t){return e+Qt(sn()*(t-e+1))}function Fl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Bl(e,t){return _i(vi(e,t,Yr),e+"")}function Ml(e){return Un(Lr(e))}function Ul(e,t){var n=Lr(e);return Ai(n,Kn(t,0,n.length))}function kl(e,t,n,l){if(!za(e))return e;for(var o=-1,i=(t=io(t,e)).length,a=i-1,r=e;null!=r&&++o<i;){var u=Ti(t[o]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var c=r[u];void 0===(s=l?l(c,u,r):void 0)&&(s=za(c)?c:ii(t[o+1])?[]:{})}jn(r,u,s),r=r[u]}return e}var Wl=gn?function(e,t){return gn.set(e,t),e}:Yr,Hl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return Ai(Lr(e))}function zl(e,t,n){var l=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=A(o);++l<o;)i[l]=e[l+t];return i}function Vl(e,t){var n;return Zn(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Gl(e,t,n){var l=0,o=null==e?l:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;l<o;){var i=l+o>>>1,a=e[i];null!==a&&!Ja(a)&&(n?a<=t:a<t)?l=i+1:o=i}return o}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Ja(t),s=void 0===t;o<i;){var c=Qt((o+i)/2),d=n(e[c]),m=void 0!==d,v=null===d,p=d==d,f=Ja(d);if(a)var E=l||p;else E=s?p&&(l||m):r?p&&m&&(l||!v):u?p&&m&&!v&&(l||!f):!v&&!f&&(l?d<=t:d<t);E?o=c+1:i=c}return an(i,4294967294)}function ql(e,t){for(var n=-1,l=e.length,o=0,i=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!La(r,u)){var u=r;i[o++]=0===a?0:a}}return i}function Kl(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Pa(e))return st(e,Xl)+"";if(Ja(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $l(e,t,n){var l=-1,o=rt,i=e.length,a=!0,r=[],u=r;if(n)a=!1,o=ut;else if(i>=200){var s=t?null:Bo(e);if(s)return Wt(s);a=!1,o=Lt,u=new Fn}else u=t?[]:r;e:for(;++l<i;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var m=u.length;m--;)if(u[m]===d)continue e;t&&u.push(d),r.push(c)}else o(u,d,n)||(u!==r&&u.push(d),r.push(c))}return r}function Jl(e,t){return null==(e=pi(e,t=io(t,e)))||delete e[Ti(ki(t))]}function Ql(e,t,n,l){return kl(e,t,n(cl(e,t)),l)}function Zl(e,t,n,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&t(e[i],i,e););return n?zl(e,l?0:i,l?i+1:o):zl(e,l?i+1:0,l?o:i)}function eo(e,t){var n=e;return n instanceof wn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function to(e,t,n){var l=e.length;if(l<2)return l?$l(e[0]):[];for(var o=-1,i=A(l);++o<l;)for(var a=e[o],r=-1;++r<l;)r!=o&&(i[o]=Qn(i[o]||a,e[r],t,n));return $l(ol(i,1),t,n)}function no(e,t,n){for(var l=-1,o=e.length,i=t.length,a={};++l<o;)n(a,e[l],l<i?t[l]:void 0);return a}function lo(e){return Ba(e)?e:[]}function oo(e){return"function"==typeof e?e:Yr}function io(e,t){return Pa(e)?e:ri(e,t)?[e]:Di(rr(e))}var ao=Bl;function ro(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var uo=Kt||function(e){return ze.clearTimeout(e)};function so(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 co(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function mo(e,t){var n=t?co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var n=void 0!==e,l=null===e,o=e==e,i=Ja(e),a=void 0!==t,r=null===t,u=t==t,s=Ja(t);if(!r&&!s&&!i&&e>t||i&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!o)return 1;if(!l&&!i&&!s&&e<t||s&&n&&o&&!l&&!i||r&&n&&o||!a&&o||!u)return-1}return 0}function po(e,t,n,l){for(var o=-1,i=e.length,a=n.length,r=-1,u=t.length,s=on(i-a,0),c=A(u+s),d=!l;++r<u;)c[r]=t[r];for(;++o<a;)(d||o<i)&&(c[n[o]]=e[o]);for(;s--;)c[r++]=e[o++];return c}function fo(e,t,n,l){for(var o=-1,i=e.length,a=-1,r=n.length,u=-1,s=t.length,c=on(i-r,0),d=A(c+s),m=!l;++o<c;)d[o]=e[o];for(var v=o;++u<s;)d[v+u]=t[u];for(;++a<r;)(m||o<i)&&(d[v+n[a]]=e[o++]);return d}function Eo(e,t){var n=-1,l=e.length;for(t||(t=A(l));++n<l;)t[n]=e[n];return t}function go(e,t,n,l){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),o?Yn(n,r,u):jn(n,r,u)}return n}function ho(e,t){return function(n,l){var o=Pa(n)?nt:Vn,i=t?t():{};return o(n,e,Xo(l,2),i)}}function _o(e){return Bl(function(t,n){var l=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ai(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=ve(t);++l<o;){var r=n[l];r&&e(t,r,l,i)}return t})}function So(e,t){return function(n,l){if(null==n)return n;if(!Fa(n))return e(n,l);for(var o=n.length,i=t?o:-1,a=ve(n);(t?i--:++i<o)&&!1!==l(a[i],i,a););return n}}function bo(e){return function(t,n,l){for(var o=-1,i=ve(t),a=l(t),r=a.length;r--;){var u=a[e?r:++o];if(!1===n(i[u],u,i))break}return t}}function Ao(e){return function(t){var n=Bt(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),o=n?ro(n,1).join(""):t.slice(1);return l[e]()+o}}function yo(e){return function(t){return dt(Wr(xr(t).replace(Oe,"")),e,"")}}function Co(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 Do(e){return function(t,n,l){var o=ve(t);if(!Fa(t)){var i=Xo(n,3);t=Sr(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,l);return a>-1?o[i?t[a]:a]:void 0}}function To(e){return zo(function(t){var l=t.length,o=l,i=In.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Ee(n);if(i&&!r&&"wrapper"==qo(a))var r=new In([],!0)}for(o=r?o:l;++o<l;){var u=qo(a=t[o]),s="wrapper"==u?Yo(a):void 0;r=s&&ui(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[qo(s[0])].apply(r,s[3]):1==a.length&&ui(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 o=0,i=l?t[o].apply(this,e):n;++o<l;)i=t[o].call(this,i);return i}})}function No(e,t,n,l,o,i,a,r,u,s){var c=128&t,d=1&t,m=2&t,v=24&t,p=512&t,f=m?void 0:Co(e);return function E(){for(var g=arguments.length,h=A(g),_=g;_--;)h[_]=arguments[_];if(v)var S=Ko(E),b=xt(h,S);if(l&&(h=po(h,l,o,v)),i&&(h=fo(h,i,a,v)),g-=b,v&&g<s){var y=kt(h,S);return Ro(e,t,No,E.placeholder,n,h,y,r,u,s-g)}var C=d?n:this,D=m?C[e]:e;return g=h.length,r?h=fi(h,r):p&&g>1&&h.reverse(),c&&u<g&&(h.length=u),this&&this!==ze&&this instanceof E&&(D=f||Co(D)),D.apply(C,h)}}function Oo(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,o,i){t(l,n(e),o,i)}),l}(n,e,t(l),{})}}function Lo(e,t){return function(n,l){var o;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(o=n),void 0!==l){if(void 0===o)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Kl(n),l=Kl(l)),o=e(n,l)}return o}}function Io(e){return zo(function(t){return t=st(t,Nt(Xo())),Bl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wo(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Jt(e/jt(t)));return Bt(t)?ro(zt(l),0,e).join(""):l.slice(0,e)}function xo(e){return function(t,n,l){return l&&"number"!=typeof l&&ai(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 o=-1,i=on(Jt((t-e)/(n||1)),0),a=A(i);i--;)a[l?i:++o]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Po(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ir(t),n=ir(n)),e(t,n)}}function Ro(e,t,n,l,o,i,a,r,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,r,u,s],m=n.apply(void 0,d);return ui(e)&&gi(m,d),m.placeholder=l,Si(m,e,t)}function Fo(e){var t=me[e];return function(e,n){if(e=ir(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 Bo=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Jr;function Mo(e){return function(t){var n=ti(t);return n==m?Mt(t):n==E?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Uo(e,t,o,i,a,r,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new Ee(n);var d=i?i.length:0;if(d||(t&=-97,i=a=void 0),u=void 0===u?u:on(lr(u),0),s=void 0===s?s:lr(s),d-=a?a.length:0,64&t){var m=i,v=a;i=a=void 0}var p=c?void 0:Yo(e),f=[e,t,o,i,a,m,v,r,u,s];if(p&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?po(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fo(r,a,t[6]):a,e[6]=r?kt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&o&&(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]=i}(f,p),e=f[0],t=f[1],o=f[2],i=f[3],a=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:on(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Co(e);return function o(){for(var i=arguments.length,a=A(i),r=i,u=Ko(o);r--;)a[r]=arguments[r];var s=i<3&&a[0]!==u&&a[i-1]!==u?[]:kt(a,u);if((i-=s.length)<n)return Ro(e,t,No,o.placeholder,void 0,a,s,void 0,void 0,n-i);var c=this&&this!==ze&&this instanceof o?l:e;return tt(c,this,a)}}(e,t,s):32!=t&&33!=t||a.length?No.apply(void 0,f):function(e,t,n,l){var o=1&t,i=Co(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=A(s+r),d=this&&this!==ze&&this instanceof t?i:e;++u<s;)c[u]=l[u];for(;r--;)c[u++]=arguments[++a];return tt(d,o?n:this,c)}}(e,t,o,i);else var E=function(e,t,n){var l=1&t,o=Co(e);return function t(){var i=this&&this!==ze&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((p?Wl:gi)(E,f),e,t)}function ko(e,t,n,l){return void 0===e||La(e,he[n])&&!be.call(l,n)?t:e}function Wo(e,t,n,l,o,i){return za(e)&&za(t)&&(i.set(t,e),Ol(e,t,void 0,Wo,i),i.delete(t)),e}function Ho(e){return qa(e)?void 0:e}function jo(e,t,n,l,o,i){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var d=-1,m=!0,v=2&n?new Fn:void 0;for(i.set(e,t),i.set(t,e);++d<r;){var p=e[d],f=t[d];if(l)var E=a?l(f,p,d,t,e,i):l(p,f,d,e,t,i);if(void 0!==E){if(E)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Lt(v,t)&&(p===e||o(p,e,n,l,i)))return v.push(t)})){m=!1;break}}else if(p!==f&&!o(p,f,n,l,i)){m=!1;break}}return i.delete(e),i.delete(t),m}function zo(e){return _i(vi(e,void 0,Ri),e+"")}function Vo(e){return dl(e,Sr,Zo)}function Go(e){return dl(e,br,ei)}var Yo=gn?function(e){return gn.get(e)}:Jr;function qo(e){for(var t=e.name+"",n=hn[t],l=be.call(hn,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Ko(e){return(be.call(Nn,"placeholder")?Nn:e).placeholder}function Xo(){var e=Nn.iteratee||qr;return e=e===qr?Al:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(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 Jo(e){for(var t=Sr(e),n=t.length;n--;){var l=t[n],o=e[l];t[n]=[l,o,di(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Zo=Zt?function(e){return null==e?[]:(e=ve(e),at(Zt(e),function(t){return Ge.call(e,t)}))}:ou,ei=Zt?function(e){for(var t=[];e;)ct(t,Zo(e)),e=je(e);return t}:ou,ti=ml;function ni(e,t,n){for(var l=-1,o=(t=io(t,e)).length,i=!1;++l<o;){var a=Ti(t[l]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&ja(o)&&ii(a,o)&&(Pa(e)||xa(e))}function li(e){return"function"!=typeof e.constructor||ci(e)?{}:On(je(e))}function oi(e){return Pa(e)||xa(e)||!!(Ke&&e&&e[Ke])}function ii(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 ai(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Fa(n)&&ii(t,n.length):"string"==l&&t in n)&&La(n[t],e)}function ri(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 ve(t)}function ui(e){var t=qo(e),n=Nn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Yo(n);return!!l&&e===l[0]}(dn&&ti(new dn(new ArrayBuffer(1)))!=b||mn&&ti(new mn)!=m||vn&&"[object Promise]"!=ti(vn.resolve())||pn&&ti(new pn)!=E||fn&&ti(new fn)!=_)&&(ti=function(e){var t=ml(e),n=t==p?e.constructor:void 0,l=n?Ni(n):"";if(l)switch(l){case _n:return b;case Sn:return m;case bn:return"[object Promise]";case An:return E;case yn:return _}return t});var si=_e?Wa:iu;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function di(e){return e==e&&!za(e)}function mi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function vi(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,o=-1,i=on(l.length-t,0),a=A(i);++o<i;)a[o]=l[t+o];o=-1;for(var r=A(t+1);++o<t;)r[o]=l[o];return r[t]=n(a),tt(e,this,r)}}function pi(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function fi(e,t){for(var n=e.length,l=an(t.length,n),o=Eo(e);l--;){var i=t[l];e[l]=ii(i,n)?o[i]:void 0}return e}function Ei(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var gi=bi(Wl),hi=$t||function(e,t){return ze.setTimeout(e,t)},_i=bi(Hl);function Si(e,t,n){var l=t+"";return _i(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(K,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(o,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($):[]}(l),n)))}function bi(e){var t=0,n=0;return function(){var l=rn(),o=16-(l-n);if(n=l,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ai(e,t){var n=-1,l=e.length,o=l-1;for(t=void 0===t?l:t;++n<t;){var i=Rl(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var yi,Ci,Di=(yi=ya(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,o){t.push(l?o.replace(Z,"$1"):n||e)}),t},function(e){return 500===Ci.size&&Ci.clear(),e}),Ci=yi.cache,yi);function Ti(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ni(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oi(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=Eo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Li=Bl(function(e,t){return Ba(e)?Qn(e,ol(t,1,Ba,!0)):[]}),Ii=Bl(function(e,t){var n=ki(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ol(t,1,Ba,!0),Xo(n,2)):[]}),wi=Bl(function(e,t){var n=ki(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ol(t,1,Ba,!0),void 0,n):[]});function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:lr(n);return o<0&&(o=on(l+o,0)),Et(e,Xo(t,3),o)}function Pi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==n&&(o=lr(n),o=n<0?on(l+o,0):an(o,l-1)),Et(e,Xo(t,3),o,!0)}function Ri(e){return null!=e&&e.length?ol(e,1):[]}function Fi(e){return e&&e.length?e[0]:void 0}var Bi=Bl(function(e){var t=st(e,lo);return t.length&&t[0]===e[0]?El(t):[]}),Mi=Bl(function(e){var t=ki(e),n=st(e,lo);return t===ki(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Xo(t,2)):[]}),Ui=Bl(function(e){var t=ki(e),n=st(e,lo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ki(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wi=Bl(Hi);function Hi(e,t){return e&&e.length&&t&&t.length?xl(e,t):e}var ji=zo(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Pl(e,st(t,function(e){return ii(e,n)?+e:e}).sort(vo)),l});function zi(e){return null==e?e:cn.call(e)}var Vi=Bl(function(e){return $l(ol(e,1,Ba,!0))}),Gi=Bl(function(e){var t=ki(e);return Ba(t)&&(t=void 0),$l(ol(e,1,Ba,!0),Xo(t,2))}),Yi=Bl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,$l(ol(e,1,Ba,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=on(e.length,t),!0}),Dt(t,function(t){return st(e,bt(t))})}function Ki(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xi=Bl(function(e,t){return Ba(e)?Qn(e,t):[]}),$i=Bl(function(e){return to(at(e,Ba))}),Ji=Bl(function(e){var t=ki(e);return Ba(t)&&(t=void 0),to(at(e,Ba),Xo(t,2))}),Qi=Bl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,to(at(e,Ba),void 0,t)}),Zi=Bl(qi),ea=Bl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ki(e,n)});function ta(e){var t=Nn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=zo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&ii(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),oa=ho(function(e,t,n){be.call(e,n)?++e[n]:Yn(e,n,1)}),ia=Do(xi),aa=Do(Pi);function ra(e,t){return(Pa(e)?lt:Zn)(e,Xo(t,3))}function ua(e,t){return(Pa(e)?ot:el)(e,Xo(t,3))}var sa=ho(function(e,t,n){be.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ca=Bl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fa(e)?A(e.length):[];return Zn(e,function(e){i[++l]=o?tt(t,e,n):gl(e,t,n)}),i}),da=ho(function(e,t,n){Yn(e,n,t)});function ma(e,t){return(Pa(e)?st:Dl)(e,Xo(t,3))}var va=ho(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Bl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,ol(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(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 ha=Bl(function(e,t,n){var l=1;if(n.length){var o=kt(n,Ko(ha));l|=32}return Uo(e,l,t,n,o)}),_a=Bl(function(e,t,n){var l=3;if(n.length){var o=kt(n,Ko(_a));l|=32}return Uo(t,l,e,n,o)});function Sa(e,t,l){var o,i,a,r,u,s,c=0,d=!1,m=!1,v=!0;if("function"!=typeof e)throw new Ee(n);function p(t){var n=o,l=i;return o=i=void 0,c=t,r=e.apply(l,n)}function f(e){return c=e,u=hi(g,t),d?p(e):r}function E(e){var n=e-s;return void 0===s||n>=t||n<0||m&&e-c>=a}function g(){var e=fa();if(E(e))return h(e);u=hi(g,function(e){var n=t-(e-s);return m?an(n,a-(e-c)):n}(e))}function h(e){return u=void 0,v&&o?p(e):(o=i=void 0,r)}function _(){var e=fa(),n=E(e);if(o=arguments,i=this,s=e,n){if(void 0===u)return f(s);if(m)return uo(u),u=hi(g,t),p(s)}return void 0===u&&(u=hi(g,t)),r}return t=ir(t)||0,za(l)&&(d=!!l.leading,a=(m="maxWait"in l)?on(ir(l.maxWait)||0,t):a,v="trailing"in l?!!l.trailing:v),_.cancel=function(){void 0!==u&&uo(u),c=0,o=s=i=u=void 0},_.flush=function(){return void 0===u?r:h(fa())},_}var ba=Bl(function(e,t){return Jn(e,1,t)}),Aa=Bl(function(e,t,n){return Jn(e,ir(t)||0,n)});function ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=l.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return l.cache=i.set(o,a)||i,a};return l.cache=new(ya.Cache||Rn),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)}}ya.Cache=Rn;var Da=ao(function(e,t){var n=(t=1==t.length&&Pa(t[0])?st(t[0],Nt(Xo())):st(ol(t,1),Nt(Xo()))).length;return Bl(function(l){for(var o=-1,i=an(l.length,n);++o<i;)l[o]=t[o].call(this,l[o]);return tt(e,this,l)})}),Ta=Bl(function(e,t){return Uo(e,32,void 0,t,kt(t,Ko(Ta)))}),Na=Bl(function(e,t){return Uo(e,64,void 0,t,kt(t,Ko(Na)))}),Oa=zo(function(e,t){return Uo(e,256,void 0,void 0,void 0,t)});function La(e,t){return e===t||e!=e&&t!=t}var Ia=Po(vl),wa=Po(function(e,t){return e>=t}),xa=hl(function(){return arguments}())?hl:function(e){return Va(e)&&be.call(e,"callee")&&!Ge.call(e,"callee")},Pa=A.isArray,Ra=Xe?Nt(Xe):function(e){return Va(e)&&ml(e)==S};function Fa(e){return null!=e&&ja(e.length)&&!Wa(e)}function Ba(e){return Va(e)&&Fa(e)}var Ma=en||iu,Ua=$e?Nt($e):function(e){return Va(e)&&ml(e)==u};function ka(e){if(!Va(e))return!1;var t=ml(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function Wa(e){if(!za(e))return!1;var t=ml(e);return t==c||t==d||"[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?Nt(Je):function(e){return Va(e)&&ti(e)==m};function Ya(e){return"number"==typeof e||Va(e)&&ml(e)==v}function qa(e){if(!Va(e)||ml(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Ka=Qe?Nt(Qe):function(e){return Va(e)&&ml(e)==f},Xa=Ze?Nt(Ze):function(e){return Va(e)&&ti(e)==E};function $a(e){return"string"==typeof e||!Pa(e)&&Va(e)&&ml(e)==g}function Ja(e){return"symbol"==typeof e||Va(e)&&ml(e)==h}var Qa=et?Nt(et):function(e){return Va(e)&&ja(e.length)&&!!Be[ml(e)]},Za=Po(Cl),er=Po(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Fa(e))return $a(e)?zt(e):Eo(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=ti(e);return(t==m?Mt:t==E?Wt:Lr)(e)}function nr(e){return e?(e=ir(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 or(e){return e?Kn(lr(e),0,4294967295):0}function ir(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=Tt(e);var n=le.test(e);return n||ie.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return go(e,br(e))}function rr(e){return null==e?"":Xl(e)}var ur=_o(function(e,t){if(ci(t)||Fa(t))go(t,Sr(t),e);else for(var n in t)be.call(t,n)&&jn(e,n,t[n])}),sr=_o(function(e,t){go(t,br(t),e)}),cr=_o(function(e,t,n,l){go(t,br(t),e,l)}),dr=_o(function(e,t,n,l){go(t,Sr(t),e,l)}),mr=zo(qn),vr=Bl(function(e,t){e=ve(e);var n=-1,l=t.length,o=l>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(l=1);++n<l;)for(var i=t[n],a=br(i),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||La(c,he[s])&&!be.call(e,s))&&(e[s]=i[s])}return e}),pr=Bl(function(e){return e.push(void 0,Wo),tt(yr,void 0,e)});function fr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function Er(e,t){return null!=e&&ni(e,t,fl)}var gr=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),hr=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Xo),_r=Bl(gl);function Sr(e){return Fa(e)?Mn(e):yl(e)}function br(e){return Fa(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=ci(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ar=_o(function(e,t,n){Ol(e,t,n)}),yr=_o(function(e,t,n,l){Ol(e,t,n,l)}),Cr=zo(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=io(t,e),l||(l=t.length>1),t}),go(e,Go(e),n),l&&(n=Xn(n,7,Ho));for(var o=t.length;o--;)Jl(n,t[o]);return n}),Dr=zo(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function Tr(e,t){if(null==e)return{};var n=st(Go(e),function(e){return[e]});return t=Xo(t),wl(e,n,function(e,n){return t(e,n[0])})}var Nr=Mo(Sr),Or=Mo(br);function Lr(e){return null==e?[]:Ot(e,Sr(e))}var Ir=yo(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function xr(e){return(e=rr(e))&&e.replace(re,Pt).replace(Le,"")}var Pr=yo(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=yo(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=Ao("toLowerCase"),Br=yo(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=yo(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=yo(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Ao("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=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new ce(e)}}),jr=zo(function(e,t){return lt(t,function(t){t=Ti(t),Yn(e,t,ha(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=To(),Gr=To(!0);function Yr(e){return e}function qr(e){return Al("function"==typeof e?e:Xn(e,1))}var Kr=Bl(function(e,t){return function(n){return gl(n,e,t)}}),Xr=Bl(function(e,t){return function(n){return gl(e,n,t)}});function $r(e,t,n){var l=Sr(t),o=sl(t,l);null!=n||za(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sr(t)));var i=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(o,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Eo(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function Jr(){}var Qr=Io(st),Zr=Io(it),eu=Io(vt);function tu(e){return ri(e)?bt(Ti(e)):function(e){return function(t){return cl(t,e)}}(e)}var nu=xo(),lu=xo(!0);function ou(){return[]}function iu(){return!1}var au,ru=Lo(function(e,t){return e+t},0),uu=Fo("ceil"),su=Lo(function(e,t){return e/t},1),cu=Fo("floor"),du=Lo(function(e,t){return e*t},1),mu=Fo("round"),vu=Lo(function(e,t){return e-t},0);return Nn.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)}},Nn.ary=Ea,Nn.assign=ur,Nn.assignIn=sr,Nn.assignInWith=cr,Nn.assignWith=dr,Nn.at=mr,Nn.before=ga,Nn.bind=ha,Nn.bindAll=jr,Nn.bindKey=_a,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},Nn.chain=ta,Nn.chunk=function(e,t,n){t=(n?ai(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 o=0,i=0,a=A(Jt(l/t));o<l;)a[i++]=zl(e,o,o+=t);return a},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,o=[];++t<n;){var i=e[t];i&&(o[l++]=i)}return o},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=A(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Pa(n)?Eo(n):[n],ol(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,l=Xo();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Bl(function(n){for(var l=-1;++l<t;){var o=e[l];if(tt(o[0],this,n))return tt(o[1],this,n)}})},Nn.conforms=function(e){return function(e){var t=Sr(e);return function(n){return $n(n,e,t)}}(Xn(e,1))},Nn.constant=zr,Nn.countBy=oa,Nn.create=function(e,t){var n=On(e);return null==t?n:Gn(n,t)},Nn.curry=function e(t,n,l){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},Nn.curryRight=function e(t,n,l){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},Nn.debounce=Sa,Nn.defaults=vr,Nn.defaultsDeep=pr,Nn.defer=ba,Nn.delay=Aa,Nn.difference=Li,Nn.differenceBy=Ii,Nn.differenceWith=wi,Nn.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):[]},Nn.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):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3),!0):[]},Nn.fill=function(e,t,n,l){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,l=o),function(e,t,n,l){var o=e.length;for((n=lr(n))<0&&(n=-n>o?0:o+n),(l=void 0===l||l>o?o:lr(l))<0&&(l+=o),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Nn.filter=function(e,t){return(Pa(e)?at:ll)(e,Xo(t,3))},Nn.flatMap=function(e,t){return ol(ma(e,t),1)},Nn.flatMapDeep=function(e,t){return ol(ma(e,t),1/0)},Nn.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),ol(ma(e,t),n)},Nn.flatten=Ri,Nn.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:lr(t)):[]},Nn.flip=function(e){return Uo(e,512)},Nn.flow=Vr,Nn.flowRight=Gr,Nn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var o=e[t];l[o[0]]=o[1]}return l},Nn.functions=function(e){return null==e?[]:sl(e,Sr(e))},Nn.functionsIn=function(e){return null==e?[]:sl(e,br(e))},Nn.groupBy=sa,Nn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Nn.intersection=Bi,Nn.intersectionBy=Mi,Nn.intersectionWith=Ui,Nn.invert=gr,Nn.invertBy=hr,Nn.invokeMap=ca,Nn.iteratee=qr,Nn.keyBy=da,Nn.keys=Sr,Nn.keysIn=br,Nn.map=ma,Nn.mapKeys=function(e,t){var n={};return t=Xo(t,3),rl(e,function(e,l,o){Yn(n,t(e,l,o),e)}),n},Nn.mapValues=function(e,t){var n={};return t=Xo(t,3),rl(e,function(e,l,o){Yn(n,l,t(e,l,o))}),n},Nn.matches=function(e){return Tl(Xn(e,1))},Nn.matchesProperty=function(e,t){return Nl(e,Xn(t,1))},Nn.memoize=ya,Nn.merge=Ar,Nn.mergeWith=yr,Nn.method=Kr,Nn.methodOf=Xr,Nn.mixin=$r,Nn.negate=Ca,Nn.nthArg=function(e){return e=lr(e),Bl(function(t){return Ll(t,e)})},Nn.omit=Cr,Nn.omitBy=function(e,t){return Tr(e,Ca(Xo(t)))},Nn.once=function(e){return ga(2,e)},Nn.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))},Nn.over=Qr,Nn.overArgs=Da,Nn.overEvery=Zr,Nn.overSome=eu,Nn.partial=Ta,Nn.partialRight=Na,Nn.partition=va,Nn.pick=Dr,Nn.pickBy=Tr,Nn.property=tu,Nn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},Nn.pull=Wi,Nn.pullAll=Hi,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,Xo(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,void 0,n):e},Nn.pullAt=ji,Nn.range=nu,Nn.rangeRight=lu,Nn.rearg=Oa,Nn.reject=function(e,t){return(Pa(e)?at:ll)(e,Ca(Xo(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,o=[],i=e.length;for(t=Xo(t,3);++l<i;){var a=e[l];t(a,l,e)&&(n.push(a),o.push(l))}return Pl(e,o),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Bl(e,t=void 0===t?t:lr(t))},Nn.reverse=zi,Nn.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:lr(t),(Pa(e)?kn:Ul)(e,t)},Nn.set=function(e,t,n){return null==e?e:kl(e,t,n)},Nn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},Nn.shuffle=function(e){return(Pa(e)?Wn:jl)(e)},Nn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},Nn.sortBy=pa,Nn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Xo(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Xl(t))&&Bt(e)?ro(zt(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Bl(function(n){var l=n[t],o=ro(n,0,t);return l&&ct(o,l),tt(e,this,o)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},Nn.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):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,l){var o=!0,i=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Sa(e,t,{leading:o,maxWait:t,trailing:i})},Nn.thru=na,Nn.toArray=tr,Nn.toPairs=Nr,Nn.toPairsIn=Or,Nn.toPath=function(e){return Pa(e)?st(e,Ti):Ja(e)?[e]:Eo(Di(rr(e)))},Nn.toPlainObject=ar,Nn.transform=function(e,t,n){var l=Pa(e),o=l||Ma(e)||Qa(e);if(t=Xo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:za(e)&&Wa(i)?On(je(e)):{}}return(o?lt:rl)(e,function(e,l,o){return t(n,e,l,o)}),n},Nn.unary=function(e){return Ea(e,1)},Nn.union=Vi,Nn.unionBy=Gi,Nn.unionWith=Yi,Nn.uniq=function(e){return e&&e.length?$l(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?$l(e,Xo(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$l(e,void 0,t):[]},Nn.unset=function(e,t){return null==e||Jl(e,t)},Nn.unzip=qi,Nn.unzipWith=Ki,Nn.update=function(e,t,n){return null==e?e:Ql(e,t,oo(n))},Nn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,oo(n),l)},Nn.values=Lr,Nn.valuesIn=function(e){return null==e?[]:Ot(e,br(e))},Nn.without=Xi,Nn.words=Wr,Nn.wrap=function(e,t){return Ta(oo(t),e)},Nn.xor=$i,Nn.xorBy=Ji,Nn.xorWith=Qi,Nn.zip=Zi,Nn.zipObject=function(e,t){return no(e||[],t||[],jn)},Nn.zipObjectDeep=function(e,t){return no(e||[],t||[],kl)},Nn.zipWith=ea,Nn.entries=Nr,Nn.entriesIn=Or,Nn.extend=sr,Nn.extendWith=cr,$r(Nn,Nn),Nn.add=ru,Nn.attempt=Hr,Nn.camelCase=Ir,Nn.capitalize=wr,Nn.ceil=uu,Nn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ir(n))==n?n:0),void 0!==t&&(t=(t=ir(t))==t?t:0),Kn(ir(e),t,n)},Nn.clone=function(e){return Xn(e,4)},Nn.cloneDeep=function(e){return Xn(e,5)},Nn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Nn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Nn.conformsTo=function(e,t){return null==t||$n(e,t,Sr(t))},Nn.deburr=xr,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=su,Nn.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,o=n=void 0===n?l:Kn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},Nn.eq=La,Nn.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(F,Rt):e},Nn.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Nn.every=function(e,t,n){var l=Pa(e)?it:tl;return n&&ai(e,t,n)&&(t=void 0),l(e,Xo(t,3))},Nn.find=ia,Nn.findIndex=xi,Nn.findKey=function(e,t){return ft(e,Xo(t,3),rl)},Nn.findLast=aa,Nn.findLastIndex=Pi,Nn.findLastKey=function(e,t){return ft(e,Xo(t,3),ul)},Nn.floor=cu,Nn.forEach=ra,Nn.forEachRight=ua,Nn.forIn=function(e,t){return null==e?e:il(e,Xo(t,3),br)},Nn.forInRight=function(e,t){return null==e?e:al(e,Xo(t,3),br)},Nn.forOwn=function(e,t){return e&&rl(e,Xo(t,3))},Nn.forOwnRight=function(e,t){return e&&ul(e,Xo(t,3))},Nn.get=fr,Nn.gt=Ia,Nn.gte=wa,Nn.has=function(e,t){return null!=e&&ni(e,t,pl)},Nn.hasIn=Er,Nn.head=Fi,Nn.identity=Yr,Nn.includes=function(e,t,n,l){e=Fa(e)?e:Lr(e),n=n&&!l?lr(n):0;var o=e.length;return n<0&&(n=on(o+n,0)),$a(e)?n<=o&&e.indexOf(t,n)>-1:!!o&>(e,t,n)>-1},Nn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:lr(n);return o<0&&(o=on(l+o,0)),gt(e,t,o)},Nn.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=ir(e),t,n)},Nn.invoke=_r,Nn.isArguments=xa,Nn.isArray=Pa,Nn.isArrayBuffer=Ra,Nn.isArrayLike=Fa,Nn.isArrayLikeObject=Ba,Nn.isBoolean=function(e){return!0===e||!1===e||Va(e)&&ml(e)==r},Nn.isBuffer=Ma,Nn.isDate=Ua,Nn.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Qa(e)||xa(e)))return!e.length;var t=ti(e);if(t==m||t==E)return!e.size;if(ci(e))return!yl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return _l(e,t)},Nn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?_l(e,t,void 0,n):!!l},Nn.isError=ka,Nn.isFinite=function(e){return"number"==typeof e&&tn(e)},Nn.isFunction=Wa,Nn.isInteger=Ha,Nn.isLength=ja,Nn.isMap=Ga,Nn.isMatch=function(e,t){return e===t||Sl(e,t,Jo(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Jo(t),n)},Nn.isNaN=function(e){return Ya(e)&&e!=+e},Nn.isNative=function(e){if(si(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=Ya,Nn.isObject=za,Nn.isObjectLike=Va,Nn.isPlainObject=qa,Nn.isRegExp=Ka,Nn.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Nn.isSet=Xa,Nn.isString=$a,Nn.isSymbol=Ja,Nn.isTypedArray=Qa,Nn.isUndefined=function(e){return void 0===e},Nn.isWeakMap=function(e){return Va(e)&&ti(e)==_},Nn.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==ml(e)},Nn.join=function(e,t){return null==e?"":nn.call(e,t)},Nn.kebabCase=Pr,Nn.last=ki,Nn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==n&&(o=(o=lr(n))<0?on(l+o,0):an(o,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,o):Et(e,_t,o,!0)},Nn.lowerCase=Rr,Nn.lowerFirst=Fr,Nn.lt=Za,Nn.lte=er,Nn.max=function(e){return e&&e.length?nl(e,Yr,vl):void 0},Nn.maxBy=function(e,t){return e&&e.length?nl(e,Xo(t,2),vl):void 0},Nn.mean=function(e){return St(e,Yr)},Nn.meanBy=function(e,t){return St(e,Xo(t,2))},Nn.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},Nn.minBy=function(e,t){return e&&e.length?nl(e,Xo(t,2),Cl):void 0},Nn.stubArray=ou,Nn.stubFalse=iu,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=du,Nn.nth=function(e,t){return e&&e.length?Ll(e,lr(t)):void 0},Nn.noConflict=function(){return ze._===this&&(ze._=Te),this},Nn.noop=Jr,Nn.now=fa,Nn.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var o=(t-l)/2;return wo(Qt(o),n)+e+wo(Jt(o),n)},Nn.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+wo(t-l,n):e},Nn.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?wo(t-l,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(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 o=sn();return an(e+o*(t-e+ke("1e-"+((o+"").length-1))),t)}return Rl(e,t)},Nn.reduce=function(e,t,n){var l=Pa(e)?dt:yt,o=arguments.length<3;return l(e,Xo(t,4),n,o,Zn)},Nn.reduceRight=function(e,t,n){var l=Pa(e)?mt:yt,o=arguments.length<3;return l(e,Xo(t,4),n,o,el)},Nn.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:lr(t),Fl(rr(e),t)},Nn.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var l=-1,o=(t=io(t,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Ti(t[l])];void 0===i&&(l=o,i=n),e=Wa(i)?i.call(e):i}return e},Nn.round=mu,Nn.runInContext=e,Nn.sample=function(e){return(Pa(e)?Un:Ml)(e)},Nn.size=function(e){if(null==e)return 0;if(Fa(e))return $a(e)?jt(e):e.length;var t=ti(e);return t==m||t==E?e.size:yl(e).length},Nn.snakeCase=Br,Nn.some=function(e,t,n){var l=Pa(e)?vt:Vl;return n&&ai(e,t,n)&&(t=void 0),l(e,Xo(t,3))},Nn.sortedIndex=function(e,t){return Gl(e,t)},Nn.sortedIndexBy=function(e,t,n){return Yl(e,t,Xo(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&La(e[l],t))return l}return-1},Nn.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Xo(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(La(e[n],t))return n}return-1},Nn.startCase=Mr,Nn.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:Kn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Nn.subtract=vu,Nn.sum=function(e){return e&&e.length?Ct(e,Yr):0},Nn.sumBy=function(e,t){return e&&e.length?Ct(e,Xo(t,2)):0},Nn.template=function(e,t,n){var l=Nn.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=rr(e),t=cr({},t,l,ko);var o,i,a=cr({},t.imports,l.imports,ko),r=Sr(a),u=Ot(a,r),s=0,c=t.interpolate||ue,d="__p += '",m=pe((t.escape||ue).source+"|"+c.source+"|"+(c===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(m,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(s,u).replace(se,Ft),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),r&&(i=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var p=be.call(t,"variable")&&t.variable;if(p){if(Q.test(p))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(w,""):d).replace(x,"$1").replace(P,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Hr(function(){return de(r,v+"return "+d).apply(void 0,u)});if(f.source=d,ka(f))throw f;return f},Nn.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var o=Dt(l,t=Xo(t));++n<e;)t(n);return o},Nn.toFinite=nr,Nn.toInteger=lr,Nn.toLength=or,Nn.toLower=function(e){return rr(e).toLowerCase()},Nn.toNumber=ir,Nn.toSafeInteger=function(e){return e?Kn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},Nn.toString=rr,Nn.toUpper=function(e){return rr(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),o=zt(t);return ro(l,It(l,o),wt(l,o)+1).join("")},Nn.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 ro(l,0,wt(l,zt(t))+1).join("")},Nn.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 ro(l,It(l,zt(t))).join("")},Nn.truncate=function(e,t){var n=30,l="...";if(za(t)){var o="separator"in t?t.separator:o;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var i=(e=rr(e)).length;if(Bt(e)){var a=zt(e);i=a.length}if(n>=i)return e;var r=n-jt(l);if(r<1)return l;var u=a?ro(a,0,r).join(""):e.slice(0,r);if(void 0===o)return u+l;if(a&&(r+=u.length-r),Ka(o)){if(e.slice(r).search(o)){var s,c=u;for(o.global||(o=pe(o.source,rr(te.exec(o))+"g")),o.lastIndex=0;s=o.exec(c);)var d=s.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf(Xl(o),r)!=r){var m=u.lastIndexOf(o);m>-1&&(u=u.slice(0,m))}return u+l},Nn.unescape=function(e){return(e=rr(e))&&B.test(e)?e.replace(R,Gt):e},Nn.uniqueId=function(e){var t=++Ae;return rr(e)+t},Nn.upperCase=Ur,Nn.upperFirst=kr,Nn.each=ra,Nn.eachRight=ua,Nn.first=Fi,$r(Nn,(au={},rl(Nn,function(e,t){be.call(Nn.prototype,t)||(au[t]=e)}),au),{chain:!1}),Nn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),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:Xo(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=Bl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return gl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ca(Xo(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),o=Nn[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);o&&(Nn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||Pa(t),c=function(e){var t=o.apply(Nn,ct([e],a));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var d=this.__chain__,m=!!this.__actions__.length,v=i&&!d,p=r&&!m;if(!i&&s){t=p?t:new wn(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[c],thisArg:void 0}),new In(f,d)}return v&&p?e.apply(this,a):(f=this.thru(c),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return t.apply(Pa(o)?o:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Nn[t];if(n){var l=n.name+"";be.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[No(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=Eo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Eo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Eo(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,o=n?e.length:0,i=function(e,t,n){for(var l=-1,o=n.length;++l<o;){var i=n[l],a=i.size;switch(i.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,o,this.__views__),a=i.start,r=i.end,u=r-a,s=l?r:a-1,c=this.__iteratees__,d=c.length,m=0,v=an(u,this.__takeCount__);if(!n||!l&&o==u&&v==u)return eo(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var f=-1,E=e[s+=t];++f<d;){var g=c[f],h=g.type,_=(0,g.iteratee)(E);if(2==h)E=_;else if(!_){if(1==h)continue e;break e}}p[m++]=E}return p},Nn.prototype.at=la,Nn.prototype.chain=function(){return ta(this)},Nn.prototype.commit=function(){return new In(this.value(),this.__chain__)},Nn.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__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof Ln;){var l=Oi(n);l.__index__=0,l.__values__=void 0,t?o.__wrapped__=l:t=l;var o=l;n=n.__wrapped__}return o.__wrapped__=e,t},Nn.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:[zi],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zi)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,pt&&(Nn.prototype[pt]=function(){return this}),Nn}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(A)});function gn(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=i.useTranslation(),c=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"}},!c&&(null==n?void 0:n.map((e,o)=>{var i,c,d;return l.createElement(l.Fragment,{key:o},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===(i=e.values)||void 0===i?void 0:i.map((n,o)=>{var i;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:o},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!==(i=n.documentType)&&void 0!==i&&i.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:o},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!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=o+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(null==n?void 0:n.map((e,n)=>{var i;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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.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 hn=e=>{var t,o;let{t:i,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const c=(null==r?void 0:r.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],m=Digit.ULBService.getStateId(),[v,p]=n.useState((null==a||null===(o=a.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[g,h]=n.useState([]),[_,S]=n.useState(!0),[b,A]=n.useState(!1),[y,C]=n.useState(!1),{isLoading:D,data:T}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:N,data:O}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,a;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==T||null===(i=T.BPA)||void 0===i||null===(a=i.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=o)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,o;let i=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,i.length);i===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===(o=l.values)||void 0===o||o.map(t=>{var n,l;i===(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)),h(s)},[!D,!N]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,b]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(_n,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:A,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:y}))))};function _n(e){var o,i;let{t:a,document:r,setDocuments:u,documents:s,index:c,bpaTaxDocuments:m,checkEnablingDocs:v}=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,g]=n.useState(p?d({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:{}),[h,_]=n.useState(null),[S,b]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[A,y]=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==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==E?void 0:E.code,fileStoreId:S,documentUid:S,fileName:(null==h?void 0:h.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}]})},[S,E]),n.useEffect(()=>{try{A.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],A.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})}),m[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(m)))}catch(e){Promise.reject(e)}},[A,E]),n.useEffect(()=>{},[h]),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===(i=r.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(gn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?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=>g(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 o;0!==Object.keys(n).length&&y(l),(o=l[l.length-1])&&_(o.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Sn(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,o)=>{var i,r,u,s,c,d;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")+" - "+(o+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(i=e.date)||void 0===i?void 0:i.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===(c=e.questions)||void 0===c?void 0:c.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(gn,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.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 bn(e){let{t:o,document:i,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==i?void 0:i.code)})[0],c=Digit.ULBService.getStateId(),[d,m]=n.useState(),[v,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=i&&null!==(e=i.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==i||null===(t=i.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==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=At(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,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?E(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){r(o("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)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const An=e=>{var o;let{t:i,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const m=Digit.ULBService.getStateId(),v=(null==s?void 0:s.status)||"",p=(null==d||null===(o=d.data)||void 0===o?void 0:o.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[h,_]=n.useState([]),[S,b]=n.useState([]),[A,y]=n.useState(!1),[C,D]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[T,N]=n.useState(null),O=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,o=[];var i,r,c,d;l=u?null==f||null===(i=f.NOC)||void 0===i||null===(r=i.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===(c=E.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.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},o.push(l[0].docTypes[0]));let m=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==h||h.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),m.push(e)}),b(m))},[f,h]),n.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===v&&(null==p?void 0:p.length)>0)},[s,d]),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?""+i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.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?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(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?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(gn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),A&&(null==S?void 0:S.map((e,t)=>l.createElement(bn,{key:t,document:e,t:i,error:T,setError:N,setNocDocuments:D,nocDocuments:C,checkEnablingDocs:A}))))},yn=e=>{let{permissions:o,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.map(e=>({label:e,checked:!1}))),[s,c,m]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"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?d({},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)=>{c(()=>null==s?void 0:s.map((n,l)=>{var o;return t===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("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:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Cn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.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==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.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 Dn(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(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"})}))))}))}))}function Tn(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},c={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=d({},u,{maxWidth:"950px"}),u=d({},u,{maxWidth:"950px"}),c={}),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"},o.map((e,n)=>{var o;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===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;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===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const Nn=e=>{var o,a,r,u,s,c,d,m,v,p,f,E,g,h,_,S,b,A,y,C,D,T,N;let{scrutinyDetails:O,paymentsList:L=[],additionalDetails:I,applicationData:w}=e;const x=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==w?void 0:w.status))&&window.location.href.includes("bpa"),[P,R]=n.useState(),[F,B]=n.useState(),[M,U]=n.useState(),k=Digit.ULBService.getStateId(),[W,H]=n.useState(),[j,z]=n.useState(),[V,G]=n.useState([]),[Y,q]=n.useState(),[K,X]=n.useState(""),[$,J]=n.useState(null),[Q,Z]=n.useState({}),ee={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[te,ne]=n.useState(!1),[le,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if(Y&&null!=Y&&Y.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Y||null===(t=Y.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(Y.size>=2e6)J(ie("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Y,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?G([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId,time:new Date}]):J(ie("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(ie("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Y]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,o,i,a;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,o;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(o=I.lessAdjustmentFeeFiles)||void 0===o?void 0:o.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,k).then(e=>Z(null==e?void 0:e.data))}R(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),B(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_OTHER_CHARGES),U(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(a=I.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),H(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),G(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:ie}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ie(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ie(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ie("NA");return l.createElement(n.Fragment,null,!(null!=O&&O.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==O||null===(o=O.values)||void 0===o?void 0:o.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:""+ie(""+e.title),text:null!=e&&e.value?ae(e)+" "+ie(null==e?void 0:e.isUnit):ie("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:""+ie(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ie(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ie(null==e?void 0:e.title))),null==O||null===(a=O.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==O||null===(r=O.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ie("SHOW_P1_FEES_DETAILS"))),le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ie("HIDE_P1_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ie("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==O||null===(u=O.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ie("SHOW_P2_FEES_DETAILS"))),te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ie("HIDE_P2_FEES_DETAILS"))),te&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ie("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES)||0,value:P,disabled:!x,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(R(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_OTHER_CHARGES)||0,value:F,disabled:!x,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(B(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ie,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!x,onChange:e=>{!function(e){H(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(E=I.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:M,disabled:!x,onChange:e=>{!function(e){var t,n,l,o;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(P)?parseFloat(P):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0&&x?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),q(e.target.files[0])},disabled:!x,onDelete:()=>{z(null),q("")},message:j?"1 "+ie("FILEUPLOADED"):ie("ES_NO_FILE_SELECTED_LABEL"),error:$,uploadMessage:K})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==I||null===(h=I.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ie("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(_=Q.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(A=Q.fileStoreIds)||void 0===A?void 0:A.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(P)?parseFloat(P):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(y=I.selfCertificationCharges)||void 0===y?void 0:y.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_LABOUR_CESS)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==I||null===(T=I.selfCertificationCharges)||void 0===T?void 0:T.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(M)?parseFloat(M):0))}))),l.createElement("div",null,null==O||null===(N=O.scruntinyDetails)||void 0===N?void 0:N.map((e,o)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ie(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ie(null==e?void 0:e.text))))))))},On=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:m}=i.useTranslation(),v=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:m(""+e.name),accessor:f(e.id),id:e.id})));function g(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,o,i,a,r,u,s;n.push({Floor:m("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:m(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:m("BPA_FLOOR_NAME_"+e.number)})}),n}function h(e){var t;let n=null==d||null===(t=d.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var o,i;let t=null===(o=n[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+m("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==c||null===(o=c.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},m(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+m(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==c||null===(a=c.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 o,i,a,r,u;return l.createElement("div",{key:n,style:(null==c||null===(o=c.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.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"}},m("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+m("BPA_SUB_OCCUPANCY_LABEL"),text:h(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:m,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},Ln=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))},In=e=>{var o,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,m]=n.useState(!1),{t:v}=i.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:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Ln,{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===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!d&&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:()=>{m(!0)},style:{color:"#800000"}},v("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{m(!1)},style:{color:"#800000"}},v("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,v("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:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(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",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function xn(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Pn=e=>{var o,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let m=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const p=null==m?void 0:m.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:g,roadCuttingAddlDetails:h,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(o=c.additionalDetails)||void 0===o?void 0:o.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("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:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.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"}},d("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:""+d(""+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==c||null===(r=c.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"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.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:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==c||null===(u=c.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==h?void 0:h.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Rn=[{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"}],Fn=[{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"}],Bn=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[m,v,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[S,b]=n.useState(!1),[A,y]=n.useState(m||{}),[C,D]=n.useState(null),[T,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[O,L]=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 o=d({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==m||null===(n=m.billDetails)||void 0===n?void 0:n.length)>0){var i,a,r,u,c,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==m||null===(i=m.billDetails)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==m||null===(r=m.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==m||null===(c=m.billDetails)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.taxAmount)}];L(e),N(null==m||null===(f=m.billDetails)||void 0===f?void 0:f[0])}else v(o),y(o)},[]);let w={};const x=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"})),R=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),F=function(e,t,n){void 0===t&&(t=!1);let l=d({},A);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 o,i;const t=0==(null==n||null===(o=n.target)||void 0===o?void 0:o.value)?1:Math.sign(null==n||null===(i=n.target)||void 0===i?void 0:i.value)||-1;l[e]=1==t?n.target.value:""}y(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:""+c(""+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:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==T?void 0:T.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(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=>{b(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(x,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{y(m),b(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(m),b(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=A&&A.adhocPenalty?Number(null==A?void 0:A.adhocPenalty):0,n=null!=A&&A.adhocRebate?Number(null==A?void 0:A.adhocRebate):0;var l,o;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,a,r,u,m,p,f,g,h,S;const e=null==s||null===(i=s.additionalDetails)||void 0===i||null===(a=i.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=d({},null==s||null===(m=s.additionalDetails)||void 0===m||null===(p=m.appDetails)||void 0===p?void 0:p.additionalDetails,A);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 o="WATER"==(null==s||null===(h=s.additionalDetails)||void 0===h||null===(S=h.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,a,r,u,s,c,d,m,p,f,g,h;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(o=l.taxHeadEstimates)||void 0===o?void 0:o.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===(i=e.Calculation)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{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===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.taxAmount}];E(gt(e.Calculation[0])),N(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),L(S),A.billDetails=null==e?void 0:e.Calculation,v(A),b(!1)}).catch(e=>{var t,n,l,o,i,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?c(""+(null==e||null===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:c("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"}},c("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Rn,optionKey:"title",select:e=>F("adhocPenaltyReason",!0,e),selected:(null==A?void 0:A.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==A||null===(r=A.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==A?void 0:A.adhocPenaltyComment)||"",onChange:e=>F("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==A?void 0:A.adhocPenalty)||"",onChange:e=>F("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("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"}},c("PT_AD_REBATE")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Fn,optionKey:"title",select:e=>F("adhocRebateReason",!0,e),selected:(null==A?void 0:A.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==A||null===(u=A.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==A?void 0:A.adhocRebateComment)||"",onChange:e=>F("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==A?void 0:A.adhocRebate)||"",onChange:e=>F("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("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:c(null==C?void 0:C.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},Mn=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:d({},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"})))},Un=e=>{let{t:n,userType:o=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;o=o||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(i))),n(a)+" ",l.createElement(Mn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},kn=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:m}=e;const{t:v}=i.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),h=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>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"})),S=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=m&&null!==(o=m.additionalDetails)&&void 0!==o&&o.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=m.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),g(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(h,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{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"}},v("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:""+v(""+(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:""+v("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"}},v("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:""+v(""+(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:""+v("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===(c=E.billSlabData)||void 0===c||null===(d=c.TAX)||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:""+v(""+(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:""+v("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"}})))))},Wn={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:{}},Hn=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Wn.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Wn.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:d({},Wn.cell,Wn.cellLeft,Wn.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:d({},Wn.cell,n.length==t+1?Wn.cellRight:{},Wn.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:d({},Wn.cell,Wn.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,o)=>l.createElement("td",{style:d({},Wn.cell,{textAlign:"left"},n.length==o+1?Wn.cellRight:{},{whiteSpace:"pre"}),key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:d({},Wn.cell,Wn.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:d({},Wn.cell,Wn.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:d({},Wn.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Wn.cell,key:t,numeric:!0})))))))},jn={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,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(o=c)||void 0===o?void 0:o.reduce((e,t,n)=>e+t.amount,0))||0;let m="₹ "+((null==d||null===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));c.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},o.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},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(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 v={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{v[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let p=[];p=Object.keys(v),p.sort((e,t)=>v[e]-v[t]);const[f,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:jn.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Hn,{headers:[...p],values:s,arrears:m}),!f&&l.createElement("div",{style:jn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:jn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Vn=e=>{let{assessmentData:t}=e;const[o,i]=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:()=>{i(!o)}},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"}},o?"<":">"))),o&&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 Gn(e){var a,r,u,s,c,m,v,p,f,E,g,h,S,b,A,y;let{applicationDetails:C,demandData:D,workflowDetails:T,isDataLoading:N,applicationData:O,businessService:L,timelineStatusPrefix:I,showTimeLine:w=!0,statusAttribute:x="status",paymentsList:P,oldValue:R,isInfoLabel:F=!1,propertyId:B,moduleCode:M}=e;const{t:U}=i.useTranslation(),k=o.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[q,K]=n.useState({}),[X,$]=n.useState(),[J,Q]=n.useState([]),[Z,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.status)||Z.loading||Z.loaded||Z.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==Z||!Z.canLoad||Z.loading||Z.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(o){function i(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==o||null===(n=o.Assessments)||void 0===n?void 0:n.length)>0){const n=o.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 i=Array.from(l.values());return Q(i),console.log(i),$(null==o?void 0:o.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(i):i()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||W,null==O?void 0:O.propertyId,K,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 o;const e={date:te(null==O||null===(o=O.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(In,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,a,r,u,s,c,d,m,v,p,f,E,g,h,S,b,A,y;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(a=i[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=n[t-1],T={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,mobileNumber:(null==O||null===(c=O.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.uuid)&&null!=O&&null!==(f=O.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(g=E[0])&&void 0!==g&&g.mobileNumber?null==O||null===(h=O.processInstance)||void 0===h||null===(S=h.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(A=e.assignes)||void 0===A||null===(y=A[0])||void 0===y?void 0:y.mobileNumber,comment:U(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(In,{data:T,OpenImage:Y,privacy:o})}{var D,T,N,L,I;const t={date:te(null==O||null===(D=O.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(T=e.assignes)||void 0===T||null===(N=T[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(L=e.assignes)||void 0===L||null===(I=L[0])||void 0===I?void 0:I.mobileNumber};return l.createElement(In,{data:t})}},le=(e,t)=>e?t?e:U(e):U("NA"),oe=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ie=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")||oe?{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,ce]=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 de=function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=d({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:d({},e.additionalDetails,{propertytobestatus:t}),workflow:d({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:d({},l)},W,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},me=null==C?void 0:C.applicationData,ve=(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,L),console.log("infolabel",F),console.log("assessment details",X),n.useEffect(()=>{try{let e={consumerCodes:B};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"},F?l.createElement(Un,{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,i)=>{var a,r,u,s,c,d,m,v,p,f,E,g,h,_,S,b,A,y,D,N,O,L,I,w,x,F,B,M,k,W,H,j,z,V,Y,K,X,$;return l.createElement(l.Fragment,{key:i},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"}:oe?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&oe?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ie?""+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,o)=>o===(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")||oe?{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,i)=>{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(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},U(null==n?void 0:n.title)))):ie||ae?""+U(n.title):U(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(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:i===(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=q.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(Nn,{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===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.fiReport)&&l.createElement(Sn,{fiReport:null==C||null===(v=C.applicationData)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Dn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(Tn,{owners:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(xn,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(wn,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.accessories}),!G&&(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.permissions)&&(null==T||null===(D=T.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(yn,{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===(L=e.additionalDetails)||void 0===L?void 0:L.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(hn,{t:U,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(An,{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:T}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.scruntinyDetails)&&l.createElement(Nn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(Nn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(On,{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(gn,{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(Cn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Pn,{wsAdditionalDetails:e,oldValue:R}),(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(o.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===(K=Y.redirectUrl)||void 0===K?void 0:K.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Bn,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.estimationDetails)&&l.createElement(kn,{wsAdditionalDetails:e,workflowDetails:T}))}),(null==X?void 0:X.length)>0&&l.createElement(Vn,{assessmentData:J}),w&&(null==T||null===(s=T.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||N)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!N&&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!=T&&null!==(m=T.data)&&void 0!==m&&m.timeline&&1===(null==T||null===(v=T.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:U(""+I+(null==T||null===(f=T.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(null==T||null===(g=T.data)||void 0===g?void 0:g.timeline[0],null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(S=T.data)||void 0===S?void 0:S.timeline)&&(null==T||null===(b=T.data)||void 0===b?void 0:b.timeline.slice(0,se?null==T?void 0:T.data.timeline.length:2).map((e,n,o)=>{var i;let a="";var r,u,s,c,d,m;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.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!=T&&null!==(c=T.data)&&void 0!==c&&null!==(d=c.timeline[n-1])&&void 0!==d&&null!==(m=d.state)&&void 0!==m&&m.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[x])+a),customChild:ne(e,n,null==T||null===(i=T.data)||void 0===i?void 0:i.timeline)}))}))),(null==T||null===(A=T.data)||void 0===A||null===(y=A.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:U(se?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ce(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?de(me,"ACTIVE",ve):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?de(me,"INACTIVE",ve):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,o;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===(o=C.applicationData)||void 0===o?void 0:o.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var i,a,r;if("INACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.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 Yn(e){var n,o,i,a,r,u,s,c,d,m,v,p,f,E,g,h,_,S;let{t:b,showToast:A,closeToast:y,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==A||null===(D=A.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==A?void 0:A.key)?null==A||null===(n=A.error)||void 0===n?void 0:n.message:b("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==A?void 0:A.key)?null==A||null===(o=A.error)||void 0===o?void 0:o.message:b("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==A?void 0:A.key)?null==A||null===(i=A.error)||void 0===i?void 0:i.message:b("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==A?void 0:A.key)?null==A||null===(a=A.error)||void 0===a?void 0:a.message:b("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==A?void 0:A.key)?null==A||null===(r=A.error)||void 0===r?void 0:r.message:b("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==A?void 0:A.key)?null==A||null===(u=A.error)||void 0===u?void 0:u.message:b("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==A?void 0:A.key)?null==A||null===(s=A.error)||void 0===s?void 0:s.message:b("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==A?void 0:A.key)?null==A||null===(c=A.error)||void 0===c?void 0:c.message:b("ES_"+C+"_"+(null==A||null===(d=A.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,A&&l.createElement(t.Toast,{error:"error"===A.key,label:e,onClose:y}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var T;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")?b(e[1]):b(e[0]),n};let n="";switch(null==A||null===(T=A.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==A?void 0:A.key)?null==A||null===(m=A.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==A?void 0:A.key)?null==A||null===(v=A.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==A?void 0:A.key)?null==A||null===(p=A.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==A?void 0:A.key)?null==A||null===(f=A.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==A?void 0:A.key)?null==A||null===(E=A.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==A?void 0:A.key)?null==A||null===(g=A.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==A?void 0:A.key)?null==A||null===(h=A.error)||void 0===h?void 0:h.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==A?void 0:A.key)?null==A||null===(_=A.error)||void 0===_?void 0:_.message:b("ES_"+C+"_"+(null==A||null===(S=A.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,A&&l.createElement(t.Toast,{error:"error"===A.key,label:n,onClose:y}))}{var N,O;const e="error"===(null==A?void 0:A.key)?null==A||null===(N=A.error)||void 0===N?void 0:N.message:"ES_"+C+"_"+(null==A||null===(O=A.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,A&&l.createElement(t.Toast,{error:"error"===A.key,label:b(e),onClose:y}))}}function qn(e){var o,a,r,u,s,c,m,v,p,f,E,g,h,_,S,b;let{workflowDetails:A,displayMenu:y,onActionSelect:C,setDisplayMenu:D,businessService:T,forcedActionPrefix:N,ActionBarStyle:O={},MenuStyle:L={}}=e;const{t:I}=i.useTranslation();let w=Digit.UserService.getUser();const x=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===(o=w)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,F=!1,B=(null==A||null===(u=A.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.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==A||null===(m=A.data)||void 0===m||null===(v=m.nextActions)||void 0===v?void 0:v.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 Digit.Hooks.useClickOutside(x,()=>{D(!1)},y),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==B?void 0:B.length)||null!=B&&null!==(p=B[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==B?void 0:B.length)?(F=!1,R=!0):(null==B?void 0:B.length)>0&&(F=!0,R=!1),l.createElement(l.Fragment,null,!(null!=A&&A.isLoading)&&F&&!R&&l.createElement(t.ActionBar,{style:d({},O)},y&&(null!=A&&null!==(E=A.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=A&&null!==(h=A.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:N||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()),options:B,optionKey:"action",t:I,onSelect:C,style:L}):null,l.createElement(t.SubmitBar,{ref:x,label:I("WF_TAKE_ACTION"),onSubmit:()=>D(!y)})),!(null!=A&&A.isLoading)&&!F&&R&&l.createElement(t.ActionBar,{style:d({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==B||null===(_=B[0])||void 0===_?void 0:_.action,value:null==B||null===(S=B[0])||void 0===S?void 0:S.action,onClick:e=>{C((null==B?void 0:B[0])||{})}},I((N||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()))+"_"+(null==B||null===(b=B[0])||void 0===b?void 0:b.action)))))}const Kn=()=>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"})),Xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null));function $n(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.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(Xn,{onClick:()=>{o()}}),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:o,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 Jn=e=>{var r,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(m,"BPA",["BlockReason"]),{t:p}=i.useTranslation(),f=o.useHistory();let{id:E}=o.useParams();const[g,h]=n.useState(!1),[_,S]=n.useState(null),[b,A]=n.useState(!1),[y,C]=n.useState(!1),[D,T]=n.useState(!1),{data:N}=Digit.Hooks.obps.useMDMS(m,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:L,totalDemandTax:I,totalBalanceTax:w,showToast:x,setShowToast:P,isLoading:R,isDataLoading:F,applicationData:B,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:K,paymentsList:X,showTimeLine:$=!0,oldValue:J,isInfoLabel:Q=!1,clearDataDetails:Z,propertyId:ee}=e;n.useEffect(()=>{x&&k.revalidate()},[x]);const te=a.useQueryClient(),ne=()=>{S(null),A(!1)};return R||y?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Gn,{applicationDetails:O,demandData:L,id:W,workflowDetails:k,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:$,oldValue:J,isInfoLabel:Q,propertyId:ee,moduleCode:z}),b?l.createElement(fn,{t:p,action:_,tenantId:c,state:m,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 o=function(o,i,a,r,u,s,c,m,v,E,g,h,S,b,A,y,D,T){if(0==(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(a=i.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===(c=s[0])||void 0===c||null===(m=c.additionalDetail)||void 0===m||null===(v=m.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(g=E[0])||void 0===g||null===(h=g.comment)||void 0===h?void 0:h.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(b=S.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(A=e.SewerageConnection)||void 0===A||null===(y=A.comment)||void 0===y?void 0:y.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(T=D.comment)||void 0===T?void 0:T.length)){var N,O;"INITIATE"===(null==e||null===(N=e.Licenses)||void 0===N||null===(O=N[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 o=function(o,i,a,r,u){if("BPA"!=(null==e||null===(o=e.BPA)||void 0===o?void 0:o.businessService)||null!=e&&null!==(i=e.BPA)&&void 0!==i&&null!==(a=i.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,o,i,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=_,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=_,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.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,c,d,m,v,E,g,h;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(m=d.workflow)&&void 0!==m&&m.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(E=v.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(h=g.workflow)&&void 0!==h&&h.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S,b,A;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!==(S=e.Licenses[0])&&void 0!==S&&null!==(b=S.businessService)&&void 0!==b&&b.includes("BPAREG")?(P({key:"success",action:_}),e.selectedAction=_,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:_}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(A=e.Licenses[0])||void 0===A?void 0:A.applicationNumber)));P({key:"success",action:_}),Z&&setTimeout(Z,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(d({},e)));const o=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)),o=At(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,o,i,a,r,u,s,c,d,m,v;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(o=n.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.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===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(m=d.Errors)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.message)||e;ne(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(s):s(o)}alert(p("Please select Blocking reason"))}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.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==v||null===(u=v.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement($n,{action:_,workflowDetails:k,businessService:H,isWarningPop:D,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(Yn,{t:p,showToast:x,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 Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,o,i,a;const r=Digit.Utils.obps.calculateRiskType(null==N||null===(t=N.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===(o=l.plot)||void 0===o?void 0:o.area,null==O||null===(i=O.edcrDetails)||void 0===i||null===(a=i.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},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,o,i,a,r,s,d,m,v){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===(o=l.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.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===(d=u.BPA)||void 0===d||null===(m=d.additionalDetails)||void 0===m||null===(v=m.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).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(qn,{workflowDetails:k,displayMenu:g,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)T(!0);else if(null!=e&&e.redirectionUrll){var o,i,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.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===(i=e.redirectionUrll)||void 0===i?void 0:i.action)){var s,c;f.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var m;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(m=e.redirectionUrll)||void 0===m?void 0:m.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"),A(!0);else{var v,p;f.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:d({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else A(!0);S(e),h(!1)},setDisplayMenu:h,businessService:H,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function Qn(e){var o;let{t:i,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],c=Digit.ULBService.getStateId(),[d,m]=n.useState(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o[0]),[v,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{null!=d&&d.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==d?void 0:d.code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}])},[f,d]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+i("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,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==d?void 0:d.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 o;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(o=n[n.length-1])&&p(o.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Zn=e=>{let{registerRef:o,searchFieldComponents:a}=e;const{t:r}=i.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_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:o({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_BPA_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:o({})}))):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_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:o({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_BPA_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:o({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},el=e=>{let{statuses:o,isInboxLoading:a,controlFilterForm:u,setFilterFormValue:s,applicationTypesOfBPA:c}=e;const{t:d}=i.useTranslation(),m=(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")}]);null==c||c.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)});const v=r.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:u,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:m.filter(t=>t.code===e.value)[0],optionsKey:"name",options:m})})),l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"businessService",control:u,render:e=>l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},d("BUSINESS_SERVICE")),l.createElement(t.RadioButtons,{onSelect:t=>{s("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:f()||[]}))})),v?l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:u,render:e=>{const i=n.useMemo(()=>{var n;return null==o||null===(n=o.filter(e=>e.businessservice===v.code))||void 0===n?void 0:n.map(n=>{var o;return l.createElement(t.CheckBox,{onChange:t=>{var l;return function(t){e.onChange(t)}(t.target.checked?[...e.value,null==n?void 0:n.statusid]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.statusid)))},checked:null===(o=e.value)||void 0===o?void 0:o.includes(null==n?void 0:n.statusid),label:d("WF_"+n.businessservice+"_"+n.applicationstatus.split("_").pop())+" ("+n.count+")"})})},[e.value,o,v]);return l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},d("ACTION_TEST_APPLICATION_STATUS")),a?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,i))}})):null)};function tl(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 nl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ll(e){nl(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 ol(e,t){nl(2,arguments);var n=ll(e).getTime(),l=tl(t);return new Date(n+l)}function il(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 al(e){return nl(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function rl(e){if(nl(1,arguments),!al(e)&&"number"!=typeof e)return!1;var t=ll(e);return!isNaN(Number(t))}var ul={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 sl(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 cl={date:sl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:sl({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:sl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},dl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ml(e){return function(t,n){var l,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;l=e.formattingValues[a]||e.formattingValues[i]}else{var r=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function vl(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,o=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,r=i[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?fl(u,function(e){return e.test(r)}):pl(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(s):s,a=n.valueCallback?n.valueCallback(a):a;var c=t.slice(r.length);return{value:a,rest:c}}}function pl(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function fl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var El,gl={code:"en-US",formatDistance:function(e,t,n){var l,o=ul[e];return l="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:cl,formatRelative:function(e,t,n,l){return dl[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:ml({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ml({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:ml({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:ml({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:ml({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:(El={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(El.matchPattern);if(!n)return null;var l=n[0],o=e.match(El.parsePattern);if(!o)return null;var i=El.valueCallback?El.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(l.length);return{value:i,rest:a}}),era:vl({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:vl({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:vl({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:vl({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:vl({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 hl(e,t){nl(2,arguments);var n=tl(t);return ol(e,-n)}function _l(e){nl(1,arguments);var t=1,n=ll(e),l=n.getUTCDay(),o=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function Sl(e){nl(1,arguments);var t=ll(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var o=_l(l),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=_l(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function bl(e){nl(1,arguments);var t=Sl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=_l(n);return l}function Al(e,t){nl(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.weekStartsOn,i=null==o?0:tl(o),a=null==n.weekStartsOn?i:tl(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=ll(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 yl(e,t){nl(1,arguments);var n=ll(e),l=n.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:tl(a),u=null==o.firstWeekContainsDate?r:tl(o.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 c=Al(s,t),d=new Date(0);d.setUTCFullYear(l,0,u),d.setUTCHours(0,0,0,0);var m=Al(d,t);return n.getTime()>=c.getTime()?l+1:n.getTime()>=m.getTime()?l:l-1}function Cl(e,t){nl(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.firstWeekContainsDate,i=null==o?1:tl(o),a=null==n.firstWeekContainsDate?i:tl(n.firstWeekContainsDate),r=yl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=Al(u,t);return s}function Dl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var Tl={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 Dl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var o=yl(e,l),i=o>0?o:1-o;return"YY"===t?Dl(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Dl(i,t.length)},R:function(e,t){return Dl(Sl(e),t.length)},u:function(e,t){return Dl(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 Dl(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 Dl(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):Dl(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 Dl(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 o=function(e,t){nl(1,arguments);var n=ll(e),l=Al(n,t).getTime()-Cl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Dl(o,t.length)},I:function(e,t,n){var l=function(e){nl(1,arguments);var t=ll(e),n=_l(t).getTime()-bl(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Dl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Dl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){nl(1,arguments);var t=ll(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),o=n-l;return Math.floor(o/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):Dl(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 o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Dl(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Dl(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),o=0===l?7:l;switch(t){case"i":return String(o);case"ii":return Dl(o,t.length);case"io":return n.ordinalNumber(o,{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,o=e.getUTCHours();switch(l=12===o?"noon":0===o?"midnight":o/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,o=e.getUTCHours();switch(l=o>=17?"evening":o>=12?"afternoon":o>=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 Dl(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 Dl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Dl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Dl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Dl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Dl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Dl(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Ol(o);case"XXXX":case"XX":return Ll(o);case"XXXXX":case"XXX":default:return Ll(o,":")}},x:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ol(o);case"xxxx":case"xx":return Ll(o);case"xxxxx":case"xxx":default:return Ll(o,":")}},O:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nl(o,":");case"OOOO":default:return"GMT"+Ll(o,":")}},z:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nl(o,":");case"zzzz":default:return"GMT"+Ll(o,":")}},t:function(e,t,n,l){return Dl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Dl((l._originalDate||e).getTime(),t.length)}};function Nl(e,t){var n=e>0?"-":"+",l=Math.abs(e),o=Math.floor(l/60),i=l%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+Dl(i,2)}function Ol(e,t){return e%60==0?(e>0?"-":"+")+Dl(Math.abs(e)/60,2):Ll(e,t)}function Ll(e,t){var n=t||"",l=e>0?"-":"+",o=Math.abs(e);return l+Dl(Math.floor(o/60),2)+n+Dl(o%60,2)}function Il(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 wl(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:wl,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],o=l[1],i=l[2];if(!i)return Il(e,t);switch(o){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}}",Il(o,t)).replace("{{time}}",wl(i,t))}},Pl=["D","DD"],Rl=["YY","YYYY"];function Fl(e){return-1!==Pl.indexOf(e)}function Bl(e){return-1!==Rl.indexOf(e)}function Ml(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 Ul=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wl=/^'([^]*?)'?$/,Hl=/''/g,jl=/[a-zA-Z]/;function zl(e,t,n){nl(2,arguments);var l=String(t),o=n||{},i=o.locale||gl,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:tl(a),u=null==o.firstWeekContainsDate?r:tl(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=i.options&&i.options.weekStartsOn,c=null==s?0:tl(s),d=null==o.weekStartsOn?c:tl(o.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var m=ll(e);if(!rl(m))throw new RangeError("Invalid time value");var v=il(m),p=hl(m,v),f={firstWeekContainsDate:u,weekStartsOn:d,locale:i,_originalDate:m},E=l.match(kl).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,xl[t])(e,i.formatLong,f):e}).join("").match(Ul).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return Vl(n);var a=Tl[l];if(a)return!o.useAdditionalWeekYearTokens&&Bl(n)&&Ml(n,t,e),!o.useAdditionalDayOfYearTokens&&Fl(n)&&Ml(n,t,e),a(p,n,i.localize,f);if(l.match(jl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function Vl(e){return e.match(Wl)[1].replace(Hl,"'")}const Gl=e=>{var o,a;const{register:u,control:s,setValue:c,getValues:d,reset:m,formState:v}=r.useFormContext(),{t:p}=i.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==v||null===(o=v.errors)||void 0===o||null===(a=o.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;c("applicationNo",null),c("sourceRefId",null),c("mobileNumber",null),c("nocType",null==E||null===(t=E[0])||void 0===t?void 0:t.code),c("offset",0),c("limit",10),c("sortBy","commencementDate"),c("sortOrder","DESC"),c("isSubmitSuccessful","false"),m({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),c("offset",d("offset")-d("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"))))},Yl=["currentlyActiveMobileModal"],ql=["currentlyActiveMobileModal"],Kl=e=>{var o,a;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:c,data:v,onSubmit:p}=e;const{t:f}=i.useTranslation(),{handleSubmit:E}=r.useFormContext(),[g,h]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),_=()=>{h({type:"remove"})},S=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_},l.createElement(t.CloseSvg,null)),b=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,o=m(e,Yl);const{closeMobilePopupModal:i}=o;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,o,l.createElement(S,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:i}));default:return l.createElement("span",null)}})(d({currentlyActiveMobileModal:n},m(e,ql)))},[g]);return c?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:()=>h({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(b,{onSubmit:e=>{h({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:_})):null,null!=v&&null!==(o=v[0])&&void 0!==o&&o.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==v||null===(a=v[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")}))},Xl=e=>{let{columns:o,SearchFormFieldsComponent:a,onSubmit:u,data:s,isLoading:c,Count:d}=e;const{handleSubmit:m,setValue:v,getValues:p}=r.useFormContext();null==p("offset")&&v("offset",0),null==p("limit")&&v("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=i.useTranslation(),h=()=>{v("offset",d&&10*Math.ceil(d/10)-p("limit")),m(u)()},_=()=>{v("offset",0),m(u)()},S=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function b(e){v("limit",Number(e.target.value)),m(u)()}function A(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function y(){v("offset",Number(p("offset"))-Number(p("limit"))),m(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return c?l.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},g(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:g,data:s,columns:o,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:b,currentPage:f,onNextPage:A,onPrevPage:y,pageSizeLimit:Number(p("limit")),onSort:S,totalRecords:d,disableSort:!1,onLastPage:h,onFirstPage:_,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},l.createElement(a,{onSubmit:u,handleSubmit:m,isMobileView:!1})),l.createElement(C,null))},$l={step:1,isValid:!1,formData:{}},Jl=function(e,t){switch(void 0===e&&(e=$l),t.type){case"UPDATE_NOCNewApplication_FORM":return d({},e,{formData:d({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return d({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return $l;default:return e}},Ql=["path","url"],Zl=[],eo=()=>{var e,n;const a=o.useRouteMatch(),{path:r}=a,u=(m(a,Ql),i.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm")),s=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen");return l.createElement("span",{className:"noc-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(c=Zl)&&(c=[]),c.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:r+"/new-application",component:u}),l.createElement(t.PrivateRoute,{path:r+"/response/:id",component:s}))));var c},to=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:a}=i.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"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),o.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(d)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#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===d?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},a(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},no=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<r.length?d():o===r.length&&n()}function c(){o>1&&m()}const d=()=>a(o+1),m=()=>a(o-1);return l.createElement(to,{currentStep:o,nextStep:d,prevStep:m,stepsList:r},(()=>{var e,t;const n=r[o-1],{component:i,key:a,texts:d,currStepConfig:m}=n,v=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(i);return l.createElement(l.Fragment,null,l.createElement(v,{config:{key:a,texts:d,component:i,currStepNumber:o,currStepConfig:m},onGoNext:s,onBackClick:c,t:u}))})())},lo=[{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"}]}],oo=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),io=[{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=>d({},e,{currStepConfig:lo.filter(t=>t.stepNumber===e.stepNumber)})),ao=e=>{var o,i,a,r,u;const{t:s,currentStepData:c,Controller:d,control:m,setValue:v,errors:p,errorStyle:f}=e,E=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:g}=Digit.Hooks.obps.useMDMS(E,"common-masters",["GenderType"]);let h=[];return 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;v(t,n)})},[c,v]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_APPLICANT_DETAILS")),l.createElement("div",null,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(d,{control:m,name:"applicantOwnerOrFirmName",rules:{required:s("REQUIRED_FIELD"),minLength:{value:4,message:s("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:s("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:s})}))),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(d,{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,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),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(d,{control:m,name:"applicantFatherHusbandName",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.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{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.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:s})}))),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_APPLICANT_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantAddress",rules:{required:s("REQUIRED_FIELD"),minLength:{value:4,message:s("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:s("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: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(d,{control:m,name:"applicantDateOfBirth",rules:{required:s("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth(),i=t.getDate()-n.getDate();return l>=18||18===l&&(o>0||0===o&&i>=0)||s("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0]})}))),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(d,{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})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(u=p.applicantGender)||void 0===u?void 0:u.message)||"")))},ro=e=>{var o,i,a,r,u,s,c;const{t:d,currentStepData:m,Controller:v,control:p,setValue:f,errors:E,errorStyle:g}=e,h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",m);const e=null==m?void 0:m.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[m,f]);const{data:_}=Digit.Hooks.noc.useTenants(),[S,b]=n.useState(_);return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},d("NOC_PROFESSIONAL_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+d("NOC_PROFESSIONAL_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalName",defaultValue:null==h||null===(o=h.info)||void 0===o?void 0:o.name,rules:{required:d("REQUIRED_FIELD"),minLength:{value:4,message:d("MIN_4_CHARACTERS_REQUIRED")},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)},t:d,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},null!=E&&E.professionalName?E.professionalName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_PROFESSIONAL_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalEmailId",defaultValue:null==h||null===(i=h.info)||void 0===i?void 0:i.emailId,rules:{required:d("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:d("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:d,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},(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"},""+d("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalRegId",rules:{required:d("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d})}))),l.createElement(t.CardLabelError,{style:g},(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"},""+d("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalMobileNumber",defaultValue:null==h||null===(u=h.info)||void 0===u?void 0:u.mobileNumber,rules:{required:d("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:d("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:d,disable:"true"})}))),l.createElement(t.CardLabelError,{style:g},(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"},""+d("NOC_PROFESSIONAL_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalAddress",rules:{required:d("REQUIRED_FIELD"),minLength:{value:4,message:d("MIN_4_CHARACTERS_REQUIRED")},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)},t:d})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(c=E.professionalAddress)||void 0===c?void 0:c.message)||""))},uo=e=>{var o,i,a,r,u,s,c,m,v,p,f,E,g,h,_;Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),{t:b,currentStepData:A,Controller:y,control:C,setValue:D,errors:T,errorStyle:N,useFieldArray:O,watch:L}=e,[I,w]=n.useState("0.00"),{fields:x,append:P,remove:R}=O({control:C,name:"floorArea"}),F=L("floorArea"),B=L("basementArea");n.useEffect(()=>{const e=null==F?void 0:F.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(B)?0:B,n=(e+parseFloat(t)).toFixed(2);w(n),D("totalFloorArea",n)},[F,B]);const[M,U]=n.useState((null==A||null===(o=A.siteDetails)||void 0===o?void 0:o.ulbName)||null),[k,W]=n.useState((null==A||null===(i=A.siteDetails)||void 0===i?void 0:i.ulbType)||""),[H,j]=n.useState((null==A||null===(a=A.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:z,isLoading:V}=Digit.Hooks.noc.useBuildingType(S),{data:G,isLoading:Y}=Digit.Hooks.noc.useRoadType(S),{data:q,isLoading:K}=Digit.Hooks.useTenants(),X=null==q?void 0:q.map(e=>d({},e,{displayName:b(e.i18nKey)}));n.useEffect(()=>{if(M){var e;const t=null==M||null===(e=M.city)||void 0===e?void 0:e.ulbType;W(t),D("ulbType",t)}},[M,D]);const[$,J]=n.useState((null==A||null===(r=A.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),Q=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Z=Digit.Hooks.noc.useTenants(),[ee,te]=n.useState(Z),[ne,le]=n.useState((null==A||null===(u=A.siteDetails)||void 0===u?void 0:u.district)||null),[oe,ie]=n.useState([]),{data:ae}=Digit.Hooks.useBoundaryLocalities(null==ne?void 0:ne.code,"revenue",{enabled:!!ne},b);return n.useEffect(()=>{(null==ae?void 0:ae.length)>0&&ie(ae)},[ae]),n.useEffect(()=>{ie([]),D("zone",null)},[ne]),n.useEffect(()=>{const e=null==A?void 0:A.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&D(t,n)}),Array.isArray(e.floorArea))){for(let e=x.length-1;e>=0;e--)R(e);e.floorArea.forEach(e=>{P({value:e.value||""})})}},[A,D,P,R]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},b("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"plotNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},null!=T&&T.plotNo?T.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"proposedSiteAddress",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:200,message:b("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:N},null!=T&&T.proposedSiteAddress?T.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ULB_NAME_LABEL"),"*"),!K&&l.createElement(y,{control:C,name:"ulbName",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{U(t),e.onChange(t)},selected:e.value,option:X,optionKey:"displayName"})})),l.createElement(t.CardLabelError,{style:N},null!=T&&T.ulbName?T.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:k||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"},""+b("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"khasraNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},(null==T||null===(s=T.khasraNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"hadbastNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},(null==T||null===(c=T.hadbastNo)||void 0===c?void 0:c.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ROAD_TYPE_LABEL"),"*"),!Y&&l.createElement(y,{control:C,name:"roadType",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:G,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:N},(null==T||null===(m=T.roadType)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"areaLeftForRoadWidening",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},(null==T||null===(v=T.areaLeftForRoadWidening)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL")),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"netPlotAreaAfterWidening",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"roadWidthAtSite",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},null!=T&&T.roadWidthAtSite?T.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_BUILDING_STATUS_LABEL"),"*"),!V&&l.createElement(y,{control:C,name:"buildingStatus",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{j(t),e.onChange(t)},selected:e.value,option:z,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:N},(null==T||null===(p=T.buildingStatus)||void 0===p?void 0:p.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(y,{control:C,name:"isBasementAreaAvailable",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{J(t),e.onChange(t)},selected:e.value,option:Q,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:N},(null==T||null===(f=T.isBasementAreaAvailable)||void 0===f?void 0:f.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&"YES"===(null==$?void 0:$.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"basementArea",rules:{required:b("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:b("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:b("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:N},null!=T&&T.basementArea?T.basementArea.message:""),"BUILTUP"===(null==H?void 0:H.code)&&x.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*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(y,{control:C,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:b("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:b("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var o,i;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==T||null===(o=T.floorArea)||void 0===o||null===(i=o[n])||void 0===i?void 0:i.value)&&l.createElement(t.CardLabelError,{className:N},T.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>R(n)},"❌")))),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement("button",{type:"button",onClick:()=>P({value:""})},"➕ Add Floor"),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_TOTAL_FLOOR_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"totalFloorArea",defaultValue:I,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"},""+b("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"wardNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},(null==T||null===(E=T.wardNo)||void 0===E?void 0:E.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_DISTRICT_LABEL"),"*"),l.createElement(y,{control:C,name:"district",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{le(t),e.onChange(t)},selected:e.value,option:ee.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name"})})),l.createElement(t.CardLabelError,{style:N},(null==T||null===(g=T.district)||void 0===g?void 0:g.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ZONE_LABEL"),"*"),l.createElement(y,{control:C,name:"zone",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:oe,optionKey:"i18nkey"})})),l.createElement(t.CardLabelError,{style:N},(null==T||null===(h=T.zone)||void 0===h?void 0:h.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"villageName",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("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:N},(null==T||null===(_=T.villageName)||void 0===_?void 0:_.message)||"")),l.createElement(t.BreakLine,null)))},so=e=>{var o;const{t:i,currentStepData:a,Controller:r,control:u,setValue:s,errors:c,errorStyle:d}=e,m=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[v,p]=n.useState((null==a||null===(o=a.siteDetails)||void 0===o?void 0:o.specificationBuildingCategory)||[]),{data:f,isLoading:E}=Digit.Hooks.noc.useBuildingCategory(m);return n.useEffect(()=>{console.log("currentStepData4",a);const e=null==a?void 0:a.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;s(t,n)})},[a,s]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,i("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_PLOT_AREA_JAMA_BANDI_LABEL")),l.createElement("div",{className:"field"},l.createElement(r,{control:u,name:"specificationPlotArea",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:i})}))),l.createElement(t.CardLabelError,{style:d},null!=c&&c.specificationPlotArea?c.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_BUILDING_CATEGORY_LABEL"),"*"),!E&&f.length>0&&l.createElement(r,{control:u,name:"specificationBuildingCategory",rules:{required:i("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:f,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:d},null!=c&&c.specificationBuildingCategory?c.specificationBuildingCategory.message:"")))};function co(e){var o;let{t:i,document:a,setDocuments:r,setError:u,documents:s,action:m,formData:v,handleSubmit:p,id:f}=e;const E=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],[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(E?d({},E,{active:!0===(null==a?void 0:a.active),code:null==E?void 0:E.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[_,S]=n.useState(null),[b,A]=n.useState(()=>(null==E?void 0:E.filestoreId)||null);function y(e){const t=e.target.files[0];S(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{c.getData(e,function(){const e=c.getTag(this,"GPSLatitude"),n=c.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&n){const l=I(e).toFixed(2),o=I(n).toFixed(2);t({latitude:l,longitude:o})}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?(sessionStorage.setItem("Latitude1",e.latitude),sessionStorage.setItem("Longitude1",e.longitude)):(sessionStorage.removeItem("Latitude1"),sessionStorage.removeItem("Longitude1"),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(sessionStorage.setItem("Latitude2",e.latitude),sessionStorage.setItem("Longitude2",e.longitude)):(sessionStorage.removeItem("Latitude2"),sessionStorage.removeItem("Longitude2"),alert("Please upload a photo with location details.")))})}const{dropdownData:C}=a;var D=C;const[T,N]=n.useState(!1),[O,L]=n.useState(!1);function I(e){return e[0]+e[1]/60+e[2]/3600}return n.useEffect(()=>{null!=g&&g.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==b?void 0:b.length)||null===b?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==b))||[],{documentType:null==g?void 0:g.code,filestoreId:b,documentUid:b,documentAttachment:b}]})},[b,g]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),n.useEffect(()=>{if("update"===m){var e,t;const n=null==v||null===(e=v.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=D.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return d({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(h(l),A(null==n?void 0:n.fileStoreId)):N(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||h({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(_){L(!0);const e=function(){if(_.size>=5242880)L(!1),u(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return A(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",_,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;L(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?A(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):u(i("CS_FILE_UPLOAD_ERROR"))})},function(){L(!1),u(i("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.useEffect(()=>{T&&A(null)},[T]),l.createElement("div",{style:{marginBottom:"24px"}},O&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"100%"},option:D.map(e=>{var t;return d({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:i})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),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:y,onDelete:()=>{A(null)},id:f,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!b}:{onUpload:y,onDelete:()=>{A(null)},id:f,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!b}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(sessionStorage.getItem("Latitude1")&&sessionStorage.getItem("Longitude1")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude1")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude1"))):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(sessionStorage.getItem("Latitude2")&&sessionStorage.getItem("Longitude2")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude2")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude2"))):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details.")))))}const mo=e=>{let{width:t=20,height:n=20,style:o}=e;return l.createElement("svg",{style:o,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 vo(e){var t;let{value:n={}}=e;const{t:o}=i.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),l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",o=(null==l?void 0:l.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i}(a.pdfFiles,null==e?void 0:e.documentAttachment);return l.createElement("a",{target:"_",href:n,style:{minWidth:"100px",marginRight:"10px"},key:t},l.createElement(mo,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",textAlign:"center"}},o(null==e?void 0:e.documentType.replace(".","_").toUpperCase())))}))))}const po=l.memo(function(e){var o,i,a;let{t:r,document:u,setDocuments:s,documents:m,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",m);const g=(null==m?void 0:m.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",g);const h=Digit.ULBService.getStateId(),[_,S]=n.useState(g?d({},g,{active:!0,code:null==g?void 0:g.documentType,i18nKey:null==g?void 0:g.documentType}):(null==u||null===(o=u.dropdownData)||void 0===o?void 0:o.length)>0?null==u?void 0:u.dropdownData[0]:{}),[b,A]=n.useState(null),[y,C]=n.useState(()=>(null==m?void 0:m.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,T]=n.useState([]),[N,O]=n.useState([]),[L,I]=n.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===_.code))),[w,x]=n.useState(null),[P,R]=n.useState(null);function F(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==m?void 0:m.length)>0&&E()},[m]),n.useEffect(()=>{N.length>0&&null!=_&&_.code&&(s(e=>{if(null===y||null==(null==y?void 0:y.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==y.fileStoreId);let n=[];return N&&N.map((e,t)=>{var l,o;n.push({documentType:null==_?void 0:_.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==_?void 0:_.code.split(".").slice(0,2).join("_"),latitude:w,longitude:P},documentUid:e.fileStoreId,fileName:(null===(l=L[t])||void 0===l?void 0:l.name)||"",id:m?null===(o=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===o?void 0:o.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),O([])),null!=_&&_.code&&s(e=>{var t;return null===y||null==(null==y?void 0:y.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,o,i;(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==_||null===(l=_.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==_||null===(o=_.code)||void 0===o?void 0:o.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==_?void 0:_.code),null!=e&&null!==(i=e.file)&&void 0!==i&&i.documentType&&(e.file.documentType=null==_?void 0:_.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==y.fileStoreId),{documentType:null==_?void 0:_.code,fileStoreId:y.fileStoreId,documentUid:y.fileStoreId,fileName:(null==b?void 0:b.name)||y.fileName||"document",id:m?null===(t=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===t?void 0:t.id:void 0}]})},[y,_]),n.useEffect(()=>{_.code||null===y||O([...N,y])},[y]);const B=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",v);let n=[];return null==v||null===(e=v.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===_.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:h}}])),console.log("selectedUplDocs here",n),n},[v]);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:h,getFormState:function(e){let t,n,l=_.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{c.getData(e,function(){const e=c.getTag(this,"GPSLatitude"),n=c.getTag(this,"GPSLongitude");if(e&&n){const l=F(e),o=F(n);t({latitude:l,longitude:o})}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(o=>{var i,a,r;console.log("Latitude:",o.latitude),console.log("Longitude:",o.longitude),x(o.latitude),R(o.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==o.latitude&&null!==o.longitude?(sessionStorage.setItem("Latitude",o.latitude),sessionStorage.setItem("Longitude",o.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==v||null===(i=v.documents)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.filter(e=>e.documentType===_.code),T(n);let c=[];null==e||e.map((e,t)=>{var n,l,i,a;c.push({documentType:null==_?void 0:_.code,additionalDetails:{category:null==_?void 0:_.code.split(".").slice(0,2).join("_"),latitude:o.latitude,longitude:o.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===(i=e[1].fileStoreId)||void 0===i?void 0:i.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:m?null===(a=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===a?void 0:a.id:void 0})});const d=[...m.filter(e=>e.documentType!==l),...c];s(d),null===(r=n)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=l,function(e,t){e&&A(e.file),e&&I([...L,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...m.filter(e=>e.documentType!==l)];s(e)}},setuploadedstate:B,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(gn,{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)," ")))}),fo=e=>{let{matchPath:n}=e;const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const s=[{link:n+"/noc/new-application",i18nKey:o("NOC_NEW_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_NOC"),links:s,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Eo=e=>{let{stateCode:n,userType:i,tenants:a}=e;const{path:r}=o.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"===i?l.createElement(eo,null):l.createElement(bt,{path:r,stateCode:n})},go={NOCModule:Eo,NOCCard:()=>{var e,a;const{t:r}=i.useTranslation(),u=o.useLocation(),s=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const c={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:m,data:{totalCount:v,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:s,filters:d({},c),config:{enabled:(null==c||null===(e=c.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 g=n.useMemo(()=>({Icon:l.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:m?"":v,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:m?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:v,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[m,v]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,g):null},NOCLinks:fo,NOCApplicationOverview:()=>{var e,a,r,u,s,c,m,f,E;const{id:g}=o.useParams(),{t:h}=i.useTranslation(),_=Digit.ULBService.getCurrentTenantId(),S=null==_?void 0:_.split(".")[0],[b,A]=n.useState({}),[y,C]=n.useState(null),D={},[T]=n.useState(()=>(null==D?void 0:D.fileStoreId)||null),[N,O]=n.useState(null),[L,I]=n.useState([]),[w,x]=n.useState([]),[P,R]=n.useState([]),[F,B]=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(S,"NOC",["DocumentTypeMapping"]),{data:q}=Digit.Hooks.obps.useMDMS(S,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(h,_,{applicationNo:g}),{mutate:$}=Digit.Hooks.noc.useNOCApplicationActions(_),J=Digit.Hooks.useWorkflowDetails({tenantId:_,id:g,moduleCode:"NOC"});var Q,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===(Q=J.data)||void 0===Q?void 0:Q.initialActionState)||d({},null==J||null===(Z=J.data)||void 0===Z?void 0:Z.actionState)||{},J.data.actionState=d({},J.data)),n.useEffect(()=>{x([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;R(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;B(null==q||null===(e=q["common-masters"])||void 0===e?void 0:e.DocumentType)},[q]),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 o=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!=o&&null!==(n=o[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(o[0].docTypes[0].nocType=o[0].nocType,o[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(o[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],F.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,F]),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:o,nocDataDetails:i,nocDocumentsList:a}=e;if(null!=i&&i.length&&null!=a&&a.length&&null!=(null==i?void 0:i[0])){var r,u,s,c,d,m,f,E,g,h,_,S,b,A,y,C,D,T,I,w;const e="WF_"+(null==i||null===(r=i[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==i||null===(u=i[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"}},""+o("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:""+o("NOC_"+(null==i||null===(c=i[0])||void 0===c?void 0:c.nocType)+"_APPLICATION_LABEL"),text:o(null==i||null===(d=i[0])||void 0===d?void 0:d.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_STATUS_LABEL"),text:o(e)||"NA",textStyle:"APPROVED"==(null==i||null===(m=i[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==i||null===(f=i[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_SUBMITED_ON_LABEL"),text:null!=i&&null!==(E=i[0])&&void 0!==E&&null!==(g=E.additionalDetails)&&void 0!==g&&g.SubmittedOn?v(Number(null==i||null===(h=i[0])||void 0===h||null===(_=h.additionalDetails)||void 0===_?void 0:_.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVAL_NO_LABEL"),text:(null==i||null===(S=i[0])||void 0===S?void 0:S.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?v(Number(null==i||null===(b=i[0])||void 0===b||null===(A=b.auditDetails)||void 0===A?void 0:A.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("Documents"),text:""})),null!=i&&null!==(y=i[0])&&void 0!==y&&y.documents&&(null==i||null===(C=i[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==i||null===(D=i[0])||void 0===D||null===(T=D.documents)||void 0===T?void 0:T.map((e,n)=>{var i,r;return l.createElement("a",{target:"_",href:null===(i=k[e.fileStoreId])||void 0===i?void 0:i.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"}},o("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,o("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==L?void 0:L.map((e,t)=>l.createElement(Qn,{key:t,document:e,t:o,error:N,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:""+h(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;A(d({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:h,data:X,nocDataDetails:w,nocDocumentsList:L})}]})),V(!1)}},[X,L,w,T,H,k]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},h("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(Jn,{applicationDetails:b,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:$,workflowDetails:J,businessService:null!=J&&null!==(s=J.data)&&void 0!==s&&s.applicationBusinessService?null==J||null===(c=J.data)||void 0===c?void 0:c.applicationBusinessService:null==X||null===(m=X.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:y,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}=i.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c={},m={moduleName:"noc-services",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},v={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:m,searchForm:c,tableForm:v},[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,h]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",d({},e,{searchForm:t.data})),d({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",d({},e,{filterForm:t.data})),d({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",d({},e,{tableForm:t.data})),d({},e,{tableForm:t.data})}},E),{data:_,isLoading:S}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},u),{isLoading:b,data:{statuses:A,totalCount:y}={}}=Digit.Hooks.noc.useInbox({tenantId:s,filters:d({},g)});let C=[];const D={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"},{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},T=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:o}=e;return l.createElement(Zn,{registerRef:t,searchFormState:n,searchFieldComponents:o})},[]),N=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:o,getFilterFormValue:i}=e;return l.createElement(el,{statuses:A,isInboxLoading:b,registerRef:t,controlFilterForm:n,setFilterFormValue:o,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:_,loadingLocalitiesForEmployeesCurrentTenant:S})},[A,b,_,S]),O={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),h({action:"mutateTableForm",data:d({},v)}),h({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),h({action:"mutateSearchForm",data:c})}},L={FilterFormFields:N,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),h({action:"mutateTableForm",data:d({},v)}),h({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:m,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),h({action:"mutateFilterForm",data:m})}},I=(e=>{var t,a,r,u;let{parentRoute:s,onPageSizeChange:c,formState:m,totalCount:v,table:p,dispatch:f,onSortingByData:E}=e;const{t:g}=i.useTranslation(),h=n.useMemo(()=>[{Header:g("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(o.Link,{to:s+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:o}=e;return null!==(t=o.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(zl(new Date(null===(n=o.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:g("NOC_MODULE_SOURCE_LABEL"),accessor:e=>g("MODULE_"+(null==e?void 0:e.source)),disableSortBy:!0},{Header:g("NOC_STATUS_LABEL"),accessor:e=>g(null==e?void 0:e.status),disableSortBy:!0},{Header:g("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:g("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?g(e):l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:c,currentPage:(null===(t=m.tableForm)||void 0===t?void 0:t.offset)/(null===(a=m.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:d({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:d({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=m.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==m||null===(u=m.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:d({},m.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:d({},m.tableForm,{offset:0})}),data:p,columns:h}})(d({},{parentRoute:a,onPageSizeChange:e=>{h({action:"mutateTableForm",data:d({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:y,table:C,dispatch:h,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===l||h({action:"mutateTableForm",data:d({},g.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),w=(e=>{let{parentRoute:n,table:o}=e;const{t:a}=i.useTranslation();return{data:null==o?void 0:o.map(e=>{let{applicationId:t,date:n,source:l,status:o,owner:i,sla:r}=e;return{[a("NOC_APP_NO_LABEL")]:t,[a("TL_COMMON_TABLE_COL_APP_DATE")]:zl(new Date(n),"dd/MM/yyyy"),[a("NOC_MODULE_SOURCE_LABEL")]:a("MODULE_"+l),[a("NOC_STATUS_LABEL")]:a(o),[a("WF_INBOX_HEADER_CURRENT_OWNER")]:i,[a("ES_INBOX_SLA_DAYS_REMAINING")]:a(r)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:a("NOC_APP_NO_LABEL"),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:o,value:i}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{o(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:a,table:C}),x={onMobileSortOrderData:e=>{const{sortOrder:t}=e;h({action:"mutateTableForm",data:d({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),h({action:"mutateTableForm",data:v})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),l.createElement(t.InboxComposer,d({isInboxLoading:b,PropsForInboxLinks:D},O,L,x,{propsForInboxTable:I,propsForInboxMobileCards:w,formState:g})))},NOCSearchApplication:e=>{let{t:t,onSubmit:a,data:u,error:s,isLoading:c,Count:d}=e;const[m,v]=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}=i.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(o.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,o;return t(e((null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.currentOwner)&&""+(null==n||null===(o=n.additionalDetails)||void 0===o?void 0:o.currentOwner)||"-"))},disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,l,o;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===(o=e.additionalDetails)||void 0===o?void 0:o.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return l.createElement(r.FormProvider,p,E?l.createElement(Kl,{SearchFormFieldsComponent:Gl,propsMobileInboxCards:g,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(Xl,{columns:f,SearchFormFieldsComponent:Gl,onSubmit:a,data:u,error:s,isLoading:c,Count:d}))},NewNOCStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),a=s.useDispatch(),[r,u]=n.useState(null),c=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(no,{stepsList:io,onSubmit:e=>{console.log("dataGet===",e)},step:c,setStep:e=>{a((e=>({type:"SET_NOCNewApplication_STEP",payload:e}))(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var o,a,u;let{config:c,onGoNext:m,onBackClick:v}=e;const p=s.useDispatch(),{t:f}=i.useTranslation(),[E,g]=n.useState(null),[h,_]=n.useState(""),S=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),b=Digit.UserService.getUser(),{control:A,handleSubmit:y,setValue:C,formState:{errors:D},trigger:T}=r.useForm(),N={Controller:r.Controller,control:A,setValue:C,errors:D,trigger:T,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}};function O(e){p(oo(c.key,e)),m()}function L(e){v(c.key,e)}const[I,w]=n.useState((null==S||null===(o=S.applicationDetails)||void 0===o?void 0:o.isRegisteredStakeHolder)||!1),x=Digit.ULBService.getStateId(),[P,R]=n.useState(!1),F=null==b||null===(a=b.info)||void 0===a||null===(u=a.roles)||void 0===u?void 0:u.map(e=>e.code),{data:B,isLoading:M}=Digit.Hooks.obps.useMDMS(x,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!M){var e,t;let n=[];null==B||null===(e=B.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)&&w(!0)})}},[M]),n.useEffect(()=>{var e;null!=S&&null!==(e=S.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&C("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:y(e=>{T(),D.length>0?console.log("Plz fill mandatory fields in Step1"):O(e)})},l.createElement("div",{className:"employeeCard"},I?l.createElement(l.Fragment,null,l.createElement(ro,d({onGoBack:L,goNext:O,currentStepData:S,t:f},N)),l.createElement(ao,d({onGoBack:L,goNext:O,currentStepData:S,t:f},N))):l.createElement(l.Fragment,null,l.createElement(ao,d({onGoBack:L,goNext:O,currentStepData:S,t:f},N)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:h,onClose:()=>{g(null),_("")}}))},NewNOCStepFormTwo:e=>{let{config:o,onBackClick:a,onGoNext:u}=e;const{t:c}=i.useTranslation(),m=s.useDispatch(),[v,p]=n.useState(!1),[f,E]=n.useState(""),{control:g,handleSubmit:h,setValue:_,formState:{errors:S},trigger:b,watch:A}=r.useForm({defaultValues:{floorArea:[{value:""}]}}),y=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C={Controller:r.Controller,control:g,setValue:_,errors:S,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:r.useFieldArray,watch:A},D=window.localStorage.getItem("CITIZEN.CITY");function T(e){m(oo(o.key,e)),u()}function N(e){a(o.key,e)}return l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:h(e=>{b(),m(oo(o.key,e)),function(e){try{const t=d({},e);console.log("nocFormData ==>",t),console.log("final Payload here==>",{Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:D,workflow:{action:"INITIATE"},nocDetails:{additionalDetails:t,tenantId:D}}}),setTimeout(()=>{console.log("we are inside setTime out")},1e3),u(),Promise.resolve()}catch(e){return Promise.reject(e)}}(d({},y,{siteDetails:d({},e)}))})},l.createElement("div",{className:"employeeCard"},l.createElement(uo,d({onGoBack:N,goNext:T,currentStepData:y,t:c},C)),l.createElement(so,d({onGoBack:N,goNext:T,currentStepData:y,t:c},C))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:N}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),v&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{p(!1),E("")}}))},NewNOCStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:r}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[m,v]=n.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),g=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){const t=function(e){if(!f){var t,n;const l=(null==E||null===(t=E.NOC)||void 0===t?void 0:t.Documents)||[],o=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],i=l.filter(e=>e.required).map(e=>e.code),a=o.map(e=>e.documentType);return i.filter(e=>!a.includes(e))}}(e);return t.length>0?(v(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(t[0].replace(".","_").toUpperCase())),void d(!0)):sessionStorage.getItem("Latitude1")&&sessionStorage.getItem("Longitude1")&&sessionStorage.getItem("Latitude2")&&sessionStorage.getItem("Longitude2")?void i():(v(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void d(!0))},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!En.isEqual(t,g)),En.isEqual(t,g)||u(oo(o.key,t))},label:r(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{d(!1),v("")}}))},NewNOCStepFormFour:e=>{let{config:i,onGoNext:a,onBackClick:r,t:u}=e;const c=s.useDispatch(),[m,v]=n.useState(!1),[p,f]=n.useState(""),E=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData||{}}),g=(o.useHistory(),window.localStorage.getItem("CITIZEN.CITY"));return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:E,config:i.currStepConfig,onSubmit:function(e){try{return console.log("formData in parent SummaryPage",E),Promise.resolve(function(e){try{console.log("formData inside onSubmit",e);const t=function(e){var t,n;console.log("nocFormData",e);const l={applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:g,workflow:{action:"INITIATE"},nocDetails:{additionalDetails:{applicationDetails:d({},null==e?void 0:e.applicationDetails),siteDetails:d({},null==e?void 0:e.siteDetails)},tenantId:g}};((null==e||null===(t=e.documents)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.documents)||[]).forEach(e=>{l.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})});const o={Noc:d({},l)};return console.log("payload in mapTONOCPayload",o),o}(e);return console.log("finalPayload here==",t),setTimeout(()=>{console.log("we are here in setTimeOut")},1e3),Promise.resolve(!0)}catch(e){return Promise.reject(e)}}(E)).then(function(e){console.log("we reached here finally !!!"),a()})}catch(e){return Promise.reject(e)}},onFormValueChange:function(e,t){En.isEqual(t,E)||c(oo(i.key,t))},label:u(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){r(i.key,e)}}),m&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{v(!1),f("")}}))},NOCApplicantDetails:ao,NOCProfessionalDetails:ro,NOCSiteDetails:uo,NOCSpecificationDetails:so,NOCDocumentsRequired:e=>{var o,i,a;let{t:r,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[m,v]=n.useState(null==c||null===(o=c.documents)||void 0===o?void 0:o.documents),[p,f]=n.useState(null),[E,g]=n.useState(!0),[h,_]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:A}=Digit.Hooks.pt.usePropertyMDMS(S,"NOC",["Documents"]),y=()=>{let e;e=d({},c.documents,{documents:m}),s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==A||null===(e=A.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)}),g("0"!=n&&0!=n||!((null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,b?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:y,onSkip:()=>s(),isDisabled:E,onAdd:function(){}},null==A||null===(i=A.NOC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(co,{key:t,document:e,t:r,error:p,setError:f,setDocuments:v,documents:m,setCheckRequiredFields:_,handleSubmit:y})),p&&l.createElement(t.Toast,{label:p,isDleteBtn:!0,onClose:()=>f(null),error:!0})))},NOCSummary:function(e){var n,i,a,r,u,c,d,m,v,p,f,E,g,h,_,S,b,A,y,C,D,T,N,O,L,I,w,x,P,R,F,B,M,U,k,W,H,j,z,V,G,Y,q,K,X,$,J,Q,Z,ee,te,ne,le;let{formData:oe,t:ie}=e;o.useLocation(),o.useHistory(),s.useDispatch(),console.log("formData in Summary Page",oe);const ae={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},re={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},ue={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},se={fontWeight:"bold",color:"#555"},ce=(e,n)=>l.createElement("div",{style:re},l.createElement(t.CardLabel,{style:se},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let de=null==oe||null===(n=oe.documents)||void 0===n||null===(i=n.documents)||void 0===i?void 0:i.documents;return console.log("documents here in summary",de),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:ue},ie("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_FIRM_OWNER_NAME_LABEL"),null==oe||null===(a=oe.applicationDetails)||void 0===a?void 0:a.applicantOwnerOrFirmName),ce(ie("NOC_APPLICANT_EMAIL_LABEL"),null==oe||null===(r=oe.applicationDetails)||void 0===r?void 0:r.applicantEmailId),ce(ie("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==oe||null===(u=oe.applicationDetails)||void 0===u?void 0:u.applicantFatherHusbandName),ce(ie("NOC_APPLICANT_MOBILE_NO_LABEL"),null==oe||null===(c=oe.applicationDetails)||void 0===c?void 0:c.applicantMobileNumber),ce(ie("NOC_APPLICANT_DOB_LABEL"),null==oe||null===(d=oe.applicationDetails)||void 0===d?void 0:d.applicantDateOfBirth),ce(ie("NOC_APPLICANT_GENDER_LABEL"),null==oe||null===(m=oe.applicationDetails)||void 0===m||null===(v=m.applicantGender)||void 0===v?void 0:v.code),ce(ie("NOC_APPLICANT_ADDRESS_LABEL"),null==oe||null===(p=oe.applicationDetails)||void 0===p?void 0:p.applicantAddress)),(null==oe||null===(f=oe.applicationDetails)||void 0===f?void 0:f.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:ue},ie("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_PROFESSIONAL_NAME_LABEL"),null==oe||null===(E=oe.applicationDetails)||void 0===E?void 0:E.professionalName),ce(ie("NOC_PROFESSIONAL_EMAIL_LABEL"),null==oe||null===(g=oe.applicationDetails)||void 0===g?void 0:g.professionalEmailId),ce(ie("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==oe||null===(h=oe.applicationDetails)||void 0===h?void 0:h.professionalRegId),ce(ie("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==oe||null===(_=oe.applicationDetails)||void 0===_?void 0:_.professionalMobileNumber),ce(ie("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==oe||null===(S=oe.applicationDetails)||void 0===S?void 0:S.professionalAddress))),l.createElement("h2",{style:ue},ie("NOC_SITE_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_PLOT_NO_LABEL"),null==oe||null===(b=oe.siteDetails)||void 0===b?void 0:b.plotNo),ce(ie("NOC_PROPOSED_SITE_ADDRESS"),null==oe||null===(A=oe.siteDetails)||void 0===A?void 0:A.proposedSiteAddress),ce(ie("NOC_ULB_NAME_LABEL"),null==oe||null===(y=oe.siteDetails)||void 0===y||null===(C=y.ulbName)||void 0===C?void 0:C.name),ce(ie("NOC_ULB_TYPE_LABEL"),null==oe||null===(D=oe.siteDetails)||void 0===D?void 0:D.ulbType),ce(ie("NOC_KHASRA_NO_LABEL"),null==oe||null===(T=oe.siteDetails)||void 0===T?void 0:T.khasraNo),ce(ie("NOC_HADBAST_NO_LABEL"),null==oe||null===(N=oe.siteDetails)||void 0===N?void 0:N.hadbastNo),ce(ie("NOC_ROAD_TYPE_LABEL"),null==oe||null===(O=oe.siteDetails)||void 0===O||null===(L=O.roadType)||void 0===L?void 0:L.name),ce(ie("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==oe||null===(I=oe.siteDetails)||void 0===I?void 0:I.areaLeftForRoadWidening),ce(ie("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==oe||null===(w=oe.siteDetails)||void 0===w?void 0:w.netPlotAreaAfterWidening),ce(ie("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==oe||null===(x=oe.siteDetails)||void 0===x?void 0:x.roadWidthAtSite),ce(ie("NOC_BUILDING_STATUS_LABEL"),null==oe||null===(P=oe.siteDetails)||void 0===P||null===(R=P.buildingStatus)||void 0===R?void 0:R.name),ce(ie("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==oe||null===(F=oe.siteDetails)||void 0===F||null===(B=F.isBasementAreaAvailable)||void 0===B?void 0:B.code),"BUILTUP"===(null==oe||null===(M=oe.siteDetails)||void 0===M||null===(U=M.buildingStatus)||void 0===U?void 0:U.code)&&ce(ie("NOC_BASEMENT_AREA_LABEL"),null==oe||null===(k=oe.siteDetails)||void 0===k?void 0:k.basementArea),"BUILTUP"===(null==oe||null===(W=oe.siteDetails)||void 0===W||null===(H=W.buildingStatus)||void 0===H?void 0:H.code)&&(null==oe||null===(j=oe.siteDetails)||void 0===j||null===(z=j.floorArea)||void 0===z?void 0:z.map((e,t)=>ce((e=>0===e?ie("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+ie("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==oe||null===(V=oe.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&ce(ie("NOC_TOTAL_FLOOR_AREA_LABEL"),null==oe||null===(Y=oe.siteDetails)||void 0===Y?void 0:Y.totalFloorArea),ce(ie("NOC_DISTRICT_LABEL"),null==oe||null===(q=oe.siteDetails)||void 0===q||null===(K=q.district)||void 0===K?void 0:K.name),ce(ie("NOC_ZONE_LABEL"),null==oe||null===(X=oe.siteDetails)||void 0===X||null===($=X.zone)||void 0===$?void 0:$.name),ce(ie("NOC_SITE_WARD_NO_LABEL"),null==oe||null===(J=oe.siteDetails)||void 0===J?void 0:J.wardNo),ce(ie("NOC_SITE_VILLAGE_NAME_LABEL"),null==oe||null===(Q=oe.siteDetails)||void 0===Q?void 0:Q.villageName)),l.createElement("h2",{style:ue},ie("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==oe||null===(Z=oe.siteDetails)||void 0===Z?void 0:Z.specificationPlotArea),ce(ie("NOC_BUILDING_CATEGORY_LABEL"),null==oe||null===(ee=oe.siteDetails)||void 0===ee||null===(te=ee.specificationBuildingCategory)||void 0===te?void 0:te.name)),l.createElement("h2",{style:ue},ie("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:ae},Array.isArray(null==oe||null===(ne=oe.documents)||void 0===ne||null===(le=ne.documents)||void 0===le?void 0:le.documents)&&oe.documents.documents.documents.length>0?l.createElement(vo,{value:{workflowDocs:oe.documents.documents.documents}}):l.createElement("div",null,ie("NOC_NO_DOCUMENTS_MSG"))))},NOCDocumentWithLatLong:e=>{var o,i,a;let{t:r,config:u,onSelect:s,formData:c}=e;const m=Digit.ULBService.getStateId(),[v,p]=n.useState((null==c||null===(o=c.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[g,h]=n.useState(!0),[_,S]=n.useState(!1),[b,A]=n.useState(!1),y=gt((null==c?void 0:c.PrevStateDocuments)||[]),{isLoading:C,data:D}=Digit.Hooks.pt.usePropertyMDMS(m,"NOC",["Documents"]),T=()=>{let e;e=d({},c.documents,{documents:v}),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=>v.reduce((t,n)=>{var l,o,i,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(o=l.split("."))||void 0===o?void 0:o[0])+"."+(null==n||null===(i=n.documentType)||void 0===i||null===(a=i.split("."))||void 0===a?void 0:a[1])||t},!1));h(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==v?void 0:v.length)>0))},[v,_]),l.createElement("div",null,C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:T,onSkip:()=>s(),onAdd:function(){}},null==D||null===(i=D.NOC)||void 0===i||null===(a=i.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(po,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:S,formData:c,beforeUploadDocuments:y||[],isNextButtonDisabled:b,setIsNextButtonDisabled:A,handleSubmit:T}))),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!=c&&c.applicationNo?l.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==c?void 0:c.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var n,a,r;const{state:u}=e.location,{t:s}=i.useTranslation(),c=o.useHistory();console.log("state from location",u);const d=null==u||null===(n=u.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0],m=window.localStorage.getItem("CITIZEN.CITY"),v=((null==c||null===(r=c.location)||void 0===r?void 0:r.pathname)||"").split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:s("NDC_"+p(null==d?void 0:d.nocType,".","_")+"_"+p(null==d?void 0:d.applicationStatus,".","_")+"_HEADER"),applicationNumber:v,info:"REJECTED"==(null==d?void 0:d.applicationStatus)?"":s("NOC_"+p(null==d?void 0:d.nocType,".","_")+"_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==d?void 0:d.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==d?void 0:d.applicationStatus)?l.createElement(t.CardText,null,s("NOC_"+p(null==d?void 0:d.nocType,".","_")+"_"+p(null==d?void 0:d.applicationStatus,".","_")+"_SUB_HEADER")):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{c.push("/digit-ui/citizen/noc-home")}}),l.createElement(t.SubmitBar,{label:s("COMMON_MAKE_PAYMENT"),onSubmit:()=>{c.push("/digit-ui/citizen/payment/collect/NOC/"+v+"/"+m)}}))))}};exports.NOCLinks=fo,exports.NOCModule=Eo,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:Jl}),exports.initNOCComponents=()=>{Object.entries(go).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),o=require("react-router-dom"),i=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(),o=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+o}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=[],o=Digit.UserService.getUser().info.roles;return n.map((t,i)=>{let{roles:a}=t;a.map(t=>{o.map(o=>{var a;o.code===t&&l.push(e?null==n||null===(a=n[i])||void 0===a?void 0:a.code:null==n?void 0:n[i])})})}),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]||"",o=(null==l?void 0:l.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i};var h=function(e,t){return e===t||e!=e&&t!=t},S=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1},A=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=S(t,e);return!(n<0||(n==t.length-1?t.pop():A.call(t,n,1),--this.size,0))},b.prototype.get=function(e){var t=this.__data__,n=S(t,e);return n<0?void 0:t[n][1]},b.prototype.has=function(e){return S(this.__data__,e)>-1},b.prototype.set=function(e,t){var n=this.__data__,l=S(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var C=b,y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e,t){return e(t={exports:{}},t.exports),t.exports}var D,O="object"==typeof y&&y&&y.Object===Object&&y,L="object"==typeof self&&self&&self.Object===Object&&self,T=O||L||Function("return this")(),I=T.Symbol,w=Object.prototype,P=w.hasOwnProperty,x=w.toString,R=I?I.toStringTag:void 0,F=Object.prototype.toString,B=I?I.toStringTag:void 0,M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=P.call(e,R),n=e[R];try{e[R]=void 0;var l=!0}catch(e){}var o=x.call(e);return l&&(t?e[R]=n:delete e[R]),o}(e):function(e){return F.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=(D=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",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},q=Y(T,"Map"),K=Y(Object,"create"),X=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function $(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])}}$.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},$.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return X.call(t,e)?t[e]:void 0},$.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:J.call(t,e)},$.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=K&&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(q||C),string:new Z}},ee.prototype.delete=function(e){var t=Q(this,e).delete(e);return this.size-=t?1:0,t},ee.prototype.get=function(e){return Q(this,e).get(e)},ee.prototype.has=function(e){return Q(this,e).has(e)},ee.prototype.set=function(e,t){var n=Q(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 C(e);this.size=t.size}ne.prototype.clear=function(){this.__data__=new C,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 C){var l=n.__data__;if(!q||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,oe=function(){try{var e=Y(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ie=function(e,t,n){"__proto__"==t&&oe?oe(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)||ie(e,t,n)},ue=function(e,t,n,l){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),o?ie(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=N(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?T.Buffer:void 0;e.exports=(o?o.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},Se=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var be=function(e){return function(t){return e(t)}},Ce=N(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&O.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),ye=Ce&&Ce.isTypedArray,Ne=ye?be(ye):function(e){return se(e)&&Se(e.length)&&!!Ae[M(e)]},De=Object.prototype.hasOwnProperty,Oe=function(e,t){var n=fe(e),l=!n&&pe(e),o=!n&&!l&&_e(e),i=!n&&!l&&!o&&Ne(e),a=n||l||o||i,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&&!De.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||he(s,u))||r.push(s);return r},Le=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)},Ie=function(e,t){return function(n){return e(t(n))}},we=Ie(Object.keys,Object),Pe=Object.prototype.hasOwnProperty,xe=function(e){return null!=e&&Se(e.length)&&!k(e)},Re=function(e){return xe(e)?Oe(e):function(e){if(!Te(e))return we(e);var t=[];for(var n in Object(e))Pe.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Fe=Object.prototype.hasOwnProperty,Be=function(e){return xe(e)?Oe(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&&Fe.call(e,l))&&n.push(l);return n}(e)},Me=N(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?T.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=i?i(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,o=null==t?0:t.length,i=0,a=[];++l<o;){var r=t[l];ke.call(e,r)&&(a[i++]=r)}return a}(We(e)))}:Ue,je=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+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,Re,He)},qe=function(e){return Ge(e,Be,Ve)},Ke=Y(T,"DataView"),Xe=Y(T,"Promise"),Je=Y(T,"Set"),$e=Y(T,"WeakMap"),Ze=z(Ke),Qe=z(q),et=z(Xe),tt=z(Je),nt=z($e),lt=M;(Ke&&"[object DataView]"!=lt(new Ke(new ArrayBuffer(1)))||q&&"[object Map]"!=lt(new q)||Xe&&"[object Promise]"!=lt(Xe.resolve())||Je&&"[object Set]"!=lt(new Je)||$e&&"[object WeakMap]"!=lt(new $e))&&(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 Qe:return"[object Map]";case et:return"[object Promise]";case tt:return"[object Set]";case nt:return"[object WeakMap]"}return t});var ot=lt,it=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=Ce&&Ce.isMap,pt=mt?be(mt):function(e){return se(e)&&"[object Map]"==ot(e)},ft=Ce&&Ce.isSet,Et=ft?be(ft):function(e){return se(e)&&"[object Set]"==ot(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,o,i,a){var r,u=1&n,s=2&n,d=4&n;if(l&&(r=i?l(t,o,i,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]&&it.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=ot(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(_e(t))return Me(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!i){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,Be(t),e)}(r,t)):function(e,t){return ue(e,He(e),t)}(t,function(e,t){return e&&ue(t,Re(t),e)}(r,t))}else{if(!_t[v])return i?t:{};r=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return rt(e);case"[object Boolean]":case"[object Date]":return new i(+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 i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,ut.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;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(o){r.add(e(o,n,l,o,t,a))}):pt(t)&&t.forEach(function(o,i){r.set(i,e(o,n,l,i,t,a))});var f=c?void 0:(d?s?qe:Ye:s?Be:Re)(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(o,i){f&&(o=t[i=o]),re(r,i,e(o,n,l,i,t,a))}),r},ht=function(e){return gt(e,5)};const St=e=>{var o,a;const{t:r}=i.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===(o=d[0])||void 0===o?void 0:o.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:S,error:A}=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:A,data:!h&&S&&(null==g||null===(a=g.Noc)||void 0===a?void 0:a.length)>0?g.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},At=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"),Ct=(e,t)=>{var n,l,o,i,a,r,u,s,d,c,v,m,p,f,E,_,g,h,S,A,b,C;let y=[{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===(o=l.applicationDetails)||void 0===o?void 0:o.applicantOwnerOrFirmName},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.applicantEmailId},{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},{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},{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},{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===(S=h.applicantGender)||void 0===S?void 0:S.code},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:null==e||null===(A=e.nocDetails)||void 0===A||null===(b=A.additionalDetails)||void 0===b||null===(C=b.applicationDetails)||void 0===C?void 0:C.applicantAddress}];return{title:t("NOC_APPLICANT_DETAILS"),values:y}},yt=(e,t)=>{var n,l,o,i,a,r,u,s,d,c,v,m,p,f,E,_,g,h,S,A,b,C,y,N,D,O,L,T,I,w,P,x,R,F,B,M,U,k,W,H,j,z,V,G,Y,q,K,X,J,$,Z,Q,ee,te,ne,le,oe,ie,ae,re,ue,se,de,ce,ve,me;let pe=[{title:t("NOC_PLOT_NO_LABEL"),value:null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(o=l.siteDetails)||void 0===o?void 0:o.plotNo},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress},{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},{title:t("NOC_ULB_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?void 0:p.ulbType},{title:t("NOC_KHASRA_NO_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:_.khasraNo},{title:t("NOC_HADBAST_NO_LABEL"),value:null==e||null===(g=e.nocDetails)||void 0===g||null===(h=g.additionalDetails)||void 0===h||null===(S=h.siteDetails)||void 0===S?void 0:S.hadbastNo},{title:t("NOC_ROAD_TYPE_LABEL"),value:null==e||null===(A=e.nocDetails)||void 0===A||null===(b=A.additionalDetails)||void 0===b||null===(C=b.siteDetails)||void 0===C||null===(y=C.roadType)||void 0===y?void 0:y.name},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:null==e||null===(N=e.nocDetails)||void 0===N||null===(D=N.additionalDetails)||void 0===D||null===(O=D.siteDetails)||void 0===O?void 0:O.areaLeftForRoadWidening},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:null==e||null===(L=e.nocDetails)||void 0===L||null===(T=L.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.netPlotAreaAfterWidening},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:null==e||null===(w=e.nocDetails)||void 0===w||null===(P=w.additionalDetails)||void 0===P||null===(x=P.siteDetails)||void 0===x?void 0:x.roadWidthAtSite},{title:t("NOC_DISTRICT_LABEL"),value:null==e||null===(R=e.nocDetails)||void 0===R||null===(F=R.additionalDetails)||void 0===F||null===(B=F.siteDetails)||void 0===B||null===(M=B.district)||void 0===M?void 0:M.name},{title:t("NOC_ZONE_LABEL"),value:null==e||null===(U=e.nocDetails)||void 0===U||null===(k=U.additionalDetails)||void 0===k||null===(W=k.siteDetails)||void 0===W||null===(H=W.zone)||void 0===H?void 0:H.name},{title:t("NOC_SITE_WARD_NO_LABEL"),value:null==e||null===(j=e.nocDetails)||void 0===j||null===(z=j.additionalDetails)||void 0===z||null===(V=z.siteDetails)||void 0===V?void 0:V.wardNo},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:null==e||null===(G=e.nocDetails)||void 0===G||null===(Y=G.additionalDetails)||void 0===Y||null===(q=Y.siteDetails)||void 0===q?void 0:q.villageName},{title:t("NOC_BUILDING_STATUS_LABEL"),value:null==e||null===(K=e.nocDetails)||void 0===K||null===(X=K.additionalDetails)||void 0===X||null===(J=X.siteDetails)||void 0===J||null===($=J.buildingStatus)||void 0===$?void 0:$.name},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:null==e||null===(Z=e.nocDetails)||void 0===Z||null===(Q=Z.additionalDetails)||void 0===Q||null===(ee=Q.siteDetails)||void 0===ee||null===(te=ee.isBasementAreaAvailable)||void 0===te?void 0:te.code}];var fe,Ee,_e,ge,he,Se,Ae,be,Ce,ye;return"BUILTUP"===(null==e||null===(ne=e.nocDetails)||void 0===ne||null===(le=ne.additionalDetails)||void 0===le||null===(oe=le.siteDetails)||void 0===oe||null===(ie=oe.buildingStatus)||void 0===ie?void 0:ie.code)&&pe.push({title:t("NOC_BASEMENT_AREA_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.basementArea}),"BUILTUP"===(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue||null===(se=ue.buildingStatus)||void 0===se?void 0:se.code)&&(null==e||null===(ge=e.nocDetails)||void 0===ge||null===(he=ge.additionalDetails)||void 0===he||null===(Se=he.siteDetails)||void 0===Se||null===(Ae=Se.floorArea)||void 0===Ae||Ae.map((e,n)=>pe.push({title:bt(n,t),value:null==e?void 0:e.value}))),"BUILTUP"===(null==e||null===(de=e.nocDetails)||void 0===de||null===(ce=de.additionalDetails)||void 0===ce||null===(ve=ce.siteDetails)||void 0===ve||null===(me=ve.buildingStatus)||void 0===me?void 0:me.code)&&pe.push({title:t("NOC_TOTAL_FLOOR_AREA_LABEL"),value:null==e||null===(be=e.nocDetails)||void 0===be||null===(Ce=be.additionalDetails)||void 0===Ce||null===(ye=Ce.siteDetails)||void 0===ye?void 0:ye.totalFloorArea}),{title:t("NOC_SITE_DETAILS"),values:pe}},Nt=(e,t)=>{var n,l,o,i,a,r,u;let s=[{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===(o=l.siteDetails)||void 0===o?void 0:o.specificationPlotArea},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:s}},Dt=function(e,t){try{var n;function l(n){return console.log("res here==>",n),{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e?void 0:e.documents.length)>0?e.documents.map((e,l)=>{let o=g(null==n?void 0:n.data,null==e?void 0:e.uuid);return console.log("doc link",o),{title:t((null==e?void 0:e.documentType)||t("CS_NA")),value:E(o,l)||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const o=null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>null==e?void 0:e.uuid),i=(null==o?void 0:o.length)>0;return Promise.resolve(i?Promise.resolve(Digit.UploadServices.Filefetch(o,Digit.ULBService.getStateId())).then(l):l(i))}catch(e){return Promise.reject(e)}},Ot=function(e,t,n){try{var l,o,i,a,r,u;let c;var s;c=window.location.href.includes("employee")?e:(null==e||null===(s=e.Noc)||void 0===s?void 0:s[0])||{},console.log("appData here in DownloadACK",c);let v=[];return null!==(l=c)&&void 0!==l&&null!==(o=l.nocDetails)&&void 0!==o&&null!==(i=o.additionalDetails)&&void 0!==i&&null!==(a=i.applicationDetails)&&void 0!==a&&a.professionalName&&v.push(((e,t)=>{var n,l,o,i,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===(o=l.applicationDetails)||void 0===o?void 0:o.professionalName},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId},{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},{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},{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}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:_}})(c,n)),Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(d=n("ULBGRADE_"+(null==t||null===(r=t.city)||void 0===r?void 0:r.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),d.toLowerCase().split(" ").map(At).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("NOC_REGISTRATION_CERTIFICATE"),applicationNumber:(null===(u=c)||void 0===u?void 0:u.applicationNo)||"NA",details:[...v,Ct(c,n),yt(c,n),Nt(c,n),Dt(c,n)]})}catch(e){return Promise.reject(e)}var d},Lt=e=>{var n,a;const r=o.useLocation(),{pathname:u,state:s}=r,{t:d}=i.useTranslation(),c=o.useHistory(),v=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",v);const{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:f}=m||{},E=u.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:d("NOC_APPLICATION_SUCCESS_HEADER"),applicationNumber:E,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":d(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:d("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=v,t=f.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,d)).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:d("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:d("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{c.push("/digit-ui/employee/noc/inbox")}}))))},Tt=e=>{let{location:n}=e;const{t:o}=i.useTranslation(),a=[{path:"/digit-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:o("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:o("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:o("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:o("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=o.useLocation(),h=(i.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),S=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NOCInbox"),A=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"),C=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("NewNOCEditApplication"),y=window.location.href.includes("/response"),N=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,y?null:l.createElement("div",{style:window.location.href.includes("application-overview")||N?{marginLeft:"10px"}:{}},l.createElement(Tt,{location:g})),l.createElement(o.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:A}),l.createElement(t.PrivateRoute,{path:_+"/edit-application/:id",component:C}),l.createElement(t.PrivateRoute,{path:_+"/inbox",component:e=>l.createElement(S,c({},e,{parentRoute:_}))}),l.createElement(t.PrivateRoute,{path:_+"/search",component:e=>l.createElement(St,c({},e,{parentRoute:_}))}),l.createElement(t.PrivateRoute,{path:_+"/response/:id",component:Lt})))};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 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"})),Rt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xt,null)),Ft=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,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,S]=n.useState({}),[A,b]=n.useState({}),[C,y]=n.useState([]),[N,D]=n.useState(null),[O,L]=n.useState(null),[T,I]=n.useState(null),[w,P]=n.useState(null),[x,R]=n.useState([]),[F,B]=n.useState(null),[M,U]=n.useState(!1);function k(e){L(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&R(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;y(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{P(null);const e=function(){if(O){const e=function(){if(O.size>=5242880)P(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",O,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?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(a("CS_FILE_UPLOAD_ERROR"))})},function(){P(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)}}()},[O]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:o,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+o.action+"_APPLICATION",submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:x,selectedFinancialYear:F,setSelectedFinancialYear:B}):(e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(v||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:d?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:C,selectedApprover:N,setSelectedApprover:D,selectFile:k,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,C,x,F,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Rt,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F: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==F?void 0:F.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||!N?[]:[N],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==O?void 0:O.name,fileStoreId:T}]),d({Property:c({},v,{workflow:t})})}},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},Bt=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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,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,S]=n.useState({}),[A,b]=n.useState([]),[C,y]=n.useState({}),[N,D]=n.useState(null),[O,L]=n.useState(null),[T,I]=n.useState(null),[w,P]=n.useState([]),[x,R]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&P(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:F}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){D(e.target.files[0])}return n.useEffect(()=>{if(p&&F){var e;const t=F["common-masters"].Department;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,o;const i=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)===i);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,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?L(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[N]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.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:i,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:A,selectedApprover:C,setSelectedApprover:y,selectFile:B,uploadedFile:O,setUploadedFile:L,businessService:m}))},[r,A,w,x,O]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bt,{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!=C&&C.uuid?[null==C?void 0:C.uuid]:null,wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:O}]: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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[S,A]=n.useState([]),[b,C]=n.useState({}),[y,N]=n.useState(null),[D,O]=n.useState(null),[L,T]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){N(e.target.files[0])}return n.useEffect(()=>{var e;A(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(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",y,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[y]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==o?void 0:o.action)&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.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:i,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:S,selectedApprover:b,setSelectedApprover:C,selectFile:w,uploadedFile:D,setUploadedFile:O,businessService:m,error:L}))},[r,S,D,L]),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:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]: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)),qt=e=>{var o,i,r,u,s,d,v,m,p,f,E,_;let{t:g,action:h,tenantId:S,closeModal:A,submitAction:b,applicationDetails:C,applicationData:y,businessService:N,workflowDetails:D,blockReason:O}=e;console.log("applicationData",y),console.log("workflowDetails",D),Digit.Hooks.obps.useObpsAPI(null!==(o=y)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(r=i.address)&&void 0!==r&&r.city?null===(u=y)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:S,!1);const{data:L,isLoading:T}=Digit.Hooks.useEmployeeSearch(S,{roles:null==D||null===(v=D.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({})),[P,x]=n.useState({}),[R,F]=n.useState([]),[B,M]=n.useState([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,q]=n.useState(null),[K,X]=n.useState(null),J=!!Digit.Utils.browser.isMobile();function $(e){z(e.target.files[0])}n.useEffect(()=>{var e;F(null==L||null===(e=L.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}}))},[L]),n.useEffect(()=>{!function(){try{q(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)q(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))q(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).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?G(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):q(g("CS_FILE_UPLOAD_ERROR"))})},function(){q(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},Q=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=[],o=[];var i,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),o=o.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)=>{o.push({docs:Z(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",o),o=o.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",o)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},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==O?void 0:O.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),h&&w((e=>{var n,o,i,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:S,businessService:A,error:b,blockReasonFiltered:C}=e,y=!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)||(y=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+A+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||y||"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===(o=c.state)||void 0===o?void 0:o.state)?null:d(S||"WF_ROLE_"+(null===(i=c.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:c.isTerminateState||y||"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:C,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:R,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:$,uploadedFile:V,setUploadedFile:G,businessService:N,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:B}))},[h,R,K,V,Y]),h&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vt,{label:g(I.label.heading)}),headerBarEnd:l.createElement(Yt,{onClick:A}),actionCancelLabel:g(I.label.cancel),actionCancelOnSubmit:A,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,o,i,a,r,u,s,d,v,m,p,f,E,_,S,N,O,L,T,I,w,P,x,R,F,B,M,k,H,z,G,Y,q,K,X,J,$,Z,Q,ne;if(y=c({},y,{documents:null===(t=y)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(n=y)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:ee(y),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===(o=e.comments)||void 0===o?void 0:o.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(i=D.data)||void 0===i||null===(a=i.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==D||null===(s=D.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==D||null===(p=D.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==D||null===(S=D.data)||void 0===S||null===(N=S.processInstances)||void 0===N||null===(O=N[0])||void 0===O||null===(L=O.assigner)||void 0===L?void 0:L.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=y)||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==D||null===(w=D.data)||void 0===w||null===(P=w.processInstances)||void 0===P||null===(x=P[0])||void 0===x||null===(R=x.state)||void 0===R?void 0:R.applicationStatus)?[null==D||null===(F=D.data)||void 0===F||null===(B=F.processInstances)||void 0===B||null===(M=B[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=y)||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=y)||void 0===Y||null===(q=Y.additionalDetails)||void 0===q||null===(K=q.selfCertificationCharges)||void 0===K?void 0:K.BPA_LABOUR_CESS)+parseInt(null===(X=y)||void 0===X||null===(J=X.additionalDetails)||void 0===J||null===($=J.selfCertificationCharges)||void 0===$?void 0:$.BPA_WATER_CHARGES)+parseInt(null===(Z=y)||void 0===Z||null===(Q=Z.additionalDetails)||void 0===Q||null===(ne=Q.selfCertificationCharges)||void 0===ne?void 0:ne.BPA_GAUSHALA_CHARGES_CESS))A(),alert(g("Enterd Less Adjustment amount is invalid"));else{var le,oe;y.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",y.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",y.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",y.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc");const e=null==C||null===(le=C.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===(oe=t.Noc)||void 0===oe||oe.map(e=>{var t,o,i,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.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 o=[];if(e&&e.map(e=>{var t,i,a,r,u,s,d,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(i=t.applicationStatus)||void 0===i?void 0:i.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)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==y.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:y},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(A(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:y},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},Kt=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)),$t=e=>{var i,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===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[g,h]=(a.useQueryClient(),n.useState({})),[S,A]=n.useState({}),[b,C]=n.useState([]),[y,N]=n.useState({}),[D,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(null),P=!!Digit.Utils.browser.isMobile();function x(e){O(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;C(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(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).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?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[D]),n.useEffect(()=>{s&&h((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(f=!0);let E=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==i?void 0:i.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(v||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},showHint:!0,message:d?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:s,approvers:b,selectedApprover:y,setSelectedApprover:N,selectFile:x,uploadedFile:L,setUploadedFile:T,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,b,L,I]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Kt,{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:P?{width:"720px"}:{},style:P?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:P?{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 o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(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]:[];o.map((e,t)=>{i.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!=y&&y.uuid?[null==y?void 0:y.uuid]:null,documents:L?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:L}]:null},documents:i}),m({Noc:p},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Zt=e=>l.createElement("h1",{className:"heading-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"})),en=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qt,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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[S,A]=n.useState([]),[b,C]=n.useState({}),[y,N]=n.useState(null),[D,O]=n.useState(null),[L,T]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function P(e){N(e.target.files[0])}return n.useEffect(()=>{var e;A(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(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",y,Digit.ULBService.getCurrentTenantId())).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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[y]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=v)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?r&&_((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(f=!1),i.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?o("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:o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("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 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:m,error:L})):r&&_((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("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 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:m,error:L}))},[r,S,D,L]),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,o,i,a,s,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,_,g,h,S,A,C,N,O;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===(S=h.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(A=v)&&void 0!==A&&null!==(C=A.applicationType)&&void 0!==C&&C.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(N=v)&&void 0!==N&&null!==(O=N.applicationType)&&void 0!==O&&O.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]: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:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:[]}});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:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]: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:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.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 L;if("DisconnectWSConnection"==(null===(i=v)||void 0===i||null===(a=i.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===(L=v)||void 0===L?void 0:L.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,P,x,R,F,B,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===(P=t.value)||void 0===P?void 0:P.adhocPenaltyComment)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(B=t.value)||void 0===B?void 0:B.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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[S,A]=n.useState([]),[b,C]=n.useState(null),[y,N]=n.useState(null),[D,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){N(e.target.files[0])}return n.useEffect(()=>{var e;A(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(y){const e=function(){if(y.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[y]),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:S,selectedApprover:b,setSelectedApprover:C,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:m}))},[r,S,D]),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],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]),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 o,i,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===(o=f.TradeLicense)||void 0===o?void 0:o.TradeType),console.log("applicationData",v);const[_,g]=n.useState({}),[h,S]=n.useState({}),[A,b]=n.useState([]),[C,y]=n.useState(""),[N,D]=n.useState([]),[O,L]=n.useState(null),T=null===(i=v)||void 0===i||null===(a=i.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:o,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:C,setSelectedApprover:y,businessService:m}))},[u,I,N,O]),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],o="20"+Number(l)+"-"+(Number(l)+1);v=c({},v,{financialYear:o,action:"INITIATE",additionalDetail:c({},v.additionalDetail,{validityYears:C.length>0?parseInt(C):""})}),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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,_]=n.useState({}),[g,h]=n.useState({}),[S,A]=n.useState([]),[b,C]=n.useState(null),[y,N]=n.useState(null),[D,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){w(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;A(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(y){const e=function(){if(y.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",y,u)).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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[y]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{_((e=>{let{t:n,action:o,selectFile:i,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==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.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")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,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:S,selectedApprover:b,setSelectedApprover:C,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:m,isUploading:I}))},[r,S,D]),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};D&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]),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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[g,h]=n.useState({}),[S,A]=n.useState([]),[b,C]=n.useState(null),[y,N]=n.useState(null),[D,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){N(e.target.files[0])}return n.useEffect(()=>{var e;A(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(y){const e=function(){if(y.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",y,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?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[y]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:o,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.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")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,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:S,selectedApprover:b,setSelectedApprover:C,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:m}))},[r,S,D]),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};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,filestoreId:D}]),d({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),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"})),bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(An,null)),Cn=e=>{var i,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===(i=s.roles)||void 0===i||null===(a=i[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=o.useHistory(),[h,S]=n.useState({}),[A,b]=n.useState({}),[C,y]=n.useState([]),[N,D]=n.useState(null),[O,L]=n.useState(null);return n.useEffect(()=>{var e;y(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)):S((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:C,selectedApprover:N,setSelectedApprover:D,uploadedFile:O,setUploadedFile:L,businessService:f}))},[s,C,O]),s&&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==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};O&&(t.documents=[]),m({Asset:c({},p,{workflow:t})})},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},yn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ft,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(qt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement($t,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(Cn,e):void 0;var Nn=N(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[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]",S="[object ArrayBuffer]",A="[object DataView]",b="[object Float32Array]",C="[object Float64Array]",N="[object Int8Array]",D="[object Int16Array]",O="[object Int32Array]",L="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,P=/\b(__p \+=) '' \+/g,x=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,B=RegExp(R.source),M=RegExp(F.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+/,q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^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}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Ce="(?:"+Ae+"|"+Ee+")",ye="(?:"+me+"|"+_e+")?",Ne="[\\ufe0e\\ufe0f]?"+ye+"(?:\\u200d(?:"+[ge,he,Se].join("|")+")[\\ufe0e\\ufe0f]?"+ye+")*",De="(?:"+["[\\u2700-\\u27bf]",he,Se].join("|")+")"+Ne,Oe="(?:"+[ge+me+"?",me,he,Se,"[\\ud800-\\udfff]"].join("|")+")",Le=RegExp("['’]","g"),Te=RegExp(me,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Oe+Ne,"g"),we=RegExp([Ae+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Ae,"$"].join("|")+")",Ce+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Ae+be,"$"].join("|")+")",Ae+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ae+"+(?:['’](?: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,De].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["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"],Fe=-1,Be={};Be[b]=Be[C]=Be[N]=Be[D]=Be[O]=Be[L]=Be["[object Uint8ClampedArray]"]=Be[T]=Be[I]=!0,Be[i]=Be[a]=Be[S]=Be[r]=Be[A]=Be[u]=Be[s]=Be[d]=Be[v]=Be[m]=Be[p]=Be[f]=Be[E]=Be[_]=Be[h]=!1;var Me={};Me[i]=Me[a]=Me[S]=Me[A]=Me[r]=Me[u]=Me[b]=Me[C]=Me[N]=Me[D]=Me[O]=Me[v]=Me[m]=Me[p]=Me[f]=Me[E]=Me[_]=Me[g]=Me[L]=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 y&&y&&y.Object===Object&&y,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,qe=Ye&&He.process,Ke=function(){try{return Ge&&Ge.require&&Ge.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,Je=Ke&&Ke.isDate,$e=Ke&&Ke.isMap,Ze=Ke&&Ke.isRegExp,Qe=Ke&&Ke.isSet,et=Ke&&Ke.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 o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];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 ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(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,o=0,i=[];++n<l;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,o=null==e?0:e.length;++l<o;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}function dt(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e}function ct(e,t,n,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function vt(e,t,n,l){var o=null==e?0:e.length;for(l&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,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=At("length");function ft(e,t,n){var l;return n(e,function(e,n,o){if(t(e,n,o))return l=n,!1}),l}function Et(e,t,n,l){for(var o=e.length,i=n+(l?1:-1);l?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,o=e.length;++l<o;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function gt(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function ht(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?yt(e,t)/n:NaN}function At(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 Ct(e,t,n,l,o){return o(e,function(e,o,i){n=l?(l=!1,e):t(n,e,o,i)}),n}function yt(e,t){for(var n,l=-1,o=e.length;++l<o;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Nt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Ot(e){return function(t){return e(t)}}function Lt(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 Pt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var xt=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"}),Rt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Ue[e]}function Bt(e){return Pe.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,o=e.length,i=0,a=[];++n<o;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[i++]=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 Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Gt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var y=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Re))).Array,q=t.Date,de=t.Error,ce=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,_e=y.prototype,ge=me.prototype,he=t["__core-js_shared__"],Se=ce.prototype.toString,Ae=ge.hasOwnProperty,be=0,Ce=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ye=ge.toString,Ne=Se.call(me),De=ze._,Oe=pe("^"+Se.call(Ae).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,Pe=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=ge.propertyIsEnumerable,qe=_e.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,pt=Pe?Pe.iterator:void 0,bt=Pe?Pe.toStringTag:void 0,qt=function(){try{var e=Zo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=q&&q.now!==ze.Date.now&&q.now,Jt=t.setTimeout!==ze.setTimeout&&t.setTimeout,$t=ve.ceil,Zt=ve.floor,Qt=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=q.now,un=t.parseInt,sn=ve.random,dn=_e.reverse,cn=Zo(t,"DataView"),vn=Zo(t,"Map"),mn=Zo(t,"Promise"),pn=Zo(t,"Set"),fn=Zo(t,"WeakMap"),En=Zo(me,"create"),_n=fn&&new fn,gn={},hn=Oi(cn),Sn=Oi(vn),An=Oi(mn),bn=Oi(pn),Cn=Oi(fn),yn=Pe?Pe.prototype:void 0,Nn=yn?yn.valueOf:void 0,Dn=yn?yn.toString:void 0;function On(e){if(Va(e)&&!xa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Ae.call(e,"__wrapped__"))return Li(e)}return new In(e)}var Ln=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 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 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 Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new xn(e);this.size=t.size}function Mn(e,t){var n=xa(e),l=!n&&Pa(e),o=!n&&!l&&Ma(e),i=!n&&!l&&!o&&Za(e),a=n||l||o||i,r=a?Nt(e.length,fe):[],u=r.length;for(var s in e)!t&&!Ae.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ii(s,u))||r.push(s);return r}function Un(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function kn(e,t){return bi(Eo(e),Kn(t,0,e.length))}function Wn(e){return bi(Eo(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];Ae.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 Qn(e,function(e,o,i){t(l,e,n(e),i)}),l}function Gn(e,t){return e&&_o(t,Sr(t),e)}function Yn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=y(l),i=null==e;++n<l;)o[n]=i?void 0:fr(e,t[n]);return o}function Kn(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,o,a){var s,h=1&t,y=2&t,w=4&t;if(n&&(s=o?n(e,l,o,a):n(e)),void 0!==s)return s;if(!za(e))return e;var P=xa(e);if(P){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ae.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return Eo(e,s)}else{var x=ti(e),R=x==d||x==c;if(Ma(e))return so(e,h);if(x==p||x==i||R&&!o){if(s=y||R?{}:li(e),!h)return y?function(e,t){return _o(e,ei(e),t)}(e,function(e,t){return e&&_o(t,Ar(t),e)}(s,e)):function(e,t){return _o(e,Qo(e),t)}(e,Gn(s,e))}else{if(!Me[x])return o?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case S:return co(e);case r:case u:return new l(+e);case A:return function(e,t){var n=t?co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case C:case N:case D:case O:case L:case"[object Uint8ClampedArray]":case T:case I:return vo(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 Nn?me(Nn.call(e)):{}}}(e,x,h)}}a||(a=new Bn);var F=a.get(e);if(F)return F;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,o){s.set(o,Xn(l,t,n,o,e,a))});var B=P?void 0:(w?y?Go:Vo:y?Ar:Sr)(e);return lt(B||e,function(l,o){B&&(l=e[o=l]),jn(s,o,Xn(l,t,n,o,e,a))}),s}function Jn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var o=n[l],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function $n(e,t,l){if("function"!=typeof e)throw new Ee(n);return gi(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var o=-1,i=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,Ot(n))),l?(i=ut,a=!1):t.length>=200&&(i=Tt,a=!1,t=new Fn(t));e:for(;++o<r;){var d=e[o],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 i(t,c,l)||u.push(d)}return u}On.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:On}},(On.prototype=Tn.prototype).constructor=On,(In.prototype=Ln(Tn.prototype)).constructor=In,(wn.prototype=Ln(Tn.prototype)).constructor=wn,Pn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Pn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Pn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ae.call(t,e)?t[e]:void 0},Pn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Ae.call(t,e)},Pn.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},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return zn(this.__data__,e)>-1},xn.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},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new Pn,map:new(vn||xn),string:new Pn}},Rn.prototype.delete=function(e){var t=Jo(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return Jo(this,e).get(e)},Rn.prototype.has=function(e){return Jo(this,e).has(e)},Rn.prototype.set=function(e,t){var n=Jo(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new xn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(l)}return n.set(e,t),this.size=n.size,this};var Qn=So(rl),el=So(ul,!0);function tl(e,t){var n=!0;return Qn(e,function(e,l,o){return n=!!t(e,l,o)}),n}function nl(e,t,n){for(var l=-1,o=e.length;++l<o;){var i=e[l],a=t(i);if(null!=a&&(void 0===r?a==a&&!$a(a):n(a,r)))var r=a,u=i}return u}function ll(e,t){var n=[];return Qn(e,function(e,l,o){t(e,l,o)&&n.push(e)}),n}function ol(e,t,n,l,o){var i=-1,a=e.length;for(n||(n=oi),o||(o=[]);++i<a;){var r=e[i];t>0&&n(r)?t>1?ol(r,t-1,n,l,o):dt(o,r):l||(o[o.length]=r)}return o}var il=Ao(),al=Ao(!0);function rl(e,t){return e&&il(e,t,Sr)}function ul(e,t){return e&&al(e,t,Sr)}function sl(e,t){return at(t,function(t){return Wa(e[t])})}function dl(e,t){for(var n=0,l=(t=io(t,e)).length;null!=e&&n<l;)e=e[Di(t[n++])];return n&&n==l?e:void 0}function cl(e,t,n){var l=t(e);return xa(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=Ae.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var o=ye.call(e);return l&&(t?e[bt]=n:delete e[bt]),o}(e):function(e){return ye.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Ae.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,o=e[0].length,i=e.length,a=i,r=y(i),u=Infinity,s=[];a--;){var d=e[a];a&&t&&(d=st(d,Ot(t))),u=an(d.length,u),r[a]=!n&&(t||o>=120&&d.length>=120)?new Fn(a&&d):void 0}d=e[0];var c=-1,v=r[0];e:for(;++c<o&&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=i;--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=pi(e,t=io(t,e)))?e:e[Di(ki(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Va(e)&&vl(e)==i}function hl(e,t,n,l,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,o,d){var c=xa(e),h=xa(t),b=c?a:ti(e),C=h?a:ti(t),y=(b=b==i?p:b)==p,N=(C=C==i?p:C)==p,D=b==C;if(D&&Ma(e)){if(!Ma(t))return!1;c=!0,y=!1}if(D&&!y)return d||(d=new Bn),c||Za(e)?jo(e,t,n,l,o,d):function(e,t,n,l,o,i,a){switch(n){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(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=jo(d(e),d(t),l,o,i,a);return a.delete(e),p;case g:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,b,n,l,o,d);if(!(1&n)){var O=y&&Ae.call(e,"__wrapped__"),L=N&&Ae.call(t,"__wrapped__");if(O||L){var T=O?e.value():e,I=L?t.value():t;return d||(d=new Bn),o(T,I,n,l,d)}}return!!D&&(d||(d=new Bn),function(e,t,n,l,o,i){var a=1&n,r=Vo(e),u=r.length;if(u!=Vo(t).length&&!a)return!1;for(var s=u;s--;){var d=r[s];if(!(a?d in t:Ae.call(t,d)))return!1}var c=i.get(e),v=i.get(t);if(c&&v)return c==t&&v==e;var m=!0;i.set(e,t),i.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,i):l(f,E,d,e,t,i);if(!(void 0===_?f===E||o(f,E,n,l,i):_)){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 i.delete(e),i.delete(t),m}(e,t,n,l,o,d))}(e,t,n,l,hl,o))}function Sl(e,t,n,l){var o=n.length,i=o,a=!l;if(null==e)return!i;for(e=me(e);o--;){var r=n[o];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){var u=(r=n[o])[0],s=e[u],d=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var c=new Bn;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 Al(e){return!(!za(e)||(t=e,Ce&&Ce in t))&&(Wa(e)?Oe:oe).test(Oi(e));var t}function bl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?xa(e)?Ol(e[0],e[1]):Dl(e):tu(e)}function Cl(e){if(!di(e))return ln(e);var t=[];for(var n in me(e))Ae.call(e,n)&&"constructor"!=n&&t.push(n);return t}function yl(e,t){return e<t}function Nl(e,t){var n=-1,l=Fa(e)?y(e.length):[];return Qn(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Dl(e){var t=$o(e);return 1==t.length&&t[0][2]?vi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Ol(e,t){return ri(e)&&ci(t)?vi(Di(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):hl(t,l,3)}}function Ll(e,t,n,l,o){e!==t&&il(t,function(i,a){if(o||(o=new Bn),za(i))!function(e,t,n,l,o,i,a){var r=Ei(e,n),u=Ei(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var d=i?i(r,u,n+"",e,t,a):void 0,c=void 0===d;if(c){var v=xa(u),m=!v&&Ma(u),p=!v&&!m&&Za(u);d=u,v||m||p?xa(r)?d=r:Ba(r)?d=Eo(r):m?(c=!1,d=so(u,!0)):p?(c=!1,d=vo(u,!0)):d=[]:qa(u)||Pa(u)?(d=r,Pa(r)?d=ar(r):za(r)&&!Wa(r)||(d=li(u))):c=!1}c&&(a.set(u,d),o(d,u,l,i,a),a.delete(u)),Hn(e,n,d)}}(e,t,a,n,Ll,l,o);else{var r=l?l(Ei(e,a),i,a+"",e,t,o):void 0;void 0===r&&(r=i),Hn(e,a,r)}},Ar)}function Tl(e,t){var n=e.length;if(n)return ii(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return xa(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=st(t,Ot(Xo())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,o=e.criteria,i=t.criteria,a=o.length,r=n.length;++l<a;){var u=mo(o[l],i[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}(Nl(e,function(e,n,o){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,o=t.length,i={};++l<o;){var a=t[l],r=dl(e,a);n(r,a)&&kl(i,io(a,e),r)}return i}function Pl(e,t,n,l){var o=l?gt:_t,i=-1,a=t.length,r=e;for(e===t&&(t=Eo(t)),n&&(r=st(e,Ot(n)));++i<a;)for(var u=0,s=t[i],d=n?n(s):s;(u=o(r,d,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function xl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var o=t[n];if(n==l||o!==i){var i=o;ii(o)?qe.call(e,o,1):$l(e,o)}}return e}function Rl(e,t){return e+Zt(sn()*(t-e+1))}function Fl(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 Bl(e,t){return hi(mi(e,t,Yr),e+"")}function Ml(e){return Un(Tr(e))}function Ul(e,t){var n=Tr(e);return bi(n,Kn(t,0,n.length))}function kl(e,t,n,l){if(!za(e))return e;for(var o=-1,i=(t=io(t,e)).length,a=i-1,r=e;null!=r&&++o<i;){var u=Di(t[o]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var d=r[u];void 0===(s=l?l(d,u,r):void 0)&&(s=za(d)?d:ii(t[o+1])?[]:{})}jn(r,u,s),r=r[u]}return e}var Wl=_n?function(e,t){return _n.set(e,t),e}:Yr,Hl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return bi(Tr(e))}function zl(e,t,n){var l=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=y(o);++l<o;)i[l]=e[l+t];return i}function Vl(e,t){var n;return Qn(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Gl(e,t,n){var l=0,o=null==e?l:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;l<o;){var i=l+o>>>1,a=e[i];null!==a&&!$a(a)&&(n?a<=t:a<t)?l=i+1:o=i}return o}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,r=null===t,u=$a(t),s=void 0===t;o<i;){var d=Zt((o+i)/2),c=n(e[d]),v=void 0!==c,m=null===c,p=c==c,f=$a(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?o=d+1:i=d}return an(i,4294967294)}function ql(e,t){for(var n=-1,l=e.length,o=0,i=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ta(r,u)){var u=r;i[o++]=0===a?0:a}}return i}function Kl(e){return"number"==typeof e?e:$a(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(xa(e))return st(e,Xl)+"";if($a(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Jl(e,t,n){var l=-1,o=rt,i=e.length,a=!0,r=[],u=r;if(n)a=!1,o=ut;else if(i>=200){var s=t?null:Bo(e);if(s)return Wt(s);a=!1,o=Tt,u=new Fn}else u=t?[]:r;e:for(;++l<i;){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 o(u,c,n)||(u!==r&&u.push(c),r.push(d))}return r}function $l(e,t){return null==(e=pi(e,t=io(t,e)))||delete e[Di(ki(t))]}function Zl(e,t,n,l){return kl(e,t,n(dl(e,t)),l)}function Ql(e,t,n,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&t(e[i],i,e););return n?zl(e,l?0:i,l?i+1:o):zl(e,l?i+1:0,l?o:i)}function eo(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 to(e,t,n){var l=e.length;if(l<2)return l?Jl(e[0]):[];for(var o=-1,i=y(l);++o<l;)for(var a=e[o],r=-1;++r<l;)r!=o&&(i[o]=Zn(i[o]||a,e[r],t,n));return Jl(ol(i,1),t,n)}function no(e,t,n){for(var l=-1,o=e.length,i=t.length,a={};++l<o;)n(a,e[l],l<i?t[l]:void 0);return a}function lo(e){return Ba(e)?e:[]}function oo(e){return"function"==typeof e?e:Yr}function io(e,t){return xa(e)?e:ri(e,t)?[e]:Ni(rr(e))}var ao=Bl;function ro(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var uo=Kt||function(e){return ze.clearTimeout(e)};function so(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 co(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function vo(e,t){var n=t?co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,l=null===e,o=e==e,i=$a(e),a=void 0!==t,r=null===t,u=t==t,s=$a(t);if(!r&&!s&&!i&&e>t||i&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!o)return 1;if(!l&&!i&&!s&&e<t||s&&n&&o&&!l&&!i||r&&n&&o||!a&&o||!u)return-1}return 0}function po(e,t,n,l){for(var o=-1,i=e.length,a=n.length,r=-1,u=t.length,s=on(i-a,0),d=y(u+s),c=!l;++r<u;)d[r]=t[r];for(;++o<a;)(c||o<i)&&(d[n[o]]=e[o]);for(;s--;)d[r++]=e[o++];return d}function fo(e,t,n,l){for(var o=-1,i=e.length,a=-1,r=n.length,u=-1,s=t.length,d=on(i-r,0),c=y(d+s),v=!l;++o<d;)c[o]=e[o];for(var m=o;++u<s;)c[m+u]=t[u];for(;++a<r;)(v||o<i)&&(c[m+n[a]]=e[o++]);return c}function Eo(e,t){var n=-1,l=e.length;for(t||(t=y(l));++n<l;)t[n]=e[n];return t}function _o(e,t,n,l){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),o?Yn(n,r,u):jn(n,r,u)}return n}function go(e,t){return function(n,l){var o=xa(n)?nt:Vn,i=t?t():{};return o(n,e,Xo(l,2),i)}}function ho(e){return Bl(function(t,n){var l=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ai(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=me(t);++l<o;){var r=n[l];r&&e(t,r,l,i)}return t})}function So(e,t){return function(n,l){if(null==n)return n;if(!Fa(n))return e(n,l);for(var o=n.length,i=t?o:-1,a=me(n);(t?i--:++i<o)&&!1!==l(a[i],i,a););return n}}function Ao(e){return function(t,n,l){for(var o=-1,i=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++o];if(!1===n(i[u],u,i))break}return t}}function bo(e){return function(t){var n=Bt(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),o=n?ro(n,1).join(""):t.slice(1);return l[e]()+o}}function Co(e){return function(t){return ct(Wr(Pr(t).replace(Le,"")),e,"")}}function yo(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=Ln(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function No(e){return function(t,n,l){var o=me(t);if(!Fa(t)){var i=Xo(n,3);t=Sr(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,l);return a>-1?o[i?t[a]:a]:void 0}}function Do(e){return zo(function(t){var l=t.length,o=l,i=In.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Ee(n);if(i&&!r&&"wrapper"==qo(a))var r=new In([],!0)}for(o=r?o:l;++o<l;){var u=qo(a=t[o]),s="wrapper"==u?Yo(a):void 0;r=s&&ui(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[qo(s[0])].apply(r,s[3]):1==a.length&&ui(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&xa(n))return r.plant(n).value();for(var o=0,i=l?t[o].apply(this,e):n;++o<l;)i=t[o].call(this,i);return i}})}function Oo(e,t,n,l,o,i,a,r,u,s){var d=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:yo(e);return function E(){for(var _=arguments.length,g=y(_),h=_;h--;)g[h]=arguments[h];if(m)var S=Ko(E),A=Pt(g,S);if(l&&(g=po(g,l,o,m)),i&&(g=fo(g,i,a,m)),_-=A,m&&_<s){var b=kt(g,S);return Ro(e,t,Oo,E.placeholder,n,g,b,r,u,s-_)}var C=c?n:this,N=v?C[e]:e;return _=g.length,r?g=fi(g,r):p&&_>1&&g.reverse(),d&&u<_&&(g.length=u),this&&this!==ze&&this instanceof E&&(N=f||yo(N)),N.apply(C,g)}}function Lo(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,o,i){t(l,n(e),o,i)}),l}(n,e,t(l),{})}}function To(e,t){return function(n,l){var o;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(o=n),void 0!==l){if(void 0===o)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Kl(n),l=Kl(l)),o=e(n,l)}return o}}function Io(e){return zo(function(t){return t=st(t,Ot(Xo())),Bl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wo(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,$t(e/jt(t)));return Bt(t)?ro(zt(l),0,e).join(""):l.slice(0,e)}function Po(e){return function(t,n,l){return l&&"number"!=typeof l&&ai(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 o=-1,i=on($t((t-e)/(n||1)),0),a=y(i);i--;)a[l?i:++o]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function xo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ir(t),n=ir(n)),e(t,n)}}function Ro(e,t,n,l,o,i,a,r,u,s){var d=8&t;t|=d?32:64,4&(t&=~(d?64:32))||(t&=-4);var c=[e,t,o,d?i:void 0,d?a:void 0,d?void 0:i,d?void 0:a,r,u,s],v=n.apply(void 0,c);return ui(e)&&_i(v,c),v.placeholder=l,Si(v,e,t)}function Fo(e){var t=ve[e];return function(e,n){if(e=ir(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 Bo=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:$r;function Mo(e){return function(t){var n=ti(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 Uo(e,t,o,i,a,r,u,s){var d=2&t;if(!d&&"function"!=typeof e)throw new Ee(n);var c=i?i.length:0;if(c||(t&=-97,i=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=i,m=a;i=a=void 0}var p=d?void 0:Yo(e),f=[e,t,o,i,a,v,m,r,u,s];if(p&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?po(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fo(r,a,t[6]):a,e[6]=r?kt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&o&&(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]=i}(f,p),e=f[0],t=f[1],o=f[2],i=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=yo(e);return function o(){for(var i=arguments.length,a=y(i),r=i,u=Ko(o);r--;)a[r]=arguments[r];var s=i<3&&a[0]!==u&&a[i-1]!==u?[]:kt(a,u);if((i-=s.length)<n)return Ro(e,t,Oo,o.placeholder,void 0,a,s,void 0,void 0,n-i);var d=this&&this!==ze&&this instanceof o?l:e;return tt(d,this,a)}}(e,t,s):32!=t&&33!=t||a.length?Oo.apply(void 0,f):function(e,t,n,l){var o=1&t,i=yo(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,d=y(s+r),c=this&&this!==ze&&this instanceof t?i:e;++u<s;)d[u]=l[u];for(;r--;)d[u++]=arguments[++a];return tt(c,o?n:this,d)}}(e,t,o,i);else var E=function(e,t,n){var l=1&t,o=yo(e);return function t(){var i=this&&this!==ze&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((p?Wl:_i)(E,f),e,t)}function ko(e,t,n,l){return void 0===e||Ta(e,ge[n])&&!Ae.call(l,n)?t:e}function Wo(e,t,n,l,o,i){return za(e)&&za(t)&&(i.set(t,e),Ll(e,t,void 0,Wo,i),i.delete(t)),e}function Ho(e){return qa(e)?void 0:e}function jo(e,t,n,l,o,i){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=i.get(e),d=i.get(t);if(s&&d)return s==t&&d==e;var c=-1,v=!0,m=2&n?new Fn:void 0;for(i.set(e,t),i.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,i):l(p,f,c,e,t,i);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(p===e||o(p,e,n,l,i)))return m.push(t)})){v=!1;break}}else if(p!==f&&!o(p,f,n,l,i)){v=!1;break}}return i.delete(e),i.delete(t),v}function zo(e){return hi(mi(e,void 0,Ri),e+"")}function Vo(e){return cl(e,Sr,Qo)}function Go(e){return cl(e,Ar,ei)}var Yo=_n?function(e){return _n.get(e)}:$r;function qo(e){for(var t=e.name+"",n=gn[t],l=Ae.call(gn,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Ko(e){return(Ae.call(On,"placeholder")?On:e).placeholder}function Xo(){var e=On.iteratee||qr;return e=e===qr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Jo(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 $o(e){for(var t=Sr(e),n=t.length;n--;){var l=t[n],o=e[l];t[n]=[l,o,ci(o)]}return t}function Zo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Al(n)?n:void 0}var Qo=Qt?function(e){return null==e?[]:(e=me(e),at(Qt(e),function(t){return Ge.call(e,t)}))}:ou,ei=Qt?function(e){for(var t=[];e;)dt(t,Qo(e)),e=je(e);return t}:ou,ti=vl;function ni(e,t,n){for(var l=-1,o=(t=io(t,e)).length,i=!1;++l<o;){var a=Di(t[l]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&ja(o)&&ii(a,o)&&(xa(e)||Pa(e))}function li(e){return"function"!=typeof e.constructor||di(e)?{}:Ln(je(e))}function oi(e){return xa(e)||Pa(e)||!!(Ke&&e&&e[Ke])}function ii(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 ai(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Fa(n)&&ii(t,n.length):"string"==l&&t in n)&&Ta(n[t],e)}function ri(e,t){if(xa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$a(e))||j.test(e)||!H.test(e)||null!=t&&e in me(t)}function ui(e){var t=qo(e),n=On[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Yo(n);return!!l&&e===l[0]}(cn&&ti(new cn(new ArrayBuffer(1)))!=A||vn&&ti(new vn)!=v||mn&&"[object Promise]"!=ti(mn.resolve())||pn&&ti(new pn)!=E||fn&&ti(new fn)!=h)&&(ti=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Oi(n):"";if(l)switch(l){case hn:return A;case Sn:return v;case An:return"[object Promise]";case bn:return E;case Cn:return h}return t});var si=he?Wa:iu;function di(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function ci(e){return e==e&&!za(e)}function vi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,o=-1,i=on(l.length-t,0),a=y(i);++o<i;)a[o]=l[t+o];o=-1;for(var r=y(t+1);++o<t;)r[o]=l[o];return r[t]=n(a),tt(e,this,r)}}function pi(e,t){return t.length<2?e:dl(e,zl(t,0,-1))}function fi(e,t){for(var n=e.length,l=an(t.length,n),o=Eo(e);l--;){var i=t[l];e[l]=ii(i,n)?o[i]:void 0}return e}function Ei(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _i=Ai(Wl),gi=Jt||function(e,t){return ze.setTimeout(e,t)},hi=Ai(Hl);function Si(e,t,n){var l=t+"";return hi(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(K,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(o,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 Ai(e){var t=0,n=0;return function(){var l=rn(),o=16-(l-n);if(n=l,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bi(e,t){var n=-1,l=e.length,o=l-1;for(t=void 0===t?l:t;++n<t;){var i=Rl(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Ci,yi,Ni=(Ci=Ca(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,o){t.push(l?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===yi.size&&yi.clear(),e}),yi=Ci.cache,Ci);function Di(e){if("string"==typeof e||$a(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Oi(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Li(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=Eo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ti=Bl(function(e,t){return Ba(e)?Zn(e,ol(t,1,Ba,!0)):[]}),Ii=Bl(function(e,t){var n=ki(t);return Ba(n)&&(n=void 0),Ba(e)?Zn(e,ol(t,1,Ba,!0),Xo(n,2)):[]}),wi=Bl(function(e,t){var n=ki(t);return Ba(n)&&(n=void 0),Ba(e)?Zn(e,ol(t,1,Ba,!0),void 0,n):[]});function Pi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:lr(n);return o<0&&(o=on(l+o,0)),Et(e,Xo(t,3),o)}function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==n&&(o=lr(n),o=n<0?on(l+o,0):an(o,l-1)),Et(e,Xo(t,3),o,!0)}function Ri(e){return null!=e&&e.length?ol(e,1):[]}function Fi(e){return e&&e.length?e[0]:void 0}var Bi=Bl(function(e){var t=st(e,lo);return t.length&&t[0]===e[0]?El(t):[]}),Mi=Bl(function(e){var t=ki(e),n=st(e,lo);return t===ki(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Xo(t,2)):[]}),Ui=Bl(function(e){var t=ki(e),n=st(e,lo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ki(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wi=Bl(Hi);function Hi(e,t){return e&&e.length&&t&&t.length?Pl(e,t):e}var ji=zo(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(e,st(t,function(e){return ii(e,n)?+e:e}).sort(mo)),l});function zi(e){return null==e?e:dn.call(e)}var Vi=Bl(function(e){return Jl(ol(e,1,Ba,!0))}),Gi=Bl(function(e){var t=ki(e);return Ba(t)&&(t=void 0),Jl(ol(e,1,Ba,!0),Xo(t,2))}),Yi=Bl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,Jl(ol(e,1,Ba,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=on(e.length,t),!0}),Nt(t,function(t){return st(e,At(t))})}function Ki(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xi=Bl(function(e,t){return Ba(e)?Zn(e,t):[]}),Ji=Bl(function(e){return to(at(e,Ba))}),$i=Bl(function(e){var t=ki(e);return Ba(t)&&(t=void 0),to(at(e,Ba),Xo(t,2))}),Zi=Bl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,to(at(e,Ba),void 0,t)}),Qi=Bl(qi),ea=Bl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ki(e,n)});function ta(e){var t=On(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=zo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&ii(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),oa=go(function(e,t,n){Ae.call(e,n)?++e[n]:Yn(e,n,1)}),ia=No(Pi),aa=No(xi);function ra(e,t){return(xa(e)?lt:Qn)(e,Xo(t,3))}function ua(e,t){return(xa(e)?ot:el)(e,Xo(t,3))}var sa=go(function(e,t,n){Ae.call(e,n)?e[n].push(t):Yn(e,n,[t])}),da=Bl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fa(e)?y(e.length):[];return Qn(e,function(e){i[++l]=o?tt(t,e,n):_l(e,t,n)}),i}),ca=go(function(e,t,n){Yn(e,n,t)});function va(e,t){return(xa(e)?st:Nl)(e,Xo(t,3))}var ma=go(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Bl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,ol(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Uo(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=Bl(function(e,t,n){var l=1;if(n.length){var o=kt(n,Ko(ga));l|=32}return Uo(e,l,t,n,o)}),ha=Bl(function(e,t,n){var l=3;if(n.length){var o=kt(n,Ko(ha));l|=32}return Uo(t,l,e,n,o)});function Sa(e,t,l){var o,i,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=o,l=i;return o=i=void 0,d=t,r=e.apply(l,n)}function f(e){return d=e,u=gi(_,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=gi(_,function(e){var n=t-(e-s);return v?an(n,a-(e-d)):n}(e))}function g(e){return u=void 0,m&&o?p(e):(o=i=void 0,r)}function h(){var e=fa(),n=E(e);if(o=arguments,i=this,s=e,n){if(void 0===u)return f(s);if(v)return uo(u),u=gi(_,t),p(s)}return void 0===u&&(u=gi(_,t)),r}return t=ir(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?on(ir(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==u&&uo(u),d=0,o=s=i=u=void 0},h.flush=function(){return void 0===u?r:g(fa())},h}var Aa=Bl(function(e,t){return $n(e,1,t)}),ba=Bl(function(e,t,n){return $n(e,ir(t)||0,n)});function Ca(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=l.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return l.cache=i.set(o,a)||i,a};return l.cache=new(Ca.Cache||Rn),l}function ya(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)}}Ca.Cache=Rn;var Na=ao(function(e,t){var n=(t=1==t.length&&xa(t[0])?st(t[0],Ot(Xo())):st(ol(t,1),Ot(Xo()))).length;return Bl(function(l){for(var o=-1,i=an(l.length,n);++o<i;)l[o]=t[o].call(this,l[o]);return tt(e,this,l)})}),Da=Bl(function(e,t){return Uo(e,32,void 0,t,kt(t,Ko(Da)))}),Oa=Bl(function(e,t){return Uo(e,64,void 0,t,kt(t,Ko(Oa)))}),La=zo(function(e,t){return Uo(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=xo(ml),wa=xo(function(e,t){return e>=t}),Pa=gl(function(){return arguments}())?gl:function(e){return Va(e)&&Ae.call(e,"callee")&&!Ge.call(e,"callee")},xa=y.isArray,Ra=Xe?Ot(Xe):function(e){return Va(e)&&vl(e)==S};function Fa(e){return null!=e&&ja(e.length)&&!Wa(e)}function Ba(e){return Va(e)&&Fa(e)}var Ma=en||iu,Ua=Je?Ot(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&&!qa(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=$e?Ot($e):function(e){return Va(e)&&ti(e)==v};function Ya(e){return"number"==typeof e||Va(e)&&vl(e)==m}function qa(e){if(!Va(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ne}var Ka=Ze?Ot(Ze):function(e){return Va(e)&&vl(e)==f},Xa=Qe?Ot(Qe):function(e){return Va(e)&&ti(e)==E};function Ja(e){return"string"==typeof e||!xa(e)&&Va(e)&&vl(e)==_}function $a(e){return"symbol"==typeof e||Va(e)&&vl(e)==g}var Za=et?Ot(et):function(e){return Va(e)&&ja(e.length)&&!!Be[vl(e)]},Qa=xo(yl),er=xo(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Fa(e))return Ja(e)?zt(e):Eo(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=ti(e);return(t==v?Mt:t==E?Wt:Tr)(e)}function nr(e){return e?(e=ir(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 or(e){return e?Kn(lr(e),0,4294967295):0}function ir(e){if("number"==typeof e)return e;if($a(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=Dt(e);var n=le.test(e);return n||ie.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return _o(e,Ar(e))}function rr(e){return null==e?"":Xl(e)}var ur=ho(function(e,t){if(di(t)||Fa(t))_o(t,Sr(t),e);else for(var n in t)Ae.call(t,n)&&jn(e,n,t[n])}),sr=ho(function(e,t){_o(t,Ar(t),e)}),dr=ho(function(e,t,n,l){_o(t,Ar(t),e,l)}),cr=ho(function(e,t,n,l){_o(t,Sr(t),e,l)}),vr=zo(qn),mr=Bl(function(e,t){e=me(e);var n=-1,l=t.length,o=l>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(l=1);++n<l;)for(var i=t[n],a=Ar(i),r=-1,u=a.length;++r<u;){var s=a[r],d=e[s];(void 0===d||Ta(d,ge[s])&&!Ae.call(e,s))&&(e[s]=i[s])}return e}),pr=Bl(function(e){return e.push(void 0,Wo),tt(Cr,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&&ni(e,t,fl)}var _r=Lo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=ye.call(t)),e[t]=n},zr(Yr)),gr=Lo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=ye.call(t)),Ae.call(e,t)?e[t].push(n):e[t]=[n]},Xo),hr=Bl(_l);function Sr(e){return Fa(e)?Mn(e):Cl(e)}function Ar(e){return Fa(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=di(e),n=[];for(var l in e)("constructor"!=l||!t&&Ae.call(e,l))&&n.push(l);return n}(e)}var br=ho(function(e,t,n){Ll(e,t,n)}),Cr=ho(function(e,t,n,l){Ll(e,t,n,l)}),yr=zo(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=io(t,e),l||(l=t.length>1),t}),_o(e,Go(e),n),l&&(n=Xn(n,7,Ho));for(var o=t.length;o--;)$l(n,t[o]);return n}),Nr=zo(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=st(Go(e),function(e){return[e]});return t=Xo(t),wl(e,n,function(e,n){return t(e,n[0])})}var Or=Mo(Sr),Lr=Mo(Ar);function Tr(e){return null==e?[]:Lt(e,Sr(e))}var Ir=Co(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function Pr(e){return(e=rr(e))&&e.replace(re,xt).replace(Te,"")}var xr=Co(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=Co(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=bo("toLowerCase"),Br=Co(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=Co(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=Co(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=bo("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var Hr=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new de(e)}}),jr=zo(function(e,t){return lt(t,function(t){t=Di(t),Yn(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Do(),Gr=Do(!0);function Yr(e){return e}function qr(e){return bl("function"==typeof e?e:Xn(e,1))}var Kr=Bl(function(e,t){return function(n){return _l(n,e,t)}}),Xr=Bl(function(e,t){return function(n){return _l(e,n,t)}});function Jr(e,t,n){var l=Sr(t),o=sl(t,l);null!=n||za(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sr(t)));var i=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(o,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Eo(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,dt([this.value()],arguments))})}),e}function $r(){}var Zr=Io(st),Qr=Io(it),eu=Io(mt);function tu(e){return ri(e)?At(Di(e)):function(e){return function(t){return dl(t,e)}}(e)}var nu=Po(),lu=Po(!0);function ou(){return[]}function iu(){return!1}var au,ru=To(function(e,t){return e+t},0),uu=Fo("ceil"),su=To(function(e,t){return e/t},1),du=Fo("floor"),cu=To(function(e,t){return e*t},1),vu=Fo("round"),mu=To(function(e,t){return e-t},0);return On.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)}},On.ary=Ea,On.assign=ur,On.assignIn=sr,On.assignInWith=dr,On.assignWith=cr,On.at=vr,On.before=_a,On.bind=ga,On.bindAll=jr,On.bindKey=ha,On.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xa(e)?e:[e]},On.chain=ta,On.chunk=function(e,t,n){t=(n?ai(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 o=0,i=0,a=y($t(l/t));o<l;)a[i++]=zl(e,o,o+=t);return a},On.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,o=[];++t<n;){var i=e[t];i&&(o[l++]=i)}return o},On.concat=function(){var e=arguments.length;if(!e)return[];for(var t=y(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return dt(xa(n)?Eo(n):[n],ol(t,1))},On.cond=function(e){var t=null==e?0:e.length,l=Xo();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Bl(function(n){for(var l=-1;++l<t;){var o=e[l];if(tt(o[0],this,n))return tt(o[1],this,n)}})},On.conforms=function(e){return function(e){var t=Sr(e);return function(n){return Jn(n,e,t)}}(Xn(e,1))},On.constant=zr,On.countBy=oa,On.create=function(e,t){var n=Ln(e);return null==t?n:Gn(n,t)},On.curry=function e(t,n,l){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},On.curryRight=function e(t,n,l){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},On.debounce=Sa,On.defaults=mr,On.defaultsDeep=pr,On.defer=Aa,On.delay=ba,On.difference=Ti,On.differenceBy=Ii,On.differenceWith=wi,On.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):[]},On.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):[]},On.dropRightWhile=function(e,t){return e&&e.length?Ql(e,Xo(t,3),!0,!0):[]},On.dropWhile=function(e,t){return e&&e.length?Ql(e,Xo(t,3),!0):[]},On.fill=function(e,t,n,l){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,l=o),function(e,t,n,l){var o=e.length;for((n=lr(n))<0&&(n=-n>o?0:o+n),(l=void 0===l||l>o?o:lr(l))<0&&(l+=o),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},On.filter=function(e,t){return(xa(e)?at:ll)(e,Xo(t,3))},On.flatMap=function(e,t){return ol(va(e,t),1)},On.flatMapDeep=function(e,t){return ol(va(e,t),1/0)},On.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),ol(va(e,t),n)},On.flatten=Ri,On.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},On.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:lr(t)):[]},On.flip=function(e){return Uo(e,512)},On.flow=Vr,On.flowRight=Gr,On.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var o=e[t];l[o[0]]=o[1]}return l},On.functions=function(e){return null==e?[]:sl(e,Sr(e))},On.functionsIn=function(e){return null==e?[]:sl(e,Ar(e))},On.groupBy=sa,On.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},On.intersection=Bi,On.intersectionBy=Mi,On.intersectionWith=Ui,On.invert=_r,On.invertBy=gr,On.invokeMap=da,On.iteratee=qr,On.keyBy=ca,On.keys=Sr,On.keysIn=Ar,On.map=va,On.mapKeys=function(e,t){var n={};return t=Xo(t,3),rl(e,function(e,l,o){Yn(n,t(e,l,o),e)}),n},On.mapValues=function(e,t){var n={};return t=Xo(t,3),rl(e,function(e,l,o){Yn(n,l,t(e,l,o))}),n},On.matches=function(e){return Dl(Xn(e,1))},On.matchesProperty=function(e,t){return Ol(e,Xn(t,1))},On.memoize=Ca,On.merge=br,On.mergeWith=Cr,On.method=Kr,On.methodOf=Xr,On.mixin=Jr,On.negate=ya,On.nthArg=function(e){return e=lr(e),Bl(function(t){return Tl(t,e)})},On.omit=yr,On.omitBy=function(e,t){return Dr(e,ya(Xo(t)))},On.once=function(e){return _a(2,e)},On.orderBy=function(e,t,n,l){return null==e?[]:(xa(t)||(t=null==t?[]:[t]),xa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},On.over=Zr,On.overArgs=Na,On.overEvery=Qr,On.overSome=eu,On.partial=Da,On.partialRight=Oa,On.partition=ma,On.pick=Nr,On.pickBy=Dr,On.property=tu,On.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},On.pull=Wi,On.pullAll=Hi,On.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,Xo(n,2)):e},On.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,void 0,n):e},On.pullAt=ji,On.range=nu,On.rangeRight=lu,On.rearg=La,On.reject=function(e,t){return(xa(e)?at:ll)(e,ya(Xo(t,3)))},On.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,o=[],i=e.length;for(t=Xo(t,3);++l<i;){var a=e[l];t(a,l,e)&&(n.push(a),o.push(l))}return xl(e,o),n},On.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Bl(e,t=void 0===t?t:lr(t))},On.reverse=zi,On.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:lr(t),(xa(e)?kn:Ul)(e,t)},On.set=function(e,t,n){return null==e?e:kl(e,t,n)},On.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},On.shuffle=function(e){return(xa(e)?Wn:jl)(e)},On.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},On.sortBy=pa,On.sortedUniq=function(e){return e&&e.length?ql(e):[]},On.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Xo(t,2)):[]},On.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Xl(t))&&Bt(e)?ro(zt(e),0,n):e.split(t,n):[]},On.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Bl(function(n){var l=n[t],o=ro(n,0,t);return l&&dt(o,l),tt(e,this,o)})},On.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},On.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},On.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):[]},On.takeRightWhile=function(e,t){return e&&e.length?Ql(e,Xo(t,3),!1,!0):[]},On.takeWhile=function(e,t){return e&&e.length?Ql(e,Xo(t,3)):[]},On.tap=function(e,t){return t(e),e},On.throttle=function(e,t,l){var o=!0,i=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Sa(e,t,{leading:o,maxWait:t,trailing:i})},On.thru=na,On.toArray=tr,On.toPairs=Or,On.toPairsIn=Lr,On.toPath=function(e){return xa(e)?st(e,Di):$a(e)?[e]:Eo(Ni(rr(e)))},On.toPlainObject=ar,On.transform=function(e,t,n){var l=xa(e),o=l||Ma(e)||Za(e);if(t=Xo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:za(e)&&Wa(i)?Ln(je(e)):{}}return(o?lt:rl)(e,function(e,l,o){return t(n,e,l,o)}),n},On.unary=function(e){return Ea(e,1)},On.union=Vi,On.unionBy=Gi,On.unionWith=Yi,On.uniq=function(e){return e&&e.length?Jl(e):[]},On.uniqBy=function(e,t){return e&&e.length?Jl(e,Xo(t,2)):[]},On.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jl(e,void 0,t):[]},On.unset=function(e,t){return null==e||$l(e,t)},On.unzip=qi,On.unzipWith=Ki,On.update=function(e,t,n){return null==e?e:Zl(e,t,oo(n))},On.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,oo(n),l)},On.values=Tr,On.valuesIn=function(e){return null==e?[]:Lt(e,Ar(e))},On.without=Xi,On.words=Wr,On.wrap=function(e,t){return Da(oo(t),e)},On.xor=Ji,On.xorBy=$i,On.xorWith=Zi,On.zip=Qi,On.zipObject=function(e,t){return no(e||[],t||[],jn)},On.zipObjectDeep=function(e,t){return no(e||[],t||[],kl)},On.zipWith=ea,On.entries=Or,On.entriesIn=Lr,On.extend=sr,On.extendWith=dr,Jr(On,On),On.add=ru,On.attempt=Hr,On.camelCase=Ir,On.capitalize=wr,On.ceil=uu,On.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ir(n))==n?n:0),void 0!==t&&(t=(t=ir(t))==t?t:0),Kn(ir(e),t,n)},On.clone=function(e){return Xn(e,4)},On.cloneDeep=function(e){return Xn(e,5)},On.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},On.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},On.conformsTo=function(e,t){return null==t||Jn(e,t,Sr(t))},On.deburr=Pr,On.defaultTo=function(e,t){return null==e||e!=e?t:e},On.divide=su,On.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,o=n=void 0===n?l:Kn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},On.eq=Ta,On.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(F,Rt):e},On.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},On.every=function(e,t,n){var l=xa(e)?it:tl;return n&&ai(e,t,n)&&(t=void 0),l(e,Xo(t,3))},On.find=ia,On.findIndex=Pi,On.findKey=function(e,t){return ft(e,Xo(t,3),rl)},On.findLast=aa,On.findLastIndex=xi,On.findLastKey=function(e,t){return ft(e,Xo(t,3),ul)},On.floor=du,On.forEach=ra,On.forEachRight=ua,On.forIn=function(e,t){return null==e?e:il(e,Xo(t,3),Ar)},On.forInRight=function(e,t){return null==e?e:al(e,Xo(t,3),Ar)},On.forOwn=function(e,t){return e&&rl(e,Xo(t,3))},On.forOwnRight=function(e,t){return e&&ul(e,Xo(t,3))},On.get=fr,On.gt=Ia,On.gte=wa,On.has=function(e,t){return null!=e&&ni(e,t,pl)},On.hasIn=Er,On.head=Fi,On.identity=Yr,On.includes=function(e,t,n,l){e=Fa(e)?e:Tr(e),n=n&&!l?lr(n):0;var o=e.length;return n<0&&(n=on(o+n,0)),Ja(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&_t(e,t,n)>-1},On.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:lr(n);return o<0&&(o=on(l+o,0)),_t(e,t,o)},On.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=ir(e),t,n)},On.invoke=hr,On.isArguments=Pa,On.isArray=xa,On.isArrayBuffer=Ra,On.isArrayLike=Fa,On.isArrayLikeObject=Ba,On.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},On.isBuffer=Ma,On.isDate=Ua,On.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},On.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(xa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Pa(e)))return!e.length;var t=ti(e);if(t==v||t==E)return!e.size;if(di(e))return!Cl(e).length;for(var n in e)if(Ae.call(e,n))return!1;return!0},On.isEqual=function(e,t){return hl(e,t)},On.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},On.isError=ka,On.isFinite=function(e){return"number"==typeof e&&tn(e)},On.isFunction=Wa,On.isInteger=Ha,On.isLength=ja,On.isMap=Ga,On.isMatch=function(e,t){return e===t||Sl(e,t,$o(t))},On.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,$o(t),n)},On.isNaN=function(e){return Ya(e)&&e!=+e},On.isNative=function(e){if(si(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Al(e)},On.isNil=function(e){return null==e},On.isNull=function(e){return null===e},On.isNumber=Ya,On.isObject=za,On.isObjectLike=Va,On.isPlainObject=qa,On.isRegExp=Ka,On.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},On.isSet=Xa,On.isString=Ja,On.isSymbol=$a,On.isTypedArray=Za,On.isUndefined=function(e){return void 0===e},On.isWeakMap=function(e){return Va(e)&&ti(e)==h},On.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},On.join=function(e,t){return null==e?"":nn.call(e,t)},On.kebabCase=xr,On.last=ki,On.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==n&&(o=(o=lr(n))<0?on(l+o,0):an(o,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,o):Et(e,ht,o,!0)},On.lowerCase=Rr,On.lowerFirst=Fr,On.lt=Qa,On.lte=er,On.max=function(e){return e&&e.length?nl(e,Yr,ml):void 0},On.maxBy=function(e,t){return e&&e.length?nl(e,Xo(t,2),ml):void 0},On.mean=function(e){return St(e,Yr)},On.meanBy=function(e,t){return St(e,Xo(t,2))},On.min=function(e){return e&&e.length?nl(e,Yr,yl):void 0},On.minBy=function(e,t){return e&&e.length?nl(e,Xo(t,2),yl):void 0},On.stubArray=ou,On.stubFalse=iu,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return!0},On.multiply=cu,On.nth=function(e,t){return e&&e.length?Tl(e,lr(t)):void 0},On.noConflict=function(){return ze._===this&&(ze._=De),this},On.noop=$r,On.now=fa,On.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var o=(t-l)/2;return wo(Zt(o),n)+e+wo($t(o),n)},On.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+wo(t-l,n):e},On.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?wo(t-l,n)+e:e},On.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},On.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(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 o=sn();return an(e+o*(t-e+ke("1e-"+((o+"").length-1))),t)}return Rl(e,t)},On.reduce=function(e,t,n){var l=xa(e)?ct:Ct,o=arguments.length<3;return l(e,Xo(t,4),n,o,Qn)},On.reduceRight=function(e,t,n){var l=xa(e)?vt:Ct,o=arguments.length<3;return l(e,Xo(t,4),n,o,el)},On.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:lr(t),Fl(rr(e),t)},On.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},On.result=function(e,t,n){var l=-1,o=(t=io(t,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Di(t[l])];void 0===i&&(l=o,i=n),e=Wa(i)?i.call(e):i}return e},On.round=vu,On.runInContext=e,On.sample=function(e){return(xa(e)?Un:Ml)(e)},On.size=function(e){if(null==e)return 0;if(Fa(e))return Ja(e)?jt(e):e.length;var t=ti(e);return t==v||t==E?e.size:Cl(e).length},On.snakeCase=Br,On.some=function(e,t,n){var l=xa(e)?mt:Vl;return n&&ai(e,t,n)&&(t=void 0),l(e,Xo(t,3))},On.sortedIndex=function(e,t){return Gl(e,t)},On.sortedIndexBy=function(e,t,n){return Yl(e,t,Xo(n,2))},On.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},On.sortedLastIndex=function(e,t){return Gl(e,t,!0)},On.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Xo(n,2),!0)},On.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},On.startCase=Mr,On.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:Kn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},On.subtract=mu,On.sum=function(e){return e&&e.length?yt(e,Yr):0},On.sumBy=function(e,t){return e&&e.length?yt(e,Xo(t,2)):0},On.template=function(e,t,n){var l=On.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=rr(e),t=dr({},t,l,ko);var o,i,a=dr({},t.imports,l.imports,ko),r=Sr(a),u=Lt(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="+(Ae.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),c+=e.slice(s,u).replace(se,Ft),n&&(o=!0,c+="' +\n__e("+n+") +\n'"),r&&(i=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),c+="';\n";var p=Ae.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=(i?c.replace(w,""):c).replace(P,"$1").replace(x,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __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},On.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var o=Nt(l,t=Xo(t));++n<e;)t(n);return o},On.toFinite=nr,On.toInteger=lr,On.toLength=or,On.toLower=function(e){return rr(e).toLowerCase()},On.toNumber=ir,On.toSafeInteger=function(e){return e?Kn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},On.toString=rr,On.toUpper=function(e){return rr(e).toUpperCase()},On.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),o=zt(t);return ro(l,It(l,o),wt(l,o)+1).join("")},On.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 ro(l,0,wt(l,zt(t))+1).join("")},On.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 ro(l,It(l,zt(t))).join("")},On.truncate=function(e,t){var n=30,l="...";if(za(t)){var o="separator"in t?t.separator:o;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var i=(e=rr(e)).length;if(Bt(e)){var a=zt(e);i=a.length}if(n>=i)return e;var r=n-jt(l);if(r<1)return l;var u=a?ro(a,0,r).join(""):e.slice(0,r);if(void 0===o)return u+l;if(a&&(r+=u.length-r),Ka(o)){if(e.slice(r).search(o)){var s,d=u;for(o.global||(o=pe(o.source,rr(te.exec(o))+"g")),o.lastIndex=0;s=o.exec(d);)var c=s.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xl(o),r)!=r){var v=u.lastIndexOf(o);v>-1&&(u=u.slice(0,v))}return u+l},On.unescape=function(e){return(e=rr(e))&&B.test(e)?e.replace(R,Gt):e},On.uniqueId=function(e){var t=++be;return rr(e)+t},On.upperCase=Ur,On.upperFirst=kr,On.each=ra,On.eachRight=ua,On.first=Fi,Jr(On,(au={},rl(On,function(e,t){Ae.call(On.prototype,t)||(au[t]=e)}),au),{chain:!1}),On.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){On[e].placeholder=On}),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:Xo(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=Bl(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(ya(Xo(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),o=On[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);o&&(On.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||xa(t),d=function(e){var t=o.apply(On,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=i&&!c,p=r&&!v;if(!i&&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);On.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return t.apply(xa(o)?o:[],e)}return this[n](function(n){return t.apply(xa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=On[t];if(n){var l=n.name+"";Ae.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=Eo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Eo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Eo(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=xa(e),l=t<0,o=n?e.length:0,i=function(e,t,n){for(var l=-1,o=n.length;++l<o;){var i=n[l],a=i.size;switch(i.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,o,this.__views__),a=i.start,r=i.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&&o==u&&m==u)return eo(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},On.prototype.at=la,On.prototype.chain=function(){return ta(this)},On.prototype.commit=function(){return new In(this.value(),this.__chain__)},On.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__++]}},On.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var l=Li(n);l.__index__=0,l.__values__=void 0,t?o.__wrapped__=l:t=l;var o=l;n=n.__wrapped__}return o.__wrapped__=e,t},On.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:[zi],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zi)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,pt&&(On.prototype[pt]=function(){return this}),On}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(y)});function Dn(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=i.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,o)=>{var i,d,c;return l.createElement(l.Fragment,{key:o},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===(i=e.values)||void 0===i?void 0:i.map((n,o)=>{var i;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:o},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!==(i=n.documentType)&&void 0!==i&&i.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:o},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)!=o+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 i;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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.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 On=e=>{var t,o;let{t:i,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===(o=a.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[_,g]=n.useState([]),[h,S]=n.useState(!0),[A,b]=n.useState(!1),[C,y]=n.useState(!1),{isLoading:N,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:O,data:L}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==D||null===(i=D.BPA)||void 0===i||null===(a=i.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=o)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==L||null===(t=L["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,i.length);i===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===(o=l.values)||void 0===o||o.map(t=>{var n,l;i===(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)},[!N,!O]),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)}),S("0"!=e&&0!=e||!(m.length>0))},[m,A]),n.useEffect(()=>{y("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(Ln,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:b,applicationStatus:d,actions:c,bpaTaxDocuments:_,checkEnablingDocs:C}))))};function Ln(e){var o,i;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===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:{}),[g,h]=n.useState(null),[S,A]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[b,C]=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==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==E?void 0:E.code,fileStoreId:S,documentUid:S,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}]})},[S,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===(i=r.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(Dn,{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 o;0!==Object.keys(n).length&&C(l),(o=l[l.length-1])&&h(o.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:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,o)=>{var i,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")+" - "+(o+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(i=e.date)||void 0===i?void 0:i.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(Dn,{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:o,document:i,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==i?void 0:i.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!=i&&null!==(e=i.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==i||null===(t=i.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==i||null===(t=i.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(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(o("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,i;(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===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){r(o("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!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("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:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const wn=e=>{var o;let{t:i,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===(o=c.data)||void 0===o?void 0:o.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([]),[S,A]=n.useState([]),[b,C]=n.useState(!1),[y,N]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,O]=n.useState(null),L=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,o=[];var i,r,d,c;l=u?null==f||null===(i=f.NOC)||void 0===i||null===(r=i.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},o.push(l[0].docTypes[0]));let v=[];o&&o.length>0&&(o.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)}),A(v))},[f,g]),n.useEffect(()=>{C("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:L?""+i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):i("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:L?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(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:L?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Dn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(In,{key:t,document:e,t:i,error:D,setError:O,setNocDocuments:N,nocDocuments:y,checkEnablingDocs:b}))))},Pn=e=>{let{permissions:o,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.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"}},i("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 o;return t===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:i("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:i("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function xn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.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==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.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 Rn(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(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"})}))))}))}))}function Fn(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.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"},o.map((e,n)=>{var o;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===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;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===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const Bn=e=>{var o,a,r,u,s,d,c,v,m,p,f,E,_,g,h,S,A,b,C,y,N,D,O;let{scrutinyDetails:L,paymentsList:T=[],additionalDetails:I,applicationData:w}=e;const P=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==w?void 0:w.status))&&window.location.href.includes("bpa"),[x,R]=n.useState(),[F,B]=n.useState(),[M,U]=n.useState(),k=Digit.ULBService.getStateId(),[W,H]=n.useState(),[j,z]=n.useState(),[V,G]=n.useState([]),[Y,q]=n.useState(),[K,X]=n.useState(""),[J,$]=n.useState(null),[Z,Q]=n.useState({}),ee={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[te,ne]=n.useState(!1),[le,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{$(null);const e=function(){if(Y&&null!=Y&&Y.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Y||null===(t=Y.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(Y.size>=2e6)$(ie("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Y,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?G([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId,time:new Date}]):$(ie("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else $(ie("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Y]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,o,i,a;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,o;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(o=I.lessAdjustmentFeeFiles)||void 0===o?void 0:o.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,k).then(e=>Q(null==e?void 0:e.data))}R(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),B(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_OTHER_CHARGES),U(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(a=I.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),H(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),G(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:ie}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ie(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ie(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ie("NA");return l.createElement(n.Fragment,null,!(null!=L&&L.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==L||null===(o=L.values)||void 0===o?void 0:o.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:""+ie(""+e.title),text:null!=e&&e.value?ae(e)+" "+ie(null==e?void 0:e.isUnit):ie("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:""+ie(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ie(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ie(null==e?void 0:e.title))),null==L||null===(a=L.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==L||null===(r=L.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ie("SHOW_P1_FEES_DETAILS"))),le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ie("HIDE_P1_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ie("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==L||null===(u=L.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ie("SHOW_P2_FEES_DETAILS"))),te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ie("HIDE_P2_FEES_DETAILS"))),te&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ie("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:x,disabled:!P,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(R(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_OTHER_CHARGES)||0,value:F,disabled:!P,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(B(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ie,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!P,onChange:e=>{!function(e){H(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(E=I.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:M,disabled:!P,onChange:e=>{!function(e){var t,n,l,o;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(x)?parseFloat(x):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0&&P?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),q(e.target.files[0])},disabled:!P,onDelete:()=>{z(null),q("")},message:j?"1 "+ie("FILEUPLOADED"):ie("ES_NO_FILE_SELECTED_LABEL"),error:J,uploadMessage:K})):null,(null==Z||null===(_=Z.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==I||null===(g=I.selfCertificationCharges)||void 0===g?void 0:g.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ie("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Z||null===(h=Z.fileStoreIds)||void 0===h?void 0:h.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Z||null===(A=Z.fileStoreIds[(null==Z||null===(b=Z.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===A?void 0:A.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(x)?parseFloat(x):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(y=I.selfCertificationCharges)||void 0===y?void 0:y.BPA_LABOUR_CESS)+parseFloat(null==I||null===(N=I.selfCertificationCharges)||void 0===N?void 0:N.BPA_WATER_CHARGES)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(M)?parseFloat(M):0))}))),l.createElement("div",null,null==L||null===(O=L.scruntinyDetails)||void 0===O?void 0:O.map((e,o)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ie(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ie(null==e?void 0:e.text))))))))},Mn=e=>{var o,a,r,u,s;let{edcrDetails:d,applicationData:c}=e;const{t:v}=i.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,o,i,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===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.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 o,i;let t=null===(o=n[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.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===(o=d.values)||void 0===o?void 0:o.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 o,i,a,r,u;return l.createElement("div",{key:n,style:(null==d||null===(o=d.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.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 o,a,r;let{data:u,OpenImage:s,privacy:d={}}=e;const[c,v]=n.useState(!1),{t:m}=i.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===(o=u.wfComment)||void 0===o?void 0:o.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:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(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",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Hn(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const jn=e=>{var o,a,r,u,s;let{wsAdditionalDetails:d}=e;const{t:c}=i.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===(o=d.additionalDetails)||void 0===o?void 0:o.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 o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:d}=i.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===(o=s.additionalDetails)||void 0===o||!o.isPaid),[S,A]=n.useState(!1),[b,C]=n.useState(v||{}),[y,N]=n.useState(null),[D,O]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[L,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 o=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 i,a,r,u,d,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(i=v.billDetails)||void 0===i||null===(a=i[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),O(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(o),C(o)},[]);let w={};const P=e=>l.createElement("h1",{className:"heading-m"},e.label),x=()=>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"})),R=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(x,null)),F=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 o,i;const t=0==(null==n||null===(o=n.target)||void 0===o?void 0:o.value)?1:Math.sign(null==n||null===(i=n.target)||void 0===i?void 0:i.value)||-1;l[e]=1==t?n.target.value:""}C(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},L&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==L?void 0:L.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==D?void 0:D.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=>{A(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(P,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{C(v),A(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{C(v),A(!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,o;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))N({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,a,r,u,v,p,f,g,h,S;const e=null==s||null===(i=s.additionalDetails)||void 0===i||null===(a=i.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 o="WATER"==(null==s||null===(h=s.additionalDetails)||void 0===h||null===(S=h.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,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===(o=l.taxHeadEstimates)||void 0===o?void 0:o.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===(i=e.Calculation)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{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])),O(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(S),b.billDetails=null==e?void 0:e.Calculation,m(b),A(!1)}).catch(e=>{var t,n,l,o,i,a;N({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===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.Errors[0])||void 0===a?void 0:a.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else N({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=>F("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=>F("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=>F("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=>F("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=>F("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=>F("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),y&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==y?void 0:y.isWarning,error:null==y||!y.isWarning,label:d(null==y?void 0:y.message),onClose:()=>{N(!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"})))},qn=e=>{let{t:n,userType:o=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;o=o||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(i))),n(a)+" ",l.createElement(Yn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Kn=e=>{var o,a,r,u,s,d,c;let{wsAdditionalDetails:v}=e;const{t:m}=i.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"})),S=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!==(o=v.additionalDetails)&&void 0!==o&&o.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(S,{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:o=[],arrears:a=0}=e;const{t:r}=i.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(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:c({},Xn.cell,Xn.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,o)=>l.createElement("td",{style:c({},Xn.cell,{textAlign:"left"},n.length==o+1?Xn.cellRight:{},{whiteSpace:"pre"}),key:o,numeric:!0},o>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})))))))},$n={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,o,a;let{bill:r={}}=e;const{t:u}=i.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===(o=d)||void 0===o?void 0:o.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 o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},o.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},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(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:$n.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Jn,{headers:[...p],values:s,arrears:v}),!f&&l.createElement("div",{style:$n.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:$n.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Qn=e=>{let{assessmentData:t}=e;const[o,i]=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:()=>{i(!o)}},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"}},o?"<":">"))),o&&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,S,A,b,C;let{applicationDetails:y,demandData:N,workflowDetails:D,isDataLoading:O,applicationData:L,businessService:T,timelineStatusPrefix:I,showTimeLine:w=!0,statusAttribute:P="status",paymentsList:x,oldValue:R,isInfoLabel:F=!1,propertyId:B,moduleCode:M}=e;const{t:U}=i.useTranslation(),k=o.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",y);const[q,K]=n.useState({}),[X,J]=n.useState(),[$,Z]=n.useState([]),[Q,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==L?void 0:L.status)||Q.loading||Q.loaded||Q.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==Q||!Q.canLoad||Q.loading||Q.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(o){function i(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==o||null===(n=o.Assessments)||void 0===n?void 0:n.length)>0){const n=o.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 i=Array.from(l.values());return Z(i),console.log(i),J(null==o?void 0:o.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(i):i()})}catch(e){return Promise.reject(e)}}((null==L?void 0:L.tenantId)||W,null==L?void 0:L.propertyId,K,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 o;const e={date:te(null==L||null===(o=L.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==L?void 0:L.channel)||""};return l.createElement(kn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,a,r,u,s;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(a=i[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==y?void 0:y.tenantId,businessIds:null==y?void 0:y.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=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?d.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(kn,{data:c,OpenImage:Y,privacy:o})}{var d,c,v,m,p;const t={date:te(null==L||null===(d=L.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"),oe=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ie=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")||oe?{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",N),null==N||N.reduce((e,t)=>e+t.demandInterest,0),null==N||N.reduce((e,t)=>e+t.demandPenality,0),null==N||N.reduce((e,t)=>e+t.collectionTax,0),null==N||N.reduce((e,t)=>e+t.collectionInterest,0),null==N||N.reduce((e,t)=>e+t.collectionPenality,0),null==N||N.reduce((e,t)=>e+t.balanceTax,0),null==N||N.reduce((e,t)=>e+t.balanceInterest,0),null==N||N.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==y?void 0:y.applicationData,me=(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==y||null===(r=y.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",y,T),console.log("infolabel",F),console.log("assessment details",X),n.useEffect(()=>{try{let e={consumerCodes:B};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"},F?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==y||null===(u=y.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,u,s,d,c,v,m,p,f,E,_,g,h,S,A,b,C,N,O,L,T,I,w,P,F,B,M,k,W,H,j,z,V,Y,K,X,J;return l.createElement(l.Fragment,{key:i},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"}:oe?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&oe?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ie?""+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,o)=>o===(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")||oe?{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,i)=>{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(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},U(null==n?void 0:n.title)))):ie||ae?""+U(n.title):U(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(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:i===(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=q.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(Bn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:x,additionalDetails:null==y||null===(u=y.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==y||null===(s=y.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==y||null===(m=y.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(Rn,{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(Hn,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.accessories)&&l.createElement(Wn,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!G&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==D||null===(N=D.data)||void 0===N||null===(O=N.nextActions)||void 0===O?void 0:O.length)>0&&l.createElement(Pn,{applicationData:null==y?void 0:y.applicationData,t:U,permissions:null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.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==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(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==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:D}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.scruntinyDetails)&&l.createElement(Bn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(Bn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(Mn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.documentsWithUrl)&&l.createElement(Dn,{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(jn,{wsAdditionalDetails:e,oldValue:R}),(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(o.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===(K=Y.redirectUrl)||void 0===K?void 0:K.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Gn,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&l.createElement(Kn,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==X?void 0:X.length)>0&&l.createElement(Qn,{assessmentData:$}),w&&(null==D||null===(s=D.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==D?void 0:D.isLoading)||O)&&l.createElement(t.Loader,null),!(null!=D&&D.isLoading)&&!O&&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!=D&&null!==(v=D.data)&&void 0!==v&&v.timeline&&1===(null==D||null===(m=D.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==D||null===(f=D.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(null==D||null===(g=D.data)||void 0===g?void 0:g.timeline[0],null==D||null===(h=D.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==D||null===(S=D.data)||void 0===S?void 0:S.timeline)&&(null==D||null===(A=D.data)||void 0===A?void 0:A.timeline.slice(0,se?null==D?void 0:D.data.timeline.length:2).map((e,n,o)=>{var i;let a="";var r,u,s,d,c,v;return window.location.href.includes("/obps/")&&(a=null!=D&&null!==(r=D.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!=D&&null!==(d=D.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[P])+a),customChild:ne(e,n,null==D||null===(i=D.data)||void 0===i?void 0:i.timeline)}))}))),(null==D||null===(b=D.data)||void 0===b||null===(C=b.timeline)||void 0===C?void 0:C.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==y||null===(e=y.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,o;if("INACTIVE"===(null==y||null===(n=y.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(l=y.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(o=y.applicationData)||void 0===o?void 0:o.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var i,a,r;if("INACTIVE"===(null==y||null===(i=y.applicationData)||void 0===i?void 0:i.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(r=y.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,o,i,a,r,u,s,d,c,v,m,p,f,E,_,g,h,S;let{t:A,showToast:b,closeToast:C,businessService:y}=e;if(null!=y&&y.includes("NewTL")||null!=y&&y.includes("TL")||null!=y&&y.includes("EDITRENEWAL")){var N;let e="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:A("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:A("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:A("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:A("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:A("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:A("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:A("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:A("ES_"+y+"_"+(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:C}))}if(null!=y&&y.includes("BPA")||null!=y&&y.includes("BPA_LOW")||null!=y&&y.includes("BPA_OC")){var D;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!=y&&y.includes("BPA_OC")?A(e[1]):A(e[0]),n};let n="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.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:A("ES_"+y+"_"+(null==b||null===(S=b.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:C}))}{var O,L;const e="error"===(null==b?void 0:b.key)?null==b||null===(O=b.error)||void 0===O?void 0:O.message:"ES_"+y+"_"+(null==b||null===(L=b.action)||void 0===L?void 0:L.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:A(e),onClose:C}))}}function nl(e){var o,a,r,u,s,d,v,m,p,f,E,_,g,h,S,A;let{workflowDetails:b,displayMenu:C,onActionSelect:y,setDisplayMenu:N,businessService:D,forcedActionPrefix:O,ActionBarStyle:L={},MenuStyle:T={}}=e;const{t:I}=i.useTranslation();let w=Digit.UserService.getUser();const P=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 x=null===(o=w)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,F=!1,B=(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==x?void 0:x.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==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("ActionsInPayment",b),Digit.Hooks.useClickOutside(P,()=>{N(!1)},C),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==B?void 0:B.length)||null!=B&&null!==(p=B[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==B?void 0:B.length)?(F=!1,R=!0):(null==B?void 0:B.length)>0&&(F=!0,R=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&F&&!R&&l.createElement(t.ActionBar,{style:c({},L)},C&&(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:O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:B,optionKey:"action",t:I,onSelect:y,style:T}):null,l.createElement(t.SubmitBar,{ref:P,label:I("WF_TAKE_ACTION"),onSubmit:()=>N(!C)})),!(null!=b&&b.isLoading)&&!F&&R&&l.createElement(t.ActionBar,{style:c({},L)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==B||null===(h=B[0])||void 0===h?void 0:h.action,value:null==B||null===(S=B[0])||void 0===S?void 0:S.action,onClick:e=>{y((null==B?void 0:B[0])||{})}},I((O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==B||null===(A=B[0])||void 0===A?void 0:A.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"})),ol=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ll,null));function il(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.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:()=>{o()}}),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:o,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}=i.useTranslation(),f=o.useHistory();let{id:E}=o.useParams();const[_,g]=n.useState(!1),[h,S]=n.useState(null),[A,b]=n.useState(!1),[C,y]=n.useState(!1),[N,D]=n.useState(!1),{data:O}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:L,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:P,setShowToast:x,isLoading:R,isDataLoading:F,applicationData:B,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:K,paymentsList:X,showTimeLine:J=!0,oldValue:$,isInfoLabel:Z=!1,clearDataDetails:Q,propertyId:ee}=e;n.useEffect(()=>{P&&k.revalidate()},[P]);const te=a.useQueryClient(),ne=()=>{S(null),b(!1)};return console.log("ActionsInPayment2",k),R||C?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(el,{applicationDetails:L,demandData:T,id:W,workflowDetails:k,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:J,oldValue:$,isInfoLabel:Z,propertyId:ee,moduleCode:z}),A?l.createElement(yn,{t:p,action:h,tenantId:d,state:v,id:E,applicationDetails:L,applicationData:null==L?void 0:L.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const o=function(o,i,a,r,u,s,d,v,m,E,_,g,S,A,b,C,N,D){if(0==(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(a=i.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===(S=e.WaterConnection)||void 0===S||null===(A=S.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(C=b.comment)||void 0===C?void 0:C.length)||0==(null==e||null===(N=e.BPA)||void 0===N||null===(D=N.comment)||void 0===D?void 0:D.length)){var O,L;"INITIATE"===(null==e||null===(O=e.Licenses)||void 0===O||null===(L=O[0])||void 0===L?void 0:L.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const o=function(o,i,a,r,u){if("BPA"!=(null==e||null===(o=e.BPA)||void 0===o?void 0:o.businessService)||null!=e&&null!==(i=e.BPA)&&void 0!==i&&null!==(a=i.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&&(y(!0),M(e,{onError:(e,t)=>{y(!1),x({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,o,i,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),y(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.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")?x({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")?x({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")?x({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")&&x({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S,A,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!==(S=e.Licenses[0])&&void 0!==S&&null!==(A=S.businessService)&&void 0!==A&&A.includes("BPAREG")?(x({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(x({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)));x({key:"success",action:h}),Q&&setTimeout(Q,3e3),setTimeout(j,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}y(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const o=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)),o=wt(function(){return y(!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,o,i,a,r,u,s,d,c,v,m;y(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(o=n.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.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(),x({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(s):s(o)}alert(p("Please select Blocking reason"))}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.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,N?l.createElement(il,{action:h,workflowDetails:k,businessService:H,isWarningPop:N,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(tl,{t:p,showToast:P,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"),Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,o,i,a;const r=Digit.Utils.obps.calculateRiskType(null==O||null===(t=O.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==L||null===(n=L.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(o=l.plot)||void 0===o?void 0:o.area,null==L||null===(i=L.edcrDetails)||void 0===i||null===(a=i.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},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc");const s=function(e,t,n,l,o,i,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===(o=l.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.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)D(!0);else if(null!=e&&e.redirectionUrll){var o,i,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.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===(i=e.redirectionUrll)||void 0===i?void 0:i.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);S(e),g(!1)},setDisplayMenu:g,businessService:H,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function rl(e){var o;let{t:i,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===(o=a.dropdownData)||void 0===o?void 0:o[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%"}},""+i("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 o;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(o=n[n.length-1])&&p(o.file)})(e),t:i,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:o}=e;return l.createElement("svg",{style:o,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:o}=i.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,i;console.log("data here",a),console.log("document here",e);let r=g(null==a?void 0:a.pdfFiles,(null==e?void 0:e.documentAttachment)||(null==e?void 0:e.id));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"}},o(null==e||null===(n=e.documentType)||void 0===n||null===(i=n.replace(".","_"))||void 0===i?void 0:i.toUpperCase())))})))):l.createElement("div",null,o("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 o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:d,applicationData:v,businessService:m,showToast:p,closeToast:f,errors:E,showErrorToast:_,errorOne:g,closeToastOne:h}=e;const[S,A]=n.useState({}),[b,C]=n.useState({}),[y,N]=n.useState([]),[D,O]=n.useState({}),[L,T]=n.useState(null),[I,w]=n.useState(null),[P,x]=n.useState(null),[R,F]=n.useState([]),[B,M]=n.useState(null),{data:U}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{data:k}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;k&&k["egf-master"]&&F(null===(e=k["egf-master"])||void 0===e?void 0:e.FinancialYear)},[k]);const{data:W}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function H(e){T(e.target.files[0])}return n.useEffect(()=>{if(U&&W){var e;const t=W["common-masters"].Department;N(null==U||null===(e=U.Employees)||void 0===e?void 0:e.map(e=>{var n,l,o;const i=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)===i);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[U]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)x(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,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[L]),n.useEffect(()=>{r&&A((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:d}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(c=!1),o.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:""+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_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:i,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:y,selectedApprover:D,setSelectedApprover:O,selectFile:H,uploadedFile:I,setUploadedFile:w,businessService:m}))},[r,y,R,B,I]),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){v=c({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,wfDocuments:I?[{documentType:null==L?void 0:L.type,documentUid:null==L?void 0:L.name,fileStoreId:I,documentAttachment:I}]:null}),d({Licenses:[v]})},defaultValues:b,formId:"modal-action"}),p&&l.createElement(t.Toast,{error:"error"===p.key,label:E,onClose:f,isDleteBtn:!0}),_&&l.createElement(t.Toast,{error:!0,label:g,isDleteBtn:!0,onClose:h})):l.createElement(t.Loader,null)},pl=(e,n,o,i)=>{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,i("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,i("ES_COMMON_FILED_VIA_"+p.source.toUpperCase()))))},fl=e=>{let{registerRef:o,searchFieldComponents:a}=e;const{t:r}=i.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_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:o({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:o({})}))):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:o({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:o({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},El=e=>{let{statuses:o,isInboxLoading:a,controlFilterForm:u,setFilterFormValue:s,applicationTypesOfBPA:d}=e;const{t:c}=i.useTranslation(),v=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+c("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+c("ES_INBOX_ASSIGNED_TO_ALL")}]);null==d||d.forEach(e=>{e.name=c("WF_BPA_"+e.code),e.i18nKey=c("WF_BPA_"+e.code)});const m=r.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:u,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:v.filter(t=>t.code===e.value)[0],optionsKey:"name",options:v})})),l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"businessService",control:u,render:e=>l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},c("BUSINESS_SERVICE")),l.createElement(t.RadioButtons,{onSelect:t=>{s("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:f()||[]}))})),m?l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:u,render:e=>{const i=n.useMemo(()=>{var n;return null==o||null===(n=o.filter(e=>e.businessservice===m.code))||void 0===n?void 0:n.map(n=>{var o;return l.createElement(t.CheckBox,{onChange:t=>{var l;return function(t){e.onChange(t)}(t.target.checked?[...e.value,null==n?void 0:n.statusid]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.statusid)))},checked:null===(o=e.value)||void 0===o?void 0:o.includes(null==n?void 0:n.statusid),label:c("WF_"+n.businessservice+"_"+n.applicationstatus.split("_").pop())+" ("+n.count+")"})})},[e.value,o,m]);return l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},c("ACTION_TEST_APPLICATION_STATUS")),a?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,i))}})):null)};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 Sl(e,t){gl(2,arguments);var n=hl(e).getTime(),l=_l(t);return new Date(n+l)}function Al(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 Cl(e){if(gl(1,arguments),!bl(e)&&"number"!=typeof e)return!1;var t=hl(e);return!isNaN(Number(t))}var yl={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 Nl(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 Dl={date:Nl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Nl({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:Nl({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 Ll(e){return function(t,n){var l,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;l=e.formattingValues[a]||e.formattingValues[i]}else{var r=e.defaultWidth,u=o.width?String(o.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,o=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,r=i[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 Pl,xl={code:"en-US",formatDistance:function(e,t,n){var l,o=yl[e];return l="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:Dl,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:Ll({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ll({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:Ll({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:Ll({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:Ll({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],o=e.match(Pl.parsePattern);if(!o)return null;var i=Pl.valueCallback?Pl.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(l.length);return{value:i,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 Rl(e,t){gl(2,arguments);var n=_l(t);return Sl(e,-n)}function Fl(e){gl(1,arguments);var t=1,n=hl(e),l=n.getUTCDay(),o=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function Bl(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 o=Fl(l),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=Fl(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Ml(e){gl(1,arguments);var t=Bl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=Fl(n);return l}function Ul(e,t){gl(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.weekStartsOn,i=null==o?0:_l(o),a=null==n.weekStartsOn?i:_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(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:_l(a),u=null==o.firstWeekContainsDate?r:_l(o.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,o=l&&l.options&&l.options.firstWeekContainsDate,i=null==o?1:_l(o),a=null==n.firstWeekContainsDate?i:_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 o=kl(e,l),i=o>0?o:1-o;return"YY"===t?Hl(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Hl(i,t.length)},R:function(e,t){return Hl(Bl(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 o=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(o,{unit:"week"}):Hl(o,t.length)},I:function(e,t,n){var l=function(e){gl(1,arguments);var t=hl(e),n=Fl(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(),o=n-l;return Math.floor(o/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 o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Hl(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Hl(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),o=0===l?7:l;switch(t){case"i":return String(o);case"ii":return Hl(o,t.length);case"io":return n.ordinalNumber(o,{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,o=e.getUTCHours();switch(l=12===o?"noon":0===o?"midnight":o/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,o=e.getUTCHours();switch(l=o>=17?"evening":o>=12?"afternoon":o>=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 o=(l._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Vl(o);case"XXXX":case"XX":return Gl(o);case"XXXXX":case"XXX":default:return Gl(o,":")}},x:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Vl(o);case"xxxx":case"xx":return Gl(o);case"xxxxx":case"xxx":default:return Gl(o,":")}},O:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zl(o,":");case"OOOO":default:return"GMT"+Gl(o,":")}},z:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zl(o,":");case"zzzz":default:return"GMT"+Gl(o,":")}},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),o=Math.floor(l/60),i=l%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+Hl(i,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?"-":"+",o=Math.abs(e);return l+Hl(Math.floor(o/60),2)+n+Hl(o%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 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 Kl={p:ql,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],o=l[1],i=l[2];if(!i)return Yl(e,t);switch(o){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(o,t)).replace("{{time}}",ql(i,t))}},Xl=["D","DD"],Jl=["YY","YYYY"];function $l(e){return-1!==Xl.indexOf(e)}function Zl(e){return-1!==Jl.indexOf(e)}function Ql(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 eo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,to=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,no=/^'([^]*?)'?$/,lo=/''/g,oo=/[a-zA-Z]/;function io(e,t,n){gl(2,arguments);var l=String(t),o=n||{},i=o.locale||xl,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:_l(a),u=null==o.firstWeekContainsDate?r:_l(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=i.options&&i.options.weekStartsOn,d=null==s?0:_l(s),c=null==o.weekStartsOn?d:_l(o.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var v=hl(e);if(!Cl(v))throw new RangeError("Invalid time value");var m=Al(v),p=Rl(v,m),f={firstWeekContainsDate:u,weekStartsOn:c,locale:i,_originalDate:v},E=l.match(to).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Kl[t])(e,i.formatLong,f):e}).join("").match(eo).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return ao(n);var a=jl[l];if(a)return!o.useAdditionalWeekYearTokens&&Zl(n)&&Ql(n,t,e),!o.useAdditionalDayOfYearTokens&&$l(n)&&Ql(n,t,e),a(p,n,i.localize,f);if(l.match(oo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function ao(e){return e.match(no)[1].replace(lo,"'")}const ro=e=>{var o,a;const{register:u,control:s,setValue:d,getValues:c,reset:v,formState:m}=r.useFormContext(),{t:p}=i.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===(o=m.errors)||void 0===o||null===(a=o.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"))))},uo=["currentlyActiveMobileModal"],so=["currentlyActiveMobileModal"],co=e=>{var o,a;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:d,data:m,onSubmit:p}=e;const{t:f}=i.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"})},S=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},l.createElement(t.CloseSvg,null)),A=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,o=v(e,uo);const{closeMobilePopupModal:i}=o;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,o,l.createElement(S,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:i}));default:return l.createElement("span",null)}})(c({currentlyActiveMobileModal:n},v(e,so)))},[_]);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(A,{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!==(o=m[0])&&void 0!==o&&o.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")}))},vo=e=>{let{columns:o,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:_}=i.useTranslation(),g=()=>{m("offset",c&&10*Math.ceil(c/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},S=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function A(e){m("limit",Number(e.target.value)),v(u)()}function b(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function C(){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 y=()=>{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:o,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:A,currentPage:f,onNextPage:b,onPrevPage:C,pageSizeLimit:Number(p("limit")),onSort:S,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(y,null))},mo={step:1,isValid:!1,formData:{},coordinates:{}},po=function(e,t){switch(void 0===e&&(e=mo),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 mo;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});default:return e}},fo=["path","url"],Eo=[],_o=()=>{var e,n,a,r,u,s;const d=o.useRouteMatch(),{path:c}=d,m=(v(d,fo),i.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(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(g=Eo)&&(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},go=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:a}=i.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(),o.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:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#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(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<c-1&&l.createElement("div",{style:d})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},ho=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<r.length?c():o===r.length&&n()}function d(){o>1&&v()}const c=()=>a(o+1),v=()=>a(o-1);return l.createElement(go,{currentStep:o,nextStep:c,prevStep:v,stepsList:r},(()=>{var e,t;const n=r[o-1],{component:i,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(i);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:c,component:i,currStepNumber:o,currStepConfig:v},onGoNext:s,onBackClick:d,t:u}))})())},So=[{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"}]}],Ao=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),bo=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),Co=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),yo=[{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:So.filter(t=>t.stepNumber===e.stepNumber)})),No=e=>{var o,i,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,S]=n.useState(""),[A,b]=n.useState(null),[C,y]=n.useState(null);return Digit.Utils.browser.isMobile(),n.useEffect(()=>{C&&Object.entries(C).forEach(e=>{let[t,n]=e;"name"===t?m("applicantOwnerOrFirmName",n,{shouldValidate:!0,shouldDirty:!0}):"emailId"===t?m("applicantEmailId",n,{shouldValidate:!0,shouldDirty:!0}):"gender"===t?m("applicantGender",n,{shouldValidate:!0,shouldDirty:!0}):"dob"===t?m("applicantDateOfBirth",n,{shouldValidate:!0,shouldDirty:!0}):"fatherOrHusbandName"===t?m("applicantFatherHusbandName",n):"permanentAddress"===t&&m("applicantAddress",n,{shouldValidate:!0,shouldDirty:!0})})},[C]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_APPLICANT_DETAILS")),l.createElement("div",null,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),S(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"35px",marginTop:"-24px",marginRight:"-20px"},onClick: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"}):y(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===(o=p.applicantMobileNumber)||void 0===o?void 0:o.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==C?void 0:C.name),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),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==C?void 0:C.emailId),onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(i=p.applicantEmailId)||void 0===i?void 0:i.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==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_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==C?void 0:C.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(),o=t.getMonth()-n.getMonth(),i=t.getDate()-n.getDate();return l>=18||18===l&&(o>0||0===o&&i>=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]})}))),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||(null==C?void 0:C.gender),selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(u=p.applicantGender)||void 0===u?void 0:u.message)||"")),A&&l.createElement(t.Toast,{error:null==A?void 0:A.error,warning:null==A?void 0:A.warning,label:s(null==A?void 0:A.message),isDleteBtn:!0,onClose:()=>{b(null)}}))},Do=e=>{var o,i,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(),[S,A]=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===(o=g.info)||void 0===o?void 0:o.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===(i=g.info)||void 0===i?void 0:i.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)||""))},Oo=e=>{var o,i,a,r,u,s,d,v,m,p,f,E,_,g,h;Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),{t:A,currentStepData:b,Controller:C,control:y,setValue:N,errors:D,errorStyle:O,useFieldArray:L,watch:T}=e,[I,w]=n.useState("0.00"),{fields:P,append:x,remove:R}=L({control:y,name:"floorArea"}),F=T("floorArea"),B=T("basementArea");n.useEffect(()=>{const e=null==F?void 0:F.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(B)?0:B,n=(e+parseFloat(t)).toFixed(2);w(n),N("totalFloorArea",n)},[F,B]);const[M,U]=n.useState((null==b||null===(o=b.siteDetails)||void 0===o?void 0:o.ulbName)||null),[k,W]=n.useState((null==b||null===(i=b.siteDetails)||void 0===i?void 0:i.ulbType)||""),[H,j]=n.useState((null==b||null===(a=b.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:z,isLoading:V}=Digit.Hooks.noc.useBuildingType(S),{data:G,isLoading:Y}=Digit.Hooks.noc.useRoadType(S),{data:q,isLoading:K}=Digit.Hooks.useTenants(),X=null==q?void 0:q.map(e=>c({},e,{displayName:A(e.i18nKey)}));n.useEffect(()=>{if(M){var e;const t=null==M||null===(e=M.city)||void 0===e?void 0:e.ulbType;W(t),N("ulbType",t)}},[M,N]);const[J,$]=n.useState((null==b||null===(r=b.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),Z=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Q=Digit.Hooks.noc.useTenants(),[ee,te]=n.useState(Q),[ne,le]=n.useState((null==b||null===(u=b.siteDetails)||void 0===u?void 0:u.district)||null),[oe,ie]=n.useState([]),{data:ae}=Digit.Hooks.useBoundaryLocalities(null==ne?void 0:ne.code,"revenue",{enabled:!!ne},A);return n.useEffect(()=>{(null==ae?void 0:ae.length)>0&&ie(ae)},[ae]),n.useEffect(()=>{ie([]),N("zone",null)},[ne]),n.useEffect(()=>{const e=null==b?void 0:b.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&N(t,n)}),Array.isArray(e.floorArea))){for(let e=P.length-1;e>=0;e--)R(e);e.floorArea.forEach(e=>{x({value:e.value||""})})}},[b,N,x,R]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},A("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"plotNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},null!=D&&D.plotNo?D.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},A("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"proposedSiteAddress",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:200,message:A("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:O},null!=D&&D.proposedSiteAddress?D.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ULB_NAME_LABEL"),"*"),!K&&l.createElement(C,{control:y,name:"ulbName",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{U(t),e.onChange(t)},selected:e.value,option:X,optionKey:"displayName"})})),l.createElement(t.CardLabelError,{style:O},null!=D&&D.ulbName?D.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:k||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"},""+A("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"khasraNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==D||null===(s=D.khasraNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"hadbastNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==D||null===(d=D.hadbastNo)||void 0===d?void 0:d.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ROAD_TYPE_LABEL"),"*"),!Y&&l.createElement(C,{control:y,name:"roadType",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:G,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:O},(null==D||null===(v=D.roadType)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"areaLeftForRoadWidening",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==D||null===(m=D.areaLeftForRoadWidening)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL")),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"netPlotAreaAfterWidening",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"roadWidthAtSite",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},null!=D&&D.roadWidthAtSite?D.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_BUILDING_STATUS_LABEL"),"*"),!V&&l.createElement(C,{control:y,name:"buildingStatus",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{j(t),e.onChange(t)},selected:e.value,option:z,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:O},(null==D||null===(p=D.buildingStatus)||void 0===p?void 0:p.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(C,{control:y,name:"isBasementAreaAvailable",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{$(t),e.onChange(t)},selected:e.value,option:Z,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:O},(null==D||null===(f=D.isBasementAreaAvailable)||void 0===f?void 0:f.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&"YES"===(null==J?void 0:J.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"basementArea",rules:{required:A("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:A("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:A("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:O},null!=D&&D.basementArea?D.basementArea.message:""),"BUILTUP"===(null==H?void 0:H.code)&&P.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*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(C,{control:y,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:A("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:A("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:A("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var o,i;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==D||null===(o=D.floorArea)||void 0===o||null===(i=o[n])||void 0===i?void 0:i.value)&&l.createElement(t.CardLabelError,{className:O},D.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>R(n)},"❌")))),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement("button",{type:"button",onClick:()=>x({value:""})},"➕ Add Floor"),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_TOTAL_FLOOR_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"totalFloorArea",defaultValue:I,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"},""+A("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"wardNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==D||null===(E=D.wardNo)||void 0===E?void 0:E.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_DISTRICT_LABEL"),"*"),l.createElement(C,{control:y,name:"district",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{le(t),e.onChange(t)},selected:e.value,option:ee.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name"})})),l.createElement(t.CardLabelError,{style:O},(null==D||null===(_=D.district)||void 0===_?void 0:_.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ZONE_LABEL"),"*"),l.createElement(C,{control:y,name:"zone",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:oe,optionKey:"i18nkey"})})),l.createElement(t.CardLabelError,{style:O},(null==D||null===(g=D.zone)||void 0===g?void 0:g.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(C,{control:y,name:"villageName",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==D||null===(h=D.villageName)||void 0===h?void 0:h.message)||"")),l.createElement(t.BreakLine,null)))},Lo=e=>{var o;const{t:i,currentStepData:a,Controller:r,control:u,setValue:s,errors:d,errorStyle:c}=e,v=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[m,p]=n.useState((null==a||null===(o=a.siteDetails)||void 0===o?void 0:o.specificationBuildingCategory)||null),{data:f,isLoading:E}=Digit.Hooks.noc.useBuildingCategory(v);return n.useEffect(()=>{console.log("currentStepData4",a);const e=null==a?void 0:a.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;s(t,n)})},[a,s]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,i("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_PLOT_AREA_JAMA_BANDI_LABEL")),l.createElement("div",{className:"field"},l.createElement(r,{control:u,name:"specificationPlotArea",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:i})}))),l.createElement(t.CardLabelError,{style:c},null!=d&&d.specificationPlotArea?d.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_BUILDING_CATEGORY_LABEL"),"*"),!E&&f.length>0&&l.createElement(r,{control:u,name:"specificationBuildingCategory",rules:{required:i("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{p(t),e.onChange(t)},selected:e.value,option:f,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:c},null!=d&&d.specificationBuildingCategory?d.specificationBuildingCategory.message:"")))};function To(e){var n,i,a,r,u,d,c,v,m,p,f,E,_,g,h,S,A,b,C,y,N,D,O,L,T,I,w,P,x,R,F,B,M,U,k,W,H,j,z,V,G,Y,q,K,X,J,$,Z,Q,ee,te,ne,le;let{currentStepData:oe,t:ie}=e;o.useLocation(),o.useHistory(),s.useDispatch(),console.log("formData in Summary Page",oe);const ae={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},re={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},ue={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},se={fontWeight:"bold",color:"#555"},de=(e,n)=>l.createElement("div",{style:re},l.createElement(t.CardLabel,{style:se},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let ce=null==oe||null===(n=oe.documents)||void 0===n||null===(i=n.documents)||void 0===i?void 0:i.documents;return console.log("documents here in summary",ce),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:ue},ie("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:ae},de(ie("NOC_FIRM_OWNER_NAME_LABEL"),null==oe||null===(a=oe.applicationDetails)||void 0===a?void 0:a.applicantOwnerOrFirmName),de(ie("NOC_APPLICANT_EMAIL_LABEL"),null==oe||null===(r=oe.applicationDetails)||void 0===r?void 0:r.applicantEmailId),de(ie("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==oe||null===(u=oe.applicationDetails)||void 0===u?void 0:u.applicantFatherHusbandName),de(ie("NOC_APPLICANT_MOBILE_NO_LABEL"),null==oe||null===(d=oe.applicationDetails)||void 0===d?void 0:d.applicantMobileNumber),de(ie("NOC_APPLICANT_DOB_LABEL"),null==oe||null===(c=oe.applicationDetails)||void 0===c?void 0:c.applicantDateOfBirth),de(ie("NOC_APPLICANT_GENDER_LABEL"),null==oe||null===(v=oe.applicationDetails)||void 0===v||null===(m=v.applicantGender)||void 0===m?void 0:m.code),de(ie("NOC_APPLICANT_ADDRESS_LABEL"),null==oe||null===(p=oe.applicationDetails)||void 0===p?void 0:p.applicantAddress)),(null==oe||null===(f=oe.applicationDetails)||void 0===f?void 0:f.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:ue},ie("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:ae},de(ie("NOC_PROFESSIONAL_NAME_LABEL"),null==oe||null===(E=oe.applicationDetails)||void 0===E?void 0:E.professionalName),de(ie("NOC_PROFESSIONAL_EMAIL_LABEL"),null==oe||null===(_=oe.applicationDetails)||void 0===_?void 0:_.professionalEmailId),de(ie("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==oe||null===(g=oe.applicationDetails)||void 0===g?void 0:g.professionalRegId),de(ie("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==oe||null===(h=oe.applicationDetails)||void 0===h?void 0:h.professionalMobileNumber),de(ie("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==oe||null===(S=oe.applicationDetails)||void 0===S?void 0:S.professionalAddress))),l.createElement("h2",{style:ue},ie("NOC_SITE_DETAILS")),l.createElement("div",{style:ae},de(ie("NOC_PLOT_NO_LABEL"),null==oe||null===(A=oe.siteDetails)||void 0===A?void 0:A.plotNo),de(ie("NOC_PROPOSED_SITE_ADDRESS"),null==oe||null===(b=oe.siteDetails)||void 0===b?void 0:b.proposedSiteAddress),de(ie("NOC_ULB_NAME_LABEL"),null==oe||null===(C=oe.siteDetails)||void 0===C||null===(y=C.ulbName)||void 0===y?void 0:y.name),de(ie("NOC_ULB_TYPE_LABEL"),null==oe||null===(N=oe.siteDetails)||void 0===N?void 0:N.ulbType),de(ie("NOC_KHASRA_NO_LABEL"),null==oe||null===(D=oe.siteDetails)||void 0===D?void 0:D.khasraNo),de(ie("NOC_HADBAST_NO_LABEL"),null==oe||null===(O=oe.siteDetails)||void 0===O?void 0:O.hadbastNo),de(ie("NOC_ROAD_TYPE_LABEL"),null==oe||null===(L=oe.siteDetails)||void 0===L||null===(T=L.roadType)||void 0===T?void 0:T.name),de(ie("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==oe||null===(I=oe.siteDetails)||void 0===I?void 0:I.areaLeftForRoadWidening),de(ie("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==oe||null===(w=oe.siteDetails)||void 0===w?void 0:w.netPlotAreaAfterWidening),de(ie("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==oe||null===(P=oe.siteDetails)||void 0===P?void 0:P.roadWidthAtSite),de(ie("NOC_BUILDING_STATUS_LABEL"),null==oe||null===(x=oe.siteDetails)||void 0===x||null===(R=x.buildingStatus)||void 0===R?void 0:R.name),de(ie("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==oe||null===(F=oe.siteDetails)||void 0===F||null===(B=F.isBasementAreaAvailable)||void 0===B?void 0:B.code),"BUILTUP"===(null==oe||null===(M=oe.siteDetails)||void 0===M||null===(U=M.buildingStatus)||void 0===U?void 0:U.code)&&de(ie("NOC_BASEMENT_AREA_LABEL"),null==oe||null===(k=oe.siteDetails)||void 0===k?void 0:k.basementArea),"BUILTUP"===(null==oe||null===(W=oe.siteDetails)||void 0===W||null===(H=W.buildingStatus)||void 0===H?void 0:H.code)&&(null==oe||null===(j=oe.siteDetails)||void 0===j||null===(z=j.floorArea)||void 0===z?void 0:z.map((e,t)=>de((e=>0===e?ie("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+ie("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==oe||null===(V=oe.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&de(ie("NOC_TOTAL_FLOOR_AREA_LABEL"),null==oe||null===(Y=oe.siteDetails)||void 0===Y?void 0:Y.totalFloorArea),de(ie("NOC_DISTRICT_LABEL"),null==oe||null===(q=oe.siteDetails)||void 0===q||null===(K=q.district)||void 0===K?void 0:K.name),de(ie("NOC_ZONE_LABEL"),null==oe||null===(X=oe.siteDetails)||void 0===X||null===(J=X.zone)||void 0===J?void 0:J.name),de(ie("NOC_SITE_WARD_NO_LABEL"),null==oe||null===($=oe.siteDetails)||void 0===$?void 0:$.wardNo),de(ie("NOC_SITE_VILLAGE_NAME_LABEL"),null==oe||null===(Z=oe.siteDetails)||void 0===Z?void 0:Z.villageName)),l.createElement("h2",{style:ue},ie("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:ae},de(ie("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==oe||null===(Q=oe.siteDetails)||void 0===Q?void 0:Q.specificationPlotArea),de(ie("NOC_BUILDING_CATEGORY_LABEL"),null==oe||null===(ee=oe.siteDetails)||void 0===ee||null===(te=ee.specificationBuildingCategory)||void 0===te?void 0:te.name)),l.createElement("h2",{style:ue},ie("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:ae},Array.isArray(null==oe||null===(ne=oe.documents)||void 0===ne||null===(le=ne.documents)||void 0===le?void 0:le.documents)&&oe.documents.documents.documents.length>0?l.createElement("div",{className:"documentsContainerStyle"},l.createElement(sl,{value:{workflowDocs:oe.documents.documents.documents}})):l.createElement("div",null,ie("NOC_NO_DOCUMENTS_MSG"))))}function Io(e){var o;let{t:i,document:a,setDocuments:r,setError:u,documents:s,action:v,formData:m,handleSubmit:p,id:f,geocoordinates:E,setGeoCoordinates:_,dispatch:g}=e;const h=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,A]=(Digit.ULBService.getCurrentTenantId(),n.useState(h?c({},h,{active:!0===(null==a?void 0:a.active),code:null==h?void 0:h.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[b,C]=n.useState(null),[y,N]=n.useState(()=>(null==h?void 0:h.filestoreId)||null);function D(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(2),o=x(n).toFixed(2);t({latitude:l,longitude:o})}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(Co("Latitude1",e.latitude)),g(Co("Longitude1",e.longitude)),_(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(g(Co("Latitude1","")),g(Co("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(Co("Latitude2",e.latitude)),g(Co("Longitude2",e.longitude)),_(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(g(Co("Latitude2","")),g(Co("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:O}=a;var L=O;const[T,I]=n.useState(!1),[w,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==y?void 0:y.length)||null===y?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y))||[],{documentType:null==S?void 0:S.code,filestoreId:y,documentUid:y,documentAttachment:y}]})},[y,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=L.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?(A(l),N(null==n?void 0:n.fileStoreId)):I(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||A({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(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return N(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",b,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;P(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):u(i("CS_FILE_UPLOAD_ERROR"))})},function(){P(!1),u(i("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(()=>{T&&N(null)},[T]),l.createElement("div",{style:{marginBottom:"24px"}},w&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:S,style:{width:"100%"},option:L.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>A(e),optionKey:"i18nKey",t:i})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),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:D,onDelete:()=>{N(null)},id:f,message:y?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!y}:{onUpload:D,onDelete:()=>{N(null)},id:f,message:y?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&window.location.href.includes("new-application")&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&l.createElement("div",null,l.createElement("p",null,"Latitude: ",E.Latitude1),l.createElement("p",null,"Longitude: ",E.Longitude1)),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&window.location.href.includes("new-application")&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&l.createElement("div",null,l.createElement("p",null,"Latitude: ",E.Latitude2),l.createElement("p",null,"Longitude: ",E.Longitude2)),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&window.location.href.includes("edit-application")&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&l.createElement("div",null,l.createElement("p",null,"Latitude: ",E.Latitude1),l.createElement("p",null,"Longitude: ",E.Longitude1)),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&window.location.href.includes("edit-application")&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&l.createElement("div",null,l.createElement("p",null,"Latitude: ",E.Latitude2),l.createElement("p",null,"Longitude: ",E.Longitude2))))}const wo=l.memo(function(e){var o,i,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,S]=n.useState(_?c({},_,{active:!0,code:null==_?void 0:_.documentType,i18nKey:null==_?void 0:_.documentType}):(null==u||null===(o=u.dropdownData)||void 0===o?void 0:o.length)>0?null==u?void 0:u.dropdownData[0]:{}),[A,b]=n.useState(null),[C,y]=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),[N,D]=n.useState([]),[O,L]=n.useState([]),[T,I]=n.useState([]||(null==m||null===(i=m.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===h.code))),[w,P]=n.useState(null),[x,R]=n.useState(null);function F(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==v?void 0:v.length)>0&&E()},[v]),n.useEffect(()=>{O.length>0&&null!=h&&h.code&&(s(e=>{if(null===C||null==(null==C?void 0:C.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==C.fileStoreId);let n=[];return O&&O.map((e,t)=>{var l,o;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:x},documentUid:e.fileStoreId,fileName:(null===(l=T[t])||void 0===l?void 0:l.name)||"",id:v?null===(o=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===o?void 0:o.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),L([])),null!=h&&h.code&&s(e=>{var t;return null===C||null==(null==C?void 0:C.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,o,i;(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===(o=h.code)||void 0===o?void 0:o.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(i=e.file)&&void 0!==i&&i.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==C.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:C.fileStoreId,documentUid:C.fileStoreId,fileName:(null==A?void 0:A.name)||C.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}]})},[C,h]),n.useEffect(()=>{h.code||null===C||L([...O,C])},[C]);const B=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=F(e),o=F(n);t({latitude:l,longitude:o})}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(o=>{var i,a,r;console.log("Latitude:",o.latitude),console.log("Longitude:",o.longitude),P(o.latitude),R(o.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==o.latitude&&null!==o.longitude?(sessionStorage.setItem("Latitude",o.latitude),sessionStorage.setItem("Longitude",o.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==m||null===(i=m.documents)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),D(n);let d=[];null==e||e.map((e,t)=>{var n,l,i,a;d.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:o.latitude,longitude:o.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===(i=e[1].fileStoreId)||void 0===i?void 0:i.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:B,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(Dn,{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)," ")))}),Po=[{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:So.filter(t=>t.stepNumber===e.stepNumber)})),xo=e=>{let{matchPath:n}=e;const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const s=[{link:n+"/noc/new-application",i18nKey:o("NOC_NEW_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_NOC"),links:s,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Ro=e=>{let{stateCode:n,userType:i,tenants:a}=e;const{path:r}=o.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"===i?l.createElement(_o,null):l.createElement(It,{path:r,stateCode:n})},Fo={NOCModule:Ro,NOCCard:()=>{var e,a;const{t:r}=i.useTranslation(),u=o.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:xo,NOCApplicationOverview:()=>{var e,a,r,u,s,d,v,f,E;const{id:_}=o.useParams(),{t:g}=i.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),S=null==h?void 0:h.split(".")[0],[A,b]=n.useState({}),[C,y]=n.useState(null),N={},[D]=n.useState(()=>(null==N?void 0:N.fileStoreId)||null),[O,L]=n.useState(null),[T,I]=n.useState([]),[w,P]=n.useState([]),[x,R]=n.useState([]),[F,B]=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(S,"NOC",["DocumentTypeMapping"]),{data:q}=Digit.Hooks.obps.useMDMS(S,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(g,h,{applicationNo:_}),{mutate:J}=Digit.Hooks.noc.useNOCApplicationActions(h),$=Digit.Hooks.useWorkflowDetails({tenantId:h,id:_,moduleCode:"NOC"});var Z,Q;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===(Z=$.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==$||null===(Q=$.data)||void 0===Q?void 0:Q.actionState)||{},$.data.actionState=c({},$.data)),n.useEffect(()=>{P([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;R(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;B(null==q||null===(e=q["common-masters"])||void 0===e?void 0:e.DocumentType)},[q]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),n.useEffect(()=>{if(null!=w&&w.length&&null!=x&&x.length){let e=[];w.map(t=>{var n,l;const o=x.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!=o&&null!==(n=o[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(o[0].docTypes[0].nocType=o[0].nocType,o[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(o[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],F.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,x,F]),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:o,nocDataDetails:i,nocDocumentsList:a}=e;if(null!=i&&i.length&&null!=a&&a.length&&null!=(null==i?void 0:i[0])){var r,u,s,d,c,v,f,E,_,g,h,S,A,b,C,y,N,D,I,w;const e="WF_"+(null==i||null===(r=i[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==i||null===(u=i[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"}},""+o("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:""+o("NOC_"+(null==i||null===(d=i[0])||void 0===d?void 0:d.nocType)+"_APPLICATION_LABEL"),text:o(null==i||null===(c=i[0])||void 0===c?void 0:c.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_STATUS_LABEL"),text:o(e)||"NA",textStyle:"APPROVED"==(null==i||null===(v=i[0])||void 0===v?void 0:v.applicationStatus)||"AUTO_APPROVED"==(null==i||null===(f=i[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_SUBMITED_ON_LABEL"),text:null!=i&&null!==(E=i[0])&&void 0!==E&&null!==(_=E.additionalDetails)&&void 0!==_&&_.SubmittedOn?m(Number(null==i||null===(g=i[0])||void 0===g||null===(h=g.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVAL_NO_LABEL"),text:(null==i||null===(S=i[0])||void 0===S?void 0:S.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?m(Number(null==i||null===(A=i[0])||void 0===A||null===(b=A.auditDetails)||void 0===b?void 0:b.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("Documents"),text:""})),null!=i&&null!==(C=i[0])&&void 0!==C&&C.documents&&(null==i||null===(y=i[0])||void 0===y?void 0:y.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==i||null===(N=i[0])||void 0===N||null===(D=N.documents)||void 0===D?void 0:D.map((e,n)=>{var i,r;return l.createElement("a",{target:"_",href:null===(i=k[e.fileStoreId])||void 0===i?void 0:i.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"}},o("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,o("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==$||null===(I=$.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:o,error:O,setError:L,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,D,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:A,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:J,workflowDetails:$,businessService:null!=$&&null!==(s=$.data)&&void 0!==s&&s.applicationBusinessService?null==$||null===(d=$.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:C,setShowToast:y,closeToast:()=>{y(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}=i.useTranslation(),s=window.localStorage.getItem("Employee.tenant-id"),[d,v]=n.useState(),m={},p={moduleName:"noc-service",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},E={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},_=Digit.SessionStorage.get("NOC.INBOX"),g=n.useMemo(()=>_||{filterForm:p,searchForm:m,tableForm:E},[Object.values((null==_?void 0:_.filterForm)||{}),Object.values((null==_?void 0:_.searchForm)||{}),Object.values((null==_?void 0:_.tableForm)||{})]),[h,S]=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})}},g),{data:A,isLoading:b}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},u),{isLoading:C,data:y}=Digit.Hooks.noc.useInbox({tenantId:s,filters:c({},h,{getFilter:d})}),[N,D]=n.useState([]),[O,L]=n.useState([]),[T,I]=n.useState(0);n.useEffect(()=>{y&&(L((null==y?void 0:y.statuses)||[]),D((null==y?void 0:y.table)||[]),I((null==y?void 0:y.totalCount)||0))},[y]);const w={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},P=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:o}=e;return l.createElement(fl,{registerRef:t,searchFormState:n,searchFieldComponents:o})},[]),x=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:o,getFilterFormValue:i}=e;return l.createElement(El,{statuses:O,isInboxLoading:C,registerRef:t,controlFilterForm:n,setFilterFormValue:o,filterFormState:null==h?void 0:h.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:A,loadingLocalitiesForEmployeesCurrentTenant:b})},[O,C,A,b]),R={SearchFormFields:P,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),S({action:"mutateTableForm",data:c({},E)}),S({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==h?void 0:h.searchForm,resetSearchFormDefaultValues:m,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),S({action:"mutateSearchForm",data:m})}},F={FilterFormFields:x,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),S({action:"mutateTableForm",data:c({},E)}),S({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==h?void 0:h.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),S({action:"mutateFilterForm",data:p})}},B=(e=>{var t,a,r,u;let{parentRoute:s,onPageSizeChange:d,formState:v,totalCount:m,table:p,dispatch:f,onSortingByData:E}=e;const{t:_}=i.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(o.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:o}=e;return null!==(t=o.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(io(new Date(null===(n=o.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},{Header:_("ES_INBOX_LOCALITY"),accessor:e=>_(null==e?void 0:e.locality),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=>{S({action:"mutateTableForm",data:c({},h.tableForm,{limit:e.target.value})})},formState:h,totalCount:T,table:N,dispatch:S,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";h.tableForm.sortBy===t&&h.tableForm.sortOrder===l||S({action:"mutateTableForm",data:c({},h.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),M=(e=>{let{parentRoute:n,table:o}=e;const{t:a}=i.useTranslation();return{data:null==o?void 0:o.map(e=>{let{applicationId:t,date:n,locality:l,status:o}=e;return{[a("NOC_APPLICATION_NUMBER")]:t,[a("TL_COMMON_TABLE_COL_APP_DATE")]:io(new Date(n),"dd/MM/yyyy"),[a("PT_COMMON_TABLE_COL_STATUS_LABEL")]:a(o),[a("ES_INBOX_LOCALITY")]:a(l)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:a("NOC_APP_NO_LABEL"),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:o,value:i}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{o(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:a,table:N}),U={onMobileSortOrderData:e=>{const{sortOrder:t}=e;S({action:"mutateTableForm",data:c({},h.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==h?void 0:h.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),S({action:"mutateTableForm",data:E})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),T?l.createElement("p",{className:"inbox-count"},T):null),l.createElement(t.InboxComposer,c({isInboxLoading:C,PropsForInboxLinks:w},R,F,U,{propsForInboxTable:B,propsForInboxMobileCards:M,formState:h})))},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}=i.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(o.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,o;return t(e((null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.currentOwner)&&""+(null==n||null===(o=n.additionalDetails)||void 0===o?void 0:o.currentOwner)||"-"))},disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),_=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,l,o;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===(o=e.additionalDetails)||void 0===o?void 0:o.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return l.createElement(r.FormProvider,p,E?l.createElement(co,{SearchFormFieldsComponent:ro,propsMobileInboxCards:_,isLoading:d,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(vo,{columns:f,SearchFormFieldsComponent:ro,onSubmit:a,data:u,error:s,isLoading:d,Count:c}))},NewNOCStepperForm:()=>{o.useHistory();const{t:e}=i.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(ho,{stepsList:yo,onSubmit:e=>{console.log("dataGet===",e)},step:d,setStep:e=>{a(bo(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var o,a,u;let{config:d,onGoNext:v,onBackClick:m}=e;const p=s.useDispatch(),{t:f}=i.useTranslation(),[E,_]=n.useState(null),[g,h]=n.useState(""),S=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),A=Digit.UserService.getUser(),{control:b,handleSubmit:C,setValue:y,formState:{errors:N},trigger:D,reset:O}=r.useForm(),L={Controller:r.Controller,control:b,setValue:y,errors:N,trigger:D,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:O};function T(e){p(Ao(d.key,e)),v()}function I(e){m(d.key,e)}const[w,P]=n.useState((null==S||null===(o=S.applicationDetails)||void 0===o?void 0:o.isRegisteredStakeHolder)||!1),x=Digit.ULBService.getStateId(),[R,F]=n.useState(!1),B=null==A||null===(a=A.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(x,"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!=B&&B.includes(e)&&P(!0)})}},[U]),n.useEffect(()=>{var e;null!=S&&null!==(e=S.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&y("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:C(e=>{D(),N.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(Do,c({onGoBack:I,goNext:T,currentStepData:S,t:f},L)),l.createElement(No,c({onGoBack:I,goNext:T,currentStepData:S,t:f},L))):l.createElement(l.Fragment,null,l.createElement(No,c({onGoBack:I,goNext:T,currentStepData:S,t:f},L)))),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=>{var o;let{config:a,onBackClick:u,onGoNext:d}=e;const{t:v}=i.useTranslation(),m=s.useDispatch(),[p,f]=n.useState(null),[E,_]=n.useState(null),g=(null===(o=Digit.UserService.getUser())||void 0===o?void 0:o.info)||{},{control:h,handleSubmit:S,setValue:A,formState:{errors:b},trigger:C,watch:y}=r.useForm({defaultValues:{floorArea:[{value:""}]}}),N=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),D={Controller:r.Controller,control:h,setValue:A,errors:b,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:r.useFieldArray,watch:y};let O;function L(e){m(Ao(a.key,e)),d()}function T(e){u(a.key,e)}return O=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:S(e=>{var t,n,l;C(),m(Ao(a.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?d():function(e){try{var t,n,l,o;const i=c({},e),a=window.location.href.includes("citizen")?{mobileNumber:(null==g?void 0:g.mobileNumber)||"",name:(null==g?void 0:g.name)||"",emailId:(null==g?void 0:g.emailId)||"",userName:(null==g?void 0:g.userName)||""}:{mobileNumber:(null==i||null===(t=i.applicationDetails)||void 0===t?void 0:t.applicantMobileNumber)||"",name:(null==i||null===(n=i.applicationDetails)||void 0===n?void 0:n.applicantOwnerOrFirmName)||"",emailId:(null==i||null===(l=i.applicationDetails)||void 0===l?void 0:l.applicantEmailId)||"",userName:(null==i||null===(o=i.applicationDetails)||void 0===o?void 0:o.applicantMobileNumber)||""},r={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:O,owners:[a],workflow:{action:"INITIATE"},nocDetails:{additionalDetails:i,tenantId:O}}};console.log("final Payload here==>",r),Promise.resolve(Digit.NOCService.NOCcreate({tenantId:O,details:r})).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 !!!"),m(Ao("apiData",e)),d(),{isSuccess:!0,response:e}):(console.log("error : create api not executed successfully !!!"),f({key:"error",message:"Something went wrong, try after sometime"}),_("Something went wrong, try after sometime"),{isSuccess:!1,response:e})})}catch(e){return Promise.reject(e)}}(c({},N,{siteDetails:c({},e)}))})},l.createElement("div",{className:"employeeCard"},l.createElement(Oo,c({onGoBack:T,goNext:L,currentStepData:N,t:v},D)),l.createElement(Lo,c({onGoBack:T,goNext:L,currentStepData:N,t:v},D))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:T}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),p&&l.createElement(t.Toast,{isDleteBtn:!0,error:"error"==p.key,label:E,onClose:()=>{f(null),_(null)}}))},NewNOCStepFormThree:e=>{let{config:o,onGoNext:i,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==o?void 0:o.key]?e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.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:o.currStepConfig,onSubmit:function(e){var t,n,l,o;const a=function(e){if(!f){var t,n;const l=(null==E||null===(t=E.NOC)||void 0===t?void 0:t.Documents)||[],o=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],i=l.filter(e=>e.required).map(e=>e.code),a=o.map(e=>e.documentType);return i.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!==(o=g.Longitude2)&&void 0!==o&&o.trim()?void i():(m(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void c(!0))},onFormValueChange:function(e,t){Nn.isEqual(t,_)||u(Ao(o.key,t))},label:r(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{c(!1),m("")}}))},NewNOCStepFormFour:e=>{var i,a,r,u,d,v,m,p,f,E,_,g,h;let{config:S,onGoNext:A,onBackClick:b,t:C}=e;const y=s.useDispatch(),[N,D]=n.useState(!1),[O,L]=n.useState(""),T=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)||{}}),I=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",I);const w=n.useRef();let P=Digit.UserService.getUser();const x=null==P||null===(i=P.info)||void 0===i||null===(a=i.roles)||void 0===a?void 0:a.map(e=>e.code),[R,F]=n.useState(!1);Digit.Hooks.useClickOutside(w,()=>{F(!1)},R);const B=o.useHistory();let M;M=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const U=function(e){try{console.log("formData in parent SummaryPage",T);const t=wt(function(){return Promise.resolve(k(T,e)).then(function(e){var t,n,l,o,i,a,r,u;null!=e&&e.isSuccess?(window.location.href.includes("citizen")?(console.log("we are calling citizen response page"),B.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(t=e.response)||void 0===t||null===(n=t.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:null==e?void 0:e.response}})):(console.log("we are calling employee response page"),B.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.response)||void 0===o||null===(i=o.Noc)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.applicationNo),state:{data:null==e?void 0:e.response}})),A()):(console.error("Submission failed, not moving to next step.",null==e?void 0:e.response),L((null==e||null===(r=e.Errors)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.message)||"Update failed, Please try again"),D(!0))})},function(){var e,t,n;L((null===(e=res)||void 0===e||null===(t=e.Errors)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.message)||"Update failed due to some error occurred"),D(!0)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k=function(e,t){try{console.log("formData inside onSubmit",e);const n=function(e,t){var n,l,o,i,a,r,u,s,d,v;console.log("nocFormData",e);const m=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===(o=e.apiData)||void 0===o||null===(i=o.Noc)||void 0===i||null===(a=i[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),siteDetails:c({},null==e?void 0:e.siteDetails),coordinates:c({},I)})}),documents:[]});return((null==e||null===(d=e.documents)||void 0===d||null===(v=d.documents)||void 0===v?void 0:v.documents)||[]).forEach(e=>{m.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({},m)}}(e,t);return console.log("finalPayload here==>",n),Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:M,details:n})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success: Update API "),y({type:"RESET_NOC_NEW_APPLICATION_FORM"}),{isSuccess:!0,response:e}):(console.log("Error: Update API"),{isSuccess:!1,response:e})})}catch(e){return Promise.reject(e)}};function W(e){b(S.key,e)}console.log("currentStepData in StepFour",T);const H=(null==T||null===(r=T.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==>",H);const j=Digit.Hooks.useWorkflowDetails({tenantId:M,id:H,moduleCode:"NOC"});console.log("workflow Details here==>",j);let z=(null==j||null===(v=j.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==j||null===(f=j.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",z),l.createElement(l.Fragment,null,l.createElement(To,{onGoBack:W,goNext:U,currentStepData:T,t:C}),z&&l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:W}),R&&(null!=j&&null!==(_=j.data)&&void 0!==_&&null!==(g=_.actionState)&&void 0!==g&&g.nextActions||null!=j&&null!==(h=j.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:z,optionKey:"action",t:C,onSelect:function(e){U(e)}}):null,l.createElement(t.SubmitBar,{ref:w,label:C("WF_TAKE_ACTION"),onSubmit:()=>F(!R)})),N&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:O,onClose:()=>{D(!1),L("")}}))},NOCApplicantDetails:No,NOCProfessionalDetails:Do,NOCSiteDetails:Oo,NOCSpecificationDetails:Lo,NOCDocumentsRequired:e=>{var o,i,a;let{t:r,config:u,onSelect:d,formData:v}=e;Digit.ULBService.getStateId();const[m,p]=n.useState(null==v||null===(o=v.documents)||void 0===o?void 0:o.documents);console.log("documents in childStep three",m);const[f,E]=n.useState(null),[_,g]=n.useState(!0),[h,S]=n.useState(!1),[A,b]=n.useState(null),C=Digit.ULBService.getStateId(),y=s.useDispatch(),{isLoading:N,data:D}=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&&b(O)},[O]),console.log("coordinates (from redux)",O),console.log("geocoordinates",A);const L=()=>{let e;e=c({},v.documents,{documents:m}),d(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==D||null===(e=D.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)}),g("0"!=n&&0!=n||!((null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,N?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:L,onSkip:()=>d(),isDisabled:_,onAdd:function(){}},null==D||null===(i=D.NOC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(Io,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:S,handleSubmit:L,geocoordinates:A,setGeoCoordinates:b,dispatch:y})),f&&l.createElement(t.Toast,{label:f,isDleteBtn:!0,onClose:()=>E(null),error:!0})))},NOCSummary:To,NOCDocumentWithLatLong:e=>{var o,i,a;let{t:r,config:u,onSelect:s,formData:d}=e;const v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==d||null===(o=d.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[_,g]=n.useState(!0),[h,S]=n.useState(!1),[A,b]=n.useState(!1),C=ht((null==d?void 0:d.PrevStateDocuments)||[]),{isLoading:y,data:N}=Digit.Hooks.pt.usePropertyMDMS(v,"NOC",["Documents"]),D=()=>{let e;e=c({},d.documents,{documents:m}),s(u.key,e)};return n.useEffect(()=>{var e,t;const n=null==N||null===(e=N.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,o,i,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(o=l.split("."))||void 0===o?void 0:o[0])+"."+(null==n||null===(i=n.documentType)||void 0===i||null===(a=i.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,y?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:D,onSkip:()=>s(),onAdd:function(){}},null==N||null===(i=N.NOC)||void 0===i||null===(a=i.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(wo,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:S,formData:d,beforeUploadDocuments:C||[],isNextButtonDisabled:A,setIsNextButtonDisabled:b,handleSubmit:D}))),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;const r=o.useLocation(),{pathname:u,state:s}=r,{t:d}=i.useTranslation(),c=o.useHistory(),v=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];console.log("nocData here",v);const m=window.localStorage.getItem("CITIZEN.CITY"),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=u.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:d("NOC_APPLICATION_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":d(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:d("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=v,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,d)).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:d("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:d("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{c.push("/digit-ui/citizen/noc-home")}}),l.createElement(t.SubmitBar,{label:d("COMMON_MAKE_PAYMENT"),onSubmit:()=>{c.push("/digit-ui/citizen/payment/collect/obpas_noc/"+_+"/"+m+"?tenantId="+m)}}))))},NOCCitizenMyApplications:e=>{var n,a,r;const{t:u}=i.useTranslation(),s=(o.useHistory(),(null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.info)||{}),d=window.localStorage.getItem("CITIZEN.CITY"),{isLoading:c,data:v}=Digit.Hooks.noc.useNOCCitizenSearchApplication({mobileNumber:s.mobileNumber},d);return console.log("data herein NOC==>",v),c?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"applications-list-container"},l.createElement(t.Header,null,""+u("NOC_MY_APPLICATION")),0===(null==v||null===(a=v.data)||void 0===a?void 0:a.length)&&l.createElement(t.Card,{style:{textAlign:"center"}},u("NO_APPLICATIONS_MSG")),null==v||null===(r=v.data)||void 0===r?void 0:r.map((e,n)=>{var i,a,r,s;const c=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(c).filter(e=>null!==c[e]).map(e=>l.createElement(t.KeyNote,{keyValue:u(e),note:u(c[e])})),"PENDINGPAYMENT"!=(null==e||null===(i=e.Applications)||void 0===i?void 0:i.applicationStatus)&&l.createElement(o.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(a=e.Applications)||void 0===a?void 0:a.applicationNo)},l.createElement(t.SubmitBar,{label:u("TL_VIEW_DETAILS")})),"PENDINGPAYMENT"===(null==e||null===(r=e.Applications)||void 0===r?void 0:r.applicationStatus)&&l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/obpas_noc/"+(null==e||null===(s=e.Applications)||void 0===s?void 0:s.uuid)+"/"+d+"?tenantId="+d}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t.SubmitBar,{label:u("COMMON_MAKE_PAYMENT")})))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,s,d,c,v,m,p,f;const{id:E}=o.useParams(),{t:_}=i.useTranslation(),g=window.localStorage.getItem("CITIZEN.CITY"),[h,S]=n.useState({}),{isLoading:A,data:b}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:E},g);console.log("applicationDetails here==>",b);const{data:C}=Digit.Hooks.useStore.getInitData(),{tenants:y}=C||{};let N=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):{};N=null==t?void 0:t.value}return null===(e=N)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r||r.map(e=>e.code),n.useEffect(()=>{var e;const t=null==b||null===(e=b.Noc)||void 0===e?void 0:e[0];if(t){var n,l,o,i;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===(o=t.nocDetails)||void 0===o||null===(i=o.additionalDetails)||void 0===i?void 0:i.siteDetails,r=(null==t?void 0:t.documents)||[];console.log("applicantDetails",e),console.log("siteDetails",a),S({applicantDetails:e?[e]:[],siteDetails:a?[a]:[],Documents:r.length>0?r:[]})}},[null==b?void 0:b.Noc]),A?l.createElement(t.Loader,null):(console.log("displayData here",h),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"}},_("NDC_APP_OVER_VIEW_HEADER")),"APPROVED"===(null==b||null===(u=b.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.applicationStatus)&&l.createElement(t.LinkButton,{label:_("DOWNLOAD_CERTIFICATE"),style:{color:"#A52A2A"},onClick:function(){try{const e=b;console.log("applicationDetails in NOC",b),console.log("tenants",y);const t=y.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,_)).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,_("NOC_APPLICANT_DETAILS")),null==h||null===(d=h.applicantDetails)||void 0===d?void 0:d.map((e,n)=>{var o;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:_("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:_("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:_("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:_("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.applicantMobileNumber)||"N/A"}),l.createElement(t.Row,{label:_("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:_("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(o=e.applicantGender)||void 0===o?void 0:o.code)||"N/A"}),l.createElement(t.Row,{label:_("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"})))})),(null==h||null===(c=h.applicantDetails)||void 0===c?void 0:c.professionalName)&&(null==h||null===(v=h.applicantDetails)||void 0===v?void 0:v.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,_("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:_("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:_("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:_("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:_("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),l.createElement(t.Row,{label:_("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,_("NOC_SITE_DETAILS")),null==h||null===(m=h.siteDetails)||void 0===m?void 0:m.map((e,n)=>{var o,i,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:_("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:_("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:_("NOC_ULB_NAME_LABEL"),text:(null==e||null===(o=e.ulbName)||void 0===o?void 0:o.name)||"N/A"}),l.createElement(t.Row,{label:_("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:_("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:_("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:_("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(i=e.roadType)||void 0===i?void 0:i.name)||"N/A"}),l.createElement(t.Row,{label:_("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:_("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:_("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:_("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||"N/A"}),l.createElement(t.Row,{label:_("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||"N/A"}),"BUILTUP"==(null==e||null===(u=e.buildingStatus)||void 0===u?void 0:u.code)&&l.createElement(t.Row,{label:_("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=>{_(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:_("NOC_TOTAL_FLOOR_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:_("NOC_DISTRICT_LABEL"),text:(null==e||null===(v=e.district)||void 0===v?void 0:v.name)||"N/A"}),l.createElement(t.Row,{label:_("NOC_ZONE_LABEL"),text:(null==e||null===(m=e.zone)||void 0===m?void 0:m.name)||"N/A"}),l.createElement(t.Row,{label:_("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:_("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,_("NOC_SPECIFICATION_DETAILS")),null==h||null===(p=h.siteDetails)||void 0===p?void 0:p.map((e,n)=>{var o;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:_("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:_("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(o=e.specificationBuildingCategory)||void 0===o?void 0:o.name)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,_("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:{display:"flex",gap:"16px"}},Array.isArray(null==h?void 0:h.Documents)&&(null==h||null===(f=h.Documents)||void 0===f?void 0:f.length)>0?l.createElement(sl,{value:{workflowDocs:null==h?void 0:h.Documents}}):l.createElement("div",null,_("NOC_NO_DOCUMENTS_MSG"))))))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,s,d,v,m,p,f,E,_,g,h,S,A,b,C,y,N,D,O,L,T,I,w;const{id:P}=o.useParams(),{t:x}=i.useTranslation(),R=window.localStorage.getItem("Employee.tenant-id"),F=o.useHistory(),B=null==R?void 0:R.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({}),[q,K]=n.useState(!1),{isLoading:X,data:J}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:P},R);console.log("applicationDetails here==>",J);const $=Digit.Hooks.useWorkflowDetails({tenantId:R,id:P,moduleCode:"noc-service",role:"EMPLOYEE"});var Z,Q;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===(Z=$.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==$||null===(Q=$.data)||void 0===Q?void 0:Q.actionState)||{},$.data.actionState=c({},$.data));const[ee,te]=n.useState(!1),[ne,le]=n.useState(null),[oe,ie]=n.useState(!1),ae=()=>{U(null)};let re=Digit.UserService.getUser();const ue=n.useRef();if(Digit.Hooks.useClickOutside(ue,()=>{te(!1)},ee),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};re=null==t?void 0:t.value}const se=null===(u=re)||void 0===u||null===(s=u.info)||void 0===s||null===(d=s.roles)||void 0===d?void 0:d.map(e=>e.code);let de=(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==se?void 0:se.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==se?void 0:se.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));console.log("actions here",de),n.useEffect(()=>{var e;const t=null==J||null===(e=J.Noc)||void 0===e?void 0:e[0];if(t){var n,l,o,i;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===(o=t.nocDetails)||void 0===o||null===(i=o.additionalDetails)||void 0===i?void 0:i.siteDetails,r=(null==t?void 0:t.documents)||[];Y({applicantDetails:e?[e]:[],siteDetails:a?[a]:[],Documents:r.length>0?r:[]})}},[null==J?void 0:J.Noc]);const ce=function(e){try{var t,n;const l=c({},(null==J||null===(t=J.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),o=null==e||null===(n=e.Licenses)||void 0===n?void 0:n[0];if(console.log("filtData",o),l.workflow={action:o.action,assignes:null==o?void 0:o.assignee,comment:null==o?void 0:o.comment,documents:null==o?void 0:o.wfDocuments},console.log("updatedApplicant",l),!(null!=o&&o.assignee||"FORWARD"!=o.action))return U({key:"error"}),W("Assignee is mandatory"),Promise.resolve();if(!(null!=o&&o.comment||"FORWARD"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)))return V("Comment is mandatory"),j(!0),Promise.resolve();const i={Noc:c({},l)};console.log("final Payload ",i);const a=wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:R,details:i})).then(function(e){U({key:"success",message:"Successfully updated the status"}),W("Successfully updated the status"),$.revalidate(),le(null),ie(!1)})},function(){U({key:"error",message:"Something went wrong"}),W("Something went wrong")});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"}},x("NDC_APP_OVER_VIEW_HEADER"))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_APPLICANT_DETAILS")),null==G||null===(_=G.applicantDetails)||void 0===_?void 0:_.map((e,n)=>{var o;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===(o=e.applicantGender)||void 0===o?void 0:o.code)||"N/A"}),l.createElement(t.Row,{label:x("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,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==G||null===(S=G.siteDetails)||void 0===S?void 0:S.map((e,n)=>{var o,i,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===(o=e.ulbName)||void 0===o?void 0:o.name)||"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===(i=e.roadType)||void 0===i?void 0:i.name)||"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)||"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)||"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)||"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)||"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.Card,null,l.createElement(t.CardSubHeader,null,x("NOC_SPECIFICATION_DETAILS")),null==G||null===(A=G.siteDetails)||void 0===A?void 0:A.map((e,n)=>{var o;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===(o=e.specificationBuildingCategory)||void 0===o?void 0:o.name)||"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==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,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===(y=$.data)||void 0===y?void 0:y.timeline.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:x(null==$||null===(N=$.data)||void 0===N||null===(D=N.timeline[0])||void 0===D?void 0:D.status)}):l.createElement(t.ConnectingCheckPoints,null,null==$||null===(O=$.data)||void 0===O?void 0:O.timeline.map((e,n,o)=>l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:x("NOC_STATUS_"+e.status),customChild:pl(e,n,0,x)})))),de&&l.createElement(t.ActionBar,null,ee&&(null!=$&&null!==(L=$.data)&&void 0!==L&&null!==(T=L.actionState)&&void 0!==T&&T.nextActions||null!=$&&null!==(I=$.data)&&void 0!==I&&I.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:de,optionKey:"action",t:x,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,o={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?F.push("/digit-ui/employee/noc/edit-application/"+l):"APPLY"==(null==e?void 0:e.action)?ce(o):"PAY"==(null==e?void 0:e.action)?F.push("/digit-ui/employee/payment/collect/obpas_noc/"+l+"/"+R+"?tenantId="+R):(ie(!0),le(e))}}):null,l.createElement(t.SubmitBar,{ref:ue,label:x("WF_TAKE_ACTION"),onSubmit:()=>te(!ee)})),oe?l.createElement(ml,{t:x,action:ne,tenantId:R,state:B,id:P,applicationDetails:J,applicationData:null==J?void 0:J.Noc,closeModal:()=>{le(null),ie(!1)},submitAction:ce,actionData:null==$||null===(w=$.data)||void 0===w?void 0:w.timeline,workflowDetails:$,showToast:M,closeToast:ae,errors:k,showErrorToast:H,errorOne:z,closeToastOne:()=>{j(null)}}):null,M&&l.createElement(t.Toast,{error:"error"==M.key,label:k,isDleteBtn:!0,onClose:ae})))},NewNOCEditApplication:()=>{var e,a,r,u,d,c,v;const{id:m}=o.useParams(),{t:p}=(o.useHistory(),i.useTranslation()),f=s.useDispatch(),[E,_]=n.useState(null),g=s.useSelector(e=>e.noc.NOCNewApplicationFormReducer),h=g.formData,S=g.step,A=Digit.ULBService.getCurrentTenantId();console.log("tenantId here",A);const{isLoading:b,data:C}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:m},A);console.log("applicationDetails here==>",C);const y=(null==C||null===(e=C.Noc)||void 0===e?void 0:e[0])||{},N=(null==y||null===(a=y.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},D=(null==y||null===(u=y.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.siteDetails)||{},O=(null==y?void 0:y.documents)||[],L=(null==y||null===(c=y.nocDetails)||void 0===c||null===(v=c.additionalDetails)||void 0===v?void 0:v.coordinates)||{};return n.useEffect(()=>{if(!b&&null!=y&&y.nocDetails){const e={documents:{documents:null==O?void 0:O.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(L).forEach(e=>{let[t,n]=e;f(Co(t,n))}),f(Ao("applicationDetails",N)),f(Ao("siteDetails",D)),f(Ao("documents",e)),f(Ao("apiData",C))}},[b,C]),b||!h.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},p("NOC_REGISTRATION_APPLICATION")),l.createElement(ho,{stepsList:Po,onSubmit:e=>{},step:S,setStep:e=>{f(bo(e))}}),E&&l.createElement(t.Toast,{error:E.key,label:p(E.label),onClose:()=>{_(null)},isDleteBtn:"true"}))}};exports.NOCLinks=xo,exports.NOCModule=Ro,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:po}),exports.initNOCComponents=()=>{Object.entries(Fo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|