@mseva/digit-ui-module-sv 1.0.76 → 1.0.78

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 CHANGED
@@ -1 +1 @@
1
- var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),a=require("react-query"),r=require("react-hook-form");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 u(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 s=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"SVRequiredDoc",nextStep:"applicant-details",key:"Documents"},{route:"applicant-details",component:"SVApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"business-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_VENDOR_PERSONAL_DETAILS"}},{route:"business-details",component:"SVBusinessDetails",withoutLabel:!0,key:"businessDetails",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_VENDOR_BUSINESS_DETAILS"}},{route:"address-details",component:"SVAdrressDetails",withoutLabel:!0,key:"address",type:"component",nextStep:"correspondence-address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_ADDRESS_DETAILS"}},{route:"correspondence-address-details",component:"SVAdrressDetails",withoutLabel:!0,key:"correspondenceAddress",type:"component",nextStep:"bank-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_CORRESPONDENCE_ADDRESS_DETAILS"}},{route:"bank-details",component:"SVBankDetails",withoutLabel:!0,key:"bankdetails",type:"component",nextStep:"document-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_BANK_DETAILS"}},{route:"document-details",component:"SVDocumentsDetail",type:"component",nextStep:"special-category",isMandatory:!0,key:"documents",texts:{header:"SV_DOCUMENT_DETAILS_LABEL",submitBarLabel:"COMMON_SAVE_NEXT"}},{route:"special-category",component:"SVSpecialCategory",withoutLabel:!0,key:"specialCategoryData",type:"component",nextStep:null,hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_SPECIAL_CATEGORY_DETAILS"}}]}],c=["path","url"],v=()=>{var e,n,i,a,r,d;const s=o.useRouteMatch(),{path:v}=s,m=(u(s,c),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("Create")),p=null===(i=Digit)||void 0===i||null===(a=i.ComponentRegistryService)||void 0===a?void 0:a.getComponent("SVMyApplications"),f=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("SvApplicationDetails");return l.createElement("span",{className:"sv-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(t.PrivateRoute,{path:v+"/apply",component:m}),l.createElement(t.PrivateRoute,{path:v+"/edit",component:m}),l.createElement(t.PrivateRoute,{path:v+"/my-applications",component:p}),l.createElement(t.PrivateRoute,{path:v+"/application/:applicationNo/:tenantId",component:f}))))};let m=["SV_VENDOR_PERSONAL_DETAILS","SV_VENDOR_BUSINESS_DETAILS","SV_ADDRESS_DETAILS","SV_BANK_DETAILS","SV_DOCUMENT_DETAILS_LABEL","SV_SPECIAL_CATEGORY","SV_SUMMARY_PAGE"];const p=e=>{let{currentStep:n=1}=e;const{t:o}=i.useTranslation(),a=Digit.UserService.getUser().info,r=window.Digit.Utils.browser.isMobile();return l.createElement("div",{className:"timeline-container",style:r?{}:"EMPLOYEE"===(null==a?void 0:a.type)?{maxWidth:"960px",minWidth:"640px",marginRight:"auto",marginLeft:"auto",display:"flex",justifyContent:"center"}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto",display:"flex",justifyContent:"center"}},m.map((e,i,a)=>l.createElement("div",{className:"timeline-checkpoint",key:i},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(i<=n-1&&"active")},i<n-1?l.createElement(t.TickMark,null):i+1),l.createElement("span",{className:"secondary-color"},o(e))),i<a.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))},f=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},E=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},g=function(e,t){let n=[];if((null==e?void 0:e.length)>0){let t=e.filter((t,n)=>e.findIndex(e=>{var n,l,i,o,a,r;return(null==e||null===(n=e.documentType)||void 0===n||null===(l=n.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))===(null==t||null===(o=t.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))})===n);null==t||t.map(t=>{var l,i,o,a;const r=null==e?void 0:e.filter(e=>{var n,l,i,o,a,r;return(null==t||null===(n=t.documentType)||void 0===n||null===(l=n.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))==(null==e||null===(o=e.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))});null==r||r.forEach(e=>e.title=e.documentType),n.push({title:null==r||null===(l=r[0])||void 0===l||null===(i=l.documentType)||void 0===i||null===(o=i.split("."))||void 0===o||null===(a=o.slice(0,2))||void 0===a?void 0:a.join("_"),values:r})})}return n},S=e=>{if(!Array.isArray(e))return[];const t=sessionStorage.getItem("CategoryDocument"),n=t?JSON.parse(t):null,l=e.map(e=>{var t,n;return{applicationId:"",documentType:e.documentType,fileStoreId:window.location.href.includes("edit")?null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId:e.fileStoreId,documentDetailId:window.location.href.includes("edit")?null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId:e.documentUid,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}}});var i,o,a;return n&&l.push({applicationId:"",documentType:(null==n||null===(i=n[0])||void 0===i?void 0:i.documentType)||"",fileStoreId:(null==n||null===(o=n[0])||void 0===o?void 0:o.fileStoreId)||"",documentDetailId:(null==n||null===(a=n[0])||void 0===a?void 0:a.documentUid)||"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}}),l};function h(e){let{documents:t,isSendBackFlow:n=!1,isHrLine:o=!1}=e;const{t:a}=i.useTranslation(),r=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{width:"24",height:"24",rx:"4",fill:"#D32F2F"}),l.createElement("text",{x:"0",y:"16","font-family":"Arial, sans-serif","font-size":"12","font-weight":"bold",fill:"#FFFFFF"},"PDF"));return l.createElement("div",{style:{marginTop:"19px"}},null==t?void 0:t.map((e,i)=>{var d;return l.createElement(l.Fragment,{key:i},l.createElement("div",{className:"documentWidth",style:{width:"50%"}},l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(d=e.values)||void 0===d?void 0:d.map((e,t)=>{var i;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:t},l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"8px"}},l.createElement("p",{style:{margin:0,fontWeight:"bold",color:"#0000FF",textDecoration:"underline"}},a(null==e?void 0:e.title)),l.createElement(r,null)," "),n?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},a(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},a(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,a("SV_NO_DOCUMENTS_UPLOADED_LABEL")))),o&&(null==t?void 0:t.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))}))}const y=e=>{var i;let{t:o,onSelect:a,formData:r={},handleRemove:d,onSave:u}=e;const[s,c]=n.useState((null==r||null===(i=r.address)||void 0===i?void 0:i.location)||{}),v=Digit.Hooks.obps.useTenants();Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let m=!Digit.Utils.browser.isMobile();return l.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"21px",left:"0"}},l.createElement("div",{style:{position:"relative",marginTop:"60px"}},l.createElement("div",{style:m?{marginLeft:"25%",marginRight:"25%"}:{}},l.createElement(t.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:o("SV_GIS_LABEL"),cardText:o(""),nextText:o("SV_PIN_LOCATION_LABEL"),skip:()=>a(),t:o,position:s,onSave:()=>u(s),onChange:(e,t)=>((e,t)=>{const n=null==v?void 0:v.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==e)});c(n?t:{})})(e,t),disabled:!1,isPlaceRequired:!0,handleRemove:d,Webview:m,isPopUp:!0}))))},b=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:d,onSort:u,onNextPage:s,onPrevPage:c,onPageSizeChange:v,pageSizeLimit:m,sortParams:p,totalRecords:f,styles:E,isPaginationRequired:g}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:s,onPrevPage:c,pageSizeLimit:m,disableSort:d,onPageSizeChange:v,onSort:u,sortParams:p,totalRecords:f,styles:E,isPaginationRequired:g})};function D(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function A(e){var i,o,a;let{t:r,document:u,setDocuments:s,setError:c,documents:v,id:m,editdata:p,previousData:f}=e;const E=null==v?void 0:v.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}),g=null==f||null===(i=f.documentDetails)||void 0===i?void 0:i.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}),S=null==p||null===(o=p.documentDetails)||void 0===o?void 0:o.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}),h=Digit.UserService.getUser().info,y=e=>e?d({},e,{active:!0===(null==u?void 0:u.active),code:null==e?void 0:e.documentType,i18nKey:null==e?void 0:e.documentType}):null,_=y(g)||y(S)||y(E)||(1===(null==u||null===(a=u.dropdownData)||void 0===a?void 0:a.length)?null==u?void 0:u.dropdownData[0]:{}),[b,D]=n.useState(_),[A,C]=n.useState(null),[N,T]=n.useState((null==_?void 0:_.fileStoreId)||null),[I,w]=n.useState(!1);n.useEffect(()=>{var e;const t=(null==f?void 0:f.documentDetails)||(null==p?void 0:p.documentDetails)||[];null==t||null===(e=t.documentDetails)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==u?void 0:u.code)&&T(e)})},[null==p?void 0:p.documentDetails,null==f?void 0:f.documentDetails,null==u?void 0:u.code]),n.useEffect(()=>{A&&(A.size>=5242880?c(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")):(T(null),w(!0),Digit.UploadServices.Filestorage("StreetVending",A,Digit.ULBService.getStateId()).then(e=>{var t,n;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(e.data.files[0].fileStoreId):c(r("CS_FILE_UPLOAD_ERROR"))}).catch(()=>c(r("CS_FILE_UPLOAD_ERROR"))).finally(()=>{w(!1)})))},[A,r]),n.useEffect(()=>{var e;null!=b&&b.code&&(null==f||null===(e=f.draftId)||void 0===e?void 0:e.length)>1?s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==b?void 0:b.code));return N?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==N),{documentType:null==b?void 0:b.code,fileStoreId:N,documentUid:N}]:t}):null!=b&&b.code&&null!=p&&p.applicationNo?s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==b?void 0:b.code));return N?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==N),{documentType:null==b?void 0:b.code,fileStoreId:N,documentUid:N}]:t}):null!=b&&b.code&&s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==b?void 0:b.code));return N?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==N),{documentType:null==b?void 0:b.code,fileStoreId:N,documentUid:N}]:t})},[N,b,s]);const{dropdownData:O}=u;let x=O;const R=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement("div",{style:{marginBottom:"24px"}},(null==u?void 0:u.hasDropdown)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},r(null==u?void 0:u.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{D(e)},style:{width:"EMPLOYEE"===(null==h?void 0:h.type)?"50%":"100%"},option:x.map(e=>{var t;return d({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),optionKey:"i18nKey",t:r,placeholder:"Select"})),l.createElement(t.LabelFieldPair,null,l.createElement("div",{className:"field",style:{marginLeft:"EMPLOYEE"===(null==h?void 0:h.type)?"30%":null}},l.createElement(t.UploadFile,{onUpload:e=>{C(e.target.files[0])},onDelete:()=>{T(null)},id:m,message:I?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(R,null),l.createElement("span",null,"Uploading...")):N?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!N}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const C=e=>{let{jumpTo:n}=e;i.useTranslation();const a=o.useHistory();return l.createElement(t.LinkButton,{label:l.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(n)}})},N={date:t.DatePicker,mobileNumber:t.MobileNumber},T=e=>{var n;let{onSearch:o,type:a,onClose:u,searchFields:s,searchParams:c,isInboxPage:v,clearSearch:m}=e;const{t:p}=i.useTranslation(),{handleSubmit:f,reset:E,watch:g,control:S,formState:h,setValue:y}=r.useForm({defaultValues:v?c:d({locality:null,city:null},c)}),_=g(),b=innerWidth<=640;function D(){const e=s.reduce((e,t)=>d({},e,{[null==t?void 0:t.name]:""}),{});if(E(e),v){const e=d({},c);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(d({},e))}else m()}const A=e=>l.createElement(t.LinkLabel,{style:d({display:"inline",margin:"10px"},e?{margin:0}:{}),onClick:D},p("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:f(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===a&&u()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:v?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===a||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,p("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:u},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(v?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,a;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,p(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(r.Controller,e.type?{render:t=>l.createElement(null==N?void 0:N[e.type],{formValue:_,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:S,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:S,defaultValue:""})),null!=h&&null!==(i=h.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==h||null===(o=h.errors)||void 0===o||null===(a=o[e.name])||void 0===a?void 0:a.message):null)}),v&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,A())),"desktop"===a&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:p("ES_COMMON_SEARCH"),disabled:!!Object.keys(h.errors).length||(()=>{var e;let t=!0;return Object.keys(_).forEach(e=>{!["locality","city"].includes(e)&&_[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=_&&null!==(e=_.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!v&&l.createElement("div",null,A()))))),("mobile"===a||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},A(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(h.errors).length,label:p("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},I=["tableConfig","filterComponent"],w=e=>{let{tableConfig:o,filterComponent:a}=e,r=u(e,I);const{data:d,useNewInboxAPI:s}=r,{t:c}=i.useTranslation(),[v,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r.EmptyResultInboxComp)}),[E,g]=n.useState(!1),S=l.useMemo(()=>r.isSearch?o.searchColumns(r):o.inboxColumns(r)||[],[]);let h;return r.isLoading?h=l.createElement(t.Loader,null):E?h=null:!d||0===(null==d?void 0:d.length)||s&&null!=d&&d[0].dataEmpty?h=p&&l.createElement(p,{data:d})||(0===(null==d?void 0:d.length)||s&&null!=d&&d[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==d?void 0:d.length)>0&&(h=l.createElement(b,{t:c,data:d,columns:S,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:r.onPageSizeChange,currentPage:r.currentPage,onNextPage:r.onNextPage,onPrevPage:r.onPrevPage,pageSizeLimit:r.pageSizeLimit,onSort:r.onSort,disableSort:r.disableSort,sortParams:r.sortParams,totalRecords:r.totalRecords})),l.createElement("div",{className:"inbox-container"},!r.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement("div",null,l.createElement(v,{defaultSearchParams:r.defaultSearchParams,onFilterChange:r.onFilterChange,searchParams:r.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==d?void 0:d[0].statusMap:null,moduleCode:r.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(T,{defaultSearchParams:r.defaultSearchParams,onSearch:e=>{r.onSearch(e),g(!1)},type:"desktop",searchFields:r.searchFields,isInboxPage:!(null!=r&&r.isSearch),searchParams:r.searchParams,clearSearch:()=>g(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=r&&r.isSearch?"":"24px",flex:1}},h)))},O=e=>{const{t:o}=i.useTranslation(),[a,r]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function d(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:d},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:d},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},x=e=>{let{t:i,data:o,onFilterChange:a,onSearch:r,onSort:d,serviceRequestIdKey:u,isFstpOperator:s,isLoading:c,isSearch:v,searchParams:m,searchFields:p,sortParams:f,linkPrefix:E,filterComponent:g}=e;const[S,h]=n.useState(v?"SEARCH":""),[y,_]=n.useState(!!v),[b,D]=n.useState(f),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{S&&_(!0)},[S]);const C=()=>{_(!1),h(""),D(f)};if(c)return l.createElement(t.Loader,null);let N;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(N=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:u,linkPrefix:E||"/digit-ui/employee/sv/"})):N=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},r&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{h("SEARCH"),_(!0)}}),!v&&a&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{h("FILTER"),_(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{h("SORT"),_(!0)}})),N,y&&l.createElement(t.PopUp,null,"FILTER"===S&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{a(e),_(!1)},Close:C,type:"mobile",searchParams:m})),"SORT"===S&&l.createElement("div",{className:"popup-module"},l.createElement(O,{type:"mobile",sortParams:f,onClose:C,onSort:d})),"SEARCH"===S&&l.createElement("div",{className:"popup-module"},l.createElement(T,{type:"mobile",onClose:C,onSearch:r,isFstpOperator:s,searchParams:m,searchFields:p}))))},R=e=>{let{classNameForMobileView:a=""}=e;const{t:r}=i.useTranslation(),d=[{text:r("SV_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/sv/apply"}],[u,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];d.forEach(t=>{var n;t.accessTo?(n=t.accessTo,c.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+a},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},r("ES_TITLE_SV_REGISTRATION"))),l.createElement("div",{className:"body"},u.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},L=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:a,onFilterChange:r,onSearch:d,onSort:u,parentRoute:s,searchParams:c,sortParams:v,linkPrefix:m,tableConfig:p,filterComponent:f}=e;const{t:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(R,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(x,{t:E,data:null==t?void 0:t.map(e=>{const t={};return(o?p.searchColumns():p.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:r,isLoading:n,isSearch:o,onSearch:d,onSort:u,searchParams:c,searchFields:a,linkPrefix:m,sortParams:v,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:f}))))},P=["isFetching","isLoading","searchResponseKey","data","searchFields"],M=e=>{var o,a,r,s,c;let{useNewInboxAPI:v,parentRoute:m,moduleCode:p="SV",initialStates:f={},filterComponent:E,isInbox:g,rawWfHandler:S,rawSearchHandler:h,combineResponse:y,wfConfig:_,searchConfig:b,middlewaresWf:D,middlewareSearch:A,EmptyResultInboxComp:C}=e;const N=Digit.ULBService.getCurrentTenantId(),{t:T}=i.useTranslation(),[I,O]=n.useState(()=>g?{}:{enabled:!1}),[x,R]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("SVInboxTableConfig")}),[M,B]=n.useState(f.pageOffset||0),[k,F]=n.useState(f.pageSize||10),[V,U]=n.useState(f.sortParams||[{id:"createdTime",desc:!0}]),[H,W]=n.useState(f.searchParams||{});let j=window.Digit.Utils.browser.isMobile(),z=j?{limit:100,offset:0,sortBy:null==V||null===(o=V[0])||void 0===o?void 0:o.id,sortOrder:null!=V&&null!==(a=V[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:k,offset:M,sortBy:null==V||null===(r=V[0])||void 0===r?void 0:r.id,sortOrder:null!=V&&null!==(s=V[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const K=v?Digit.Hooks.useNewInboxGeneral({tenantId:N,ModuleCode:p,filters:d({},H,z,{sortParams:V})}):Digit.Hooks.useInboxGeneral({tenantId:N,businessService:p,isInbox:g,filters:d({},H,z,{sortParams:V}),rawWfHandler:S,rawSearchHandler:h,combineResponse:y,wfConfig:_,searchConfig:d({},I,b),middlewaresWf:D,middlewareSearch:A}),{isLoading:G,data:Y,searchFields:q}=K,Z=u(K,P);n.useEffect(()=>{B(0)},[H]);const $=e=>{let t=e.delete,n=d({},H,e);t&&t.forEach(e=>delete n[e]),delete e.delete,W(d({},n)),O({enabled:!0})},X=n.useCallback(e=>{0!==e.length&&U(e)},[]);var J;if(null!==(null==Z||null===(c=Z.data)||void 0===c?void 0:c.length))return j?l.createElement(L,{data:Y,isLoading:G,isSearch:!g,searchFields:q,onFilterChange:$,onSearch:$,onSort:X,parentRoute:m,searchParams:H,sortParams:V,linkPrefix:m+"/application-details/",tableConfig:null!=Z&&Z.tableConfig?null==Z?void 0:Z.tableConfig:x(T).SV,filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:v}):l.createElement("div",null,g&&l.createElement(t.Header,null,T("ES_COMMON_INBOX")),l.createElement(w,{moduleCode:p,data:Y,tableConfig:x(T).SV,isLoading:G,defaultSearchParams:f.searchParams,isSearch:!g,onFilterChange:$,searchFields:q,onSearch:$,onSort:X,onNextPage:()=>{B(e=>e+k)},onPrevPage:()=>{B(e=>e-k)},currentPage:Math.floor(M/k),pageSizeLimit:k,disableSort:!1,onPageSizeChange:e=>{F(Number(e.target.value))},parentRoute:m,searchParams:H,sortParams:V,totalRecords:Number(null==Y||null===(J=Y[0])||void 0===J?void 0:J.totalCount),filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:v}))},B=e=>{var i,a;let{isLoading:d,t:u,onSubmit:s,data:c,count:v,setShowToast:m}=e;const p=window.Digit.Utils.browser.isMobile(),f=(new Date).toISOString().split("T")[0],{register:E,control:g,handleSubmit:S,setValue:h,getValues:y,reset:_,formState:b}=r.useForm({defaultValues:{offset:0,limit:!p&&10,sortBy:"commencementDate",sortOrder:"DESC",isDraftApplication:"false",fromDate:f,toDate:f}});n.useEffect(()=>{E("offset",0),E("limit",10),E("sortBy","commencementDate"),E("sortOrder","DESC"),E("isDraftApplication","false"),h("fromDate",f),h("toDate",f)},[E,h,f]);const{data:D}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingActivityType"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingActivityType}});let A=[];D&&D.map(e=>{A.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:C}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingZones"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingZones}});let N=[];C&&C.map(e=>{N.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Digit.ULBService.getStateId();const T=e=>l.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:u("SV_APPLICATION_NUMBER"),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/sv/applicationsearch/application-details/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:u("SV_VENDOR_NAME"),Cell:e=>{var t,n,l;return T(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(l=n.vendorDetail[0])||void 0===l?void 0:l.name))},disableSortBy:!0},{Header:u("SV_VENDING_TYPE"),Cell:e=>{var t,n;return T(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.vendingActivity))},disableSortBy:!0},{Header:u("SV_VENDING_ZONES"),Cell:e=>{var t,n;return T(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.vendingZone))},disableSortBy:!0},{Header:u("SV_REGISTERED_MOB_NUMBER"),Cell:e=>{var t,n;let{row:l}=e;return T(""+(null==l||null===(t=l.original)||void 0===t||null===(n=t.vendorDetail[0])||void 0===n?void 0:n.mobileNo))},disableSortBy:!0},{Header:u("SV_APPLICATION_STATUS"),Cell:e=>{var t;let{row:n}=e;return T(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.applicationStatus))},disableSortBy:!0}],[]),w=n.useCallback(e=>{0!==e.length&&(h("sortBy",e.id),h("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){h("offset",y("offset")-y("limit")),S(s)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,u("SV_SEARCH_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},u("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:s,handleSubmit:S},l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:E({})})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_VENDING_TYPE")),l.createElement(r.Controller,{control:g,name:"vendingType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:A,optionKey:"i18nKey",t:u,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_VENDING_ZONES")),l.createElement(r.Controller,{control:g,name:"vendingZone",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:u,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_REGISTERED_MOB_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:E({minLength:{value:10,message:u("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:u("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:u("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==b||null===(i=b.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:f}),name:"fromDate",control:g})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_TO_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:f}),name:"toDate",control:g})),l.createElement(t.SearchField,null),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:u("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{_({applicationNumber:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),m(null),O()}},u("ES_COMMON_CLEAR_ALL")))),!d&&null!=c&&c.display?l.createElement(t.Card,{style:{marginTop:20}},u(c.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):d||""===c?""!==c||d&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:u,data:c,totalRecords:v,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===u("SV_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){h("limit",Number(e.target.value)),S(s)()},currentPage:y("offset")/y("limit"),onNextPage:function(){h("offset",y("offset")+y("limit")),S(s)()},onPrevPage:O,pageSizeLimit:y("limit"),onSort:w,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},k=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[c,v]=n.useState(null),m={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:p,isSuccess:f,data:{SVDetail:E,count:g}={}}=Digit.Hooks.sv.useSvSearchApplication({tenantId:r,filters:u},m);return l.createElement(l.Fragment,null,l.createElement(B,{t:a,isLoading:p,tenantId:r,setShowToast:v,onSubmit:function(e){var t=new Date(null==e?void 0:e.fromDate);null==t||t.setSeconds((null==t?void 0:t.getSeconds())-19800);var n=new Date(null==e?void 0:e.toDate);null==n||n.setSeconds((null==n?void 0:n.getSeconds())+86399-19800);const l=d({},e,e.toDate?{toDate:null==n?void 0:n.getTime()}:{},e.fromDate?{fromDate:null==t?void 0:t.getTime()}:{});let i=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>d({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.entries(i).length>0)||i.applicationNumber||i.fromDate||i.mobileNumber||i.vendingType||i.toDate||i.vendingZone?Object.entries(i).length>0&&i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):v({warning:!0,label:"ERR_SV_FILL_VALID_FIELDS"})},data:f&&!p?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:g}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:a(c.label),isDleteBtn:!0,onClose:()=>{v(null)}}))},F=["path","url"],V=()=>{var e,n,a,r;console.log("coming here");const s=o.useRouteMatch(),{path:c}=s,v=(u(s,F),i.useTranslation(),o.useLocation(),{searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["street-vending"],status:null,vendingType:null,vendingZone:null}}),m=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("SVEmpCreate"),p=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("SVApplicationDetails");return l.createElement("span",{className:"sv-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,{style:{marginTop:"15px"}},"Back"),l.createElement(t.PrivateRoute,{path:c+"/apply",component:m}),l.createElement(t.PrivateRoute,{path:c+"/inbox",component:()=>l.createElement(M,{useNewInboxAPI:!0,parentRoute:c,businessService:"sv",filterComponent:"SV_INBOX_FILTER",initialStates:v,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:c+"/application-details/:id",component:()=>l.createElement(p,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/applicationsearch/application-details/:id",component:()=>l.createElement(p,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/my-applications",component:e=>l.createElement(k,d({},e,{parentRoute:c}))}))))},U=e=>l.createElement("span",{className:"cell-text"},e),H=e=>l.createElement("span",{className:"sla-cell"},e),W=e=>{var n;let{status:o,searchParams:a,onAssignmentChange:r,statusMap:u}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>r(d({},e,{state:o.state}),o),checked:null==a?void 0:a.applicationStatus.some(e=>e.uuid===o.uuid),label:o.name+" ("+((null==u||null===(n=u.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-")+")"})},j=e=>{var o,a,r,u,s;let{onAssignmentChange:c,searchParams:v,businessServices:m,statusMap:p}=e;const{t:f}=i.useTranslation(),[E,g]=n.useState(!1),{data:S,isLoading:h}=Digit.Hooks.useApplicationStatusGeneral({businessServices:m},{}),{userRoleStates:y}=S||{},_=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_SV_COMMON_STATUS_"+(e.state||"CREATED"));return h?l.createElement(t.Loader,null):null!=y&&y.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_INBOX_STATUS")),null==y||null===(o=y.filter(e=>!e.isTerminateState))||void 0===o||null===(a=o.slice(0,4))||void 0===a?void 0:a.map((e,t)=>l.createElement(W,{businessServices:m,key:t,onAssignmentChange:c,status:d({name:_(e,f),code:e.applicationStatus},e),searchParams:v,statusMap:p})),(null==y||null===(r=y.filter(e=>!e.isTerminateState))||void 0===r?void 0:r.slice(4).length)>0?l.createElement(l.Fragment,null,E&&(null==y||null===(u=y.filter(e=>!e.isTerminateState))||void 0===u||null===(s=u.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement(W,{businessServices:m,key:e.uuid,onAssignmentChange:c,status:d({name:_(e,f),code:e.applicationStatus},e),searchParams:v,statusMap:p}))),l.createElement("div",{className:"filter-button",onClick:()=>g(!E)}," ",f(E?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function K(e,t){return e(t={exports:{}},t.exports),t.exports}var G=K(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",d="[object Date]",u="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",S="[object Symbol]",h="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",b="[object Float32Array]",D="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",T="[object Uint8Array]",I="[object Uint16Array]",w="[object Uint32Array]",O=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(L.source),B=RegExp(P.source),k=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,V=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,K=RegExp(j.source),G=/^\s+/,Y=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Z=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,de=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",me="["+se+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",De="(?:"+_e+"|"+Ee+")",Ae="(?:"+me+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[Se,he,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",Ne="(?:"+["[\\u2700-\\u27bf]",he,ye].join("|")+")"+Ce,Te="(?:"+[Se+me+"?",me,he,ye,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),we=RegExp(me,"g"),Oe=RegExp(ge+"(?="+ge+")|"+Te+Ce,"g"),xe=RegExp([_e+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,_e,"$"].join("|")+")",De+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,_e+be,"$"].join("|")+")",_e+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?: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,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["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"],Me=-1,Be={};Be[b]=Be[D]=Be[A]=Be[C]=Be[N]=Be[T]=Be["[object Uint8ClampedArray]"]=Be[I]=Be[w]=!0,Be[o]=Be[a]=Be[y]=Be[r]=Be[_]=Be[d]=Be[u]=Be[s]=Be[v]=Be[m]=Be[p]=Be[f]=Be[E]=Be[g]=Be[h]=!1;var ke={};ke[o]=ke[a]=ke[y]=ke[_]=ke[r]=ke[d]=ke[b]=ke[D]=ke[A]=ke[C]=ke[N]=ke[v]=ke[m]=ke[p]=ke[f]=ke[E]=ke[g]=ke[S]=ke[T]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[w]=!0,ke[u]=ke[s]=ke[h]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Ue=parseInt,He="object"==typeof z&&z&&z.Object===Object&&z,We="object"==typeof self&&self&&self.Object===Object&&self,je=He||We||Function("return this")(),ze=t&&!t.nodeType&&t,Ke=ze&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===ze,Ye=Ge&&He.process,qe=function(){try{return Ke&&Ke.require&&Ke.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),Ze=qe&&qe.isArrayBuffer,$e=qe&&qe.isDate,Xe=qe&&qe.isMap,Je=qe&&qe.isRegExp,Qe=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function dt(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function ut(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=_t("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function St(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function _t(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 Dt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,zt(e)+1).replace(G,""):e}function Tt(e){return function(t){return e(t)}}function It(e,t){return ut(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function Ot(e,t){for(var n=-1,l=e.length;++n<l&&gt(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length;n--&&gt(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=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"}),Pt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Fe[e]}function Bt(e){return Re.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function Vt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Ut(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 Wt(e){return Bt(e)?function(e){for(var t=Oe.lastIndex=0;Oe.test(e);)++t;return t}(e):pt(e)}function jt(e){return Bt(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Kt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var z,Y=(t=null==t?je:Gt.defaults(je.Object(),t,Gt.pick(je,Pe))).Array,se=t.Date,ce=t.Error,ve=t.Function,me=t.Math,pe=t.Object,fe=t.RegExp,Ee=t.String,ge=t.TypeError,Se=Y.prototype,he=pe.prototype,ye=t["__core-js_shared__"],_e=ve.prototype.toString,be=he.hasOwnProperty,De=0,Ae=(z=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Ce=he.toString,Ne=_e.call(pe),Te=je._,Oe=fe("^"+_e.call(be).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ge?t.Buffer:void 0,Fe=t.Symbol,He=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,ze=Ft(pe.getPrototypeOf,pe),Ke=pe.create,Ye=he.propertyIsEnumerable,qe=Se.splice,pt=Fe?Fe.isConcatSpreadable:void 0,bt=Fe?Fe.iterator:void 0,Yt=Fe?Fe.toStringTag:void 0,qt=function(){try{var e=Ji(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Zt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,$t=se&&se.now!==je.Date.now&&se.now,Xt=t.setTimeout!==je.setTimeout&&t.setTimeout,Jt=me.ceil,Qt=me.floor,en=pe.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=Se.join,on=Ft(pe.keys,pe),an=me.max,rn=me.min,dn=se.now,un=t.parseInt,sn=me.random,cn=Se.reverse,vn=Ji(t,"DataView"),mn=Ji(t,"Map"),pn=Ji(t,"Promise"),fn=Ji(t,"Set"),En=Ji(t,"WeakMap"),gn=Ji(pe,"create"),Sn=En&&new En,hn={},yn=Io(vn),_n=Io(mn),bn=Io(pn),Dn=Io(fn),An=Io(En),Cn=Fe?Fe.prototype:void 0,Nn=Cn?Cn.valueOf:void 0,Tn=Cn?Cn.toString:void 0;function In(e){if(Ka(e)&&!Pa(e)&&!(e instanceof Rn)){if(e instanceof xn)return e;if(be.call(e,"__wrapped__"))return wo(e)}return new xn(e)}var wn=function(){function e(){}return function(t){if(!za(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function xn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(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 Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Fn(e,t){var n=Pa(e),l=!n&&La(e),i=!n&&!l&&Fa(e),o=!n&&!l&&!i&&Qa(e),a=n||l||i||o,r=a?Ct(e.length,Ee):[],d=r.length;for(var u in e)!t&&!be.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||oo(u,d))||r.push(u);return r}function Vn(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function Un(e,t){return Do(Ei(e),Zn(t,0,e.length))}function Hn(e){return Do(Ei(e))}function Wn(e,t,n){(void 0!==n&&!Oa(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)&&Oa(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Oa(e[n][0],t))return n;return-1}function Kn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&gi(t,_r(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,i=Y(l),o=null==e;++n<l;)i[n]=o?void 0:Er(e,t[n]);return i}function Zn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function $n(e,t,n,l,i,a){var u,h=1&t,O=2&t,x=4&t;if(n&&(u=i?n(e,l,i,a):n(e)),void 0!==u)return u;if(!za(e))return e;var R=Pa(e);if(R){if(u=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),!h)return Ei(e,u)}else{var L=to(e),P=L==s||L==c;if(Fa(e))return si(e,h);if(L==p||L==o||P&&!i){if(u=O||P?{}:lo(e),!h)return O?function(e,t){return gi(e,eo(e),t)}(e,function(e,t){return e&&gi(t,br(t),e)}(u,e)):function(e,t){return gi(e,Qi(e),t)}(e,Gn(u,e))}else{if(!ke[L])return i?e:{};u=function(e,t,n){var l=e.constructor;switch(t){case y:return ci(e);case r:case d:return new l(+e);case _:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case D:case A:case C:case N:case T:case"[object Uint8ClampedArray]":case I:case w:return vi(e,n);case v:return new l;case m: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 S:return Nn?pe(Nn.call(e)):{}}}(e,L,h)}}a||(a=new kn);var M=a.get(e);if(M)return M;a.set(e,u),$a(e)?e.forEach(function(l){u.add($n(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){u.set(i,$n(l,t,n,i,e,a))});var B=R?void 0:(x?O?Ki:zi:O?br:_r)(e);return lt(B||e,function(l,i){B&&(l=e[i=l]),jn(u,i,$n(l,t,n,i,e,a))}),u}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=pe(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new ge(n);return ho(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,d=[],u=t.length;if(!r)return d;n&&(t=ut(t,Tt(n))),l?(o=dt,a=!1):t.length>=200&&(o=wt,a=!1,t=new Bn(t));e:for(;++i<r;){var s=e[i],c=null==n?s:n(s);if(s=l||0!==s?s:0,a&&c==c){for(var v=u;v--;)if(t[v]===c)continue e;d.push(s)}else o(t,c,l)||d.push(s)}return d}In.templateSettings={escape:k,evaluate:F,interpolate:V,variable:"",imports:{_:In}},(In.prototype=On.prototype).constructor=In,(xn.prototype=wn(On.prototype)).constructor=xn,(Rn.prototype=wn(On.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&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},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(mn||Pn),string:new Ln}},Mn.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return $i(this,e).get(e)},Mn.prototype.has=function(e){return $i(this,e).has(e)},Mn.prototype.set=function(e,t){var n=$i(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new Pn,this.size=0},kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kn.prototype.get=function(e){return this.__data__.get(e)},kn.prototype.has=function(e){return this.__data__.has(e)},kn.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 Mn(l)}return n.set(e,t),this.size=n.size,this};var el=yi(dl),tl=yi(ul,!0);function nl(e,t){var n=!0;return el(e,function(e,l,i){return n=!!t(e,l,i)}),n}function ll(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):n(a,r)))var r=a,d=o}return d}function il(e,t){var n=[];return el(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function ol(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=io),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?ol(r,t-1,n,l,i):st(i,r):l||(i[i.length]=r)}return i}var al=_i(),rl=_i(!0);function dl(e,t){return e&&al(e,t,_r)}function ul(e,t){return e&&rl(e,t,_r)}function sl(e,t){return at(t,function(t){return Ha(e[t])})}function cl(e,t){for(var n=0,l=(t=ai(t,e)).length;null!=e&&n<l;)e=e[To(t[n++])];return n&&n==l?e:void 0}function vl(e,t,n){var l=t(e);return Pa(e)?l:st(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Yt&&Yt in pe(e)?function(e){var t=be.call(e,Yt),n=e[Yt];try{e[Yt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Yt]=n:delete e[Yt]),i}(e):function(e){return Ce.call(e)}(e)}function pl(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in pe(e)}function gl(e,t,n){for(var l=n?dt:rt,i=e[0].length,o=e.length,a=o,r=Y(o),d=Infinity,u=[];a--;){var s=e[a];a&&t&&(s=ut(s,Tt(t))),d=rn(s.length,d),r[a]=!n&&(t||i>=120&&s.length>=120)?new Bn(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&u.length<d;){var m=s[c],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?wt(v,p):l(u,p,n))){for(a=o;--a;){var f=r[a];if(!(f?wt(f,p):l(e[a],p,n)))continue e}v&&v.push(p),u.push(m)}}return u}function Sl(e,t,n){var l=null==(e=fo(e,t=ai(t,e)))?e:e[To(Uo(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Ka(e)&&ml(e)==o}function yl(e,t,n,l,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var c=Pa(e),h=Pa(t),b=c?a:to(e),D=h?a:to(t),A=(b=b==o?p:b)==p,C=(D=D==o?p:D)==p,N=b==D;if(N&&Fa(e)){if(!Fa(t))return!1;c=!0,A=!1}if(N&&!A)return s||(s=new kn),c||Qa(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,o,a){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case r:case d:case m:return Oa(+e,+t);case u:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v:var s=kt;case E:if(s||(s=Ut),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=Wi(s(e),s(t),l,i,o,a);return a.delete(e),p;case S:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,b,n,l,i,s);if(!(1&n)){var T=A&&be.call(e,"__wrapped__"),I=C&&be.call(t,"__wrapped__");if(T||I){var w=T?e.value():e,O=I?t.value():t;return s||(s=new kn),i(w,O,n,l,s)}}return!!N&&(s||(s=new kn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),d=r.length;if(d!=zi(t).length&&!a)return!1;for(var u=d;u--;){var s=r[u];if(!(a?s in t:be.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++u<d;){var f=e[s=r[u]],E=t[s];if(l)var g=a?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===g?f===E||i(f,E,n,l,o):g)){m=!1;break}p||(p="constructor"==s)}if(m&&!p){var S=e.constructor,h=t.constructor;S==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof S&&S instanceof S&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,s))}(e,t,n,l,yl,i))}function _l(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=pe(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var d=(r=n[i])[0],u=e[d],s=r[1];if(a&&r[2]){if(void 0===u&&!(d in e))return!1}else{var c=new kn;if(l)var v=l(u,s,d,e,t,c);if(!(void 0===v?yl(s,u,3,l,c):v))return!1}}return!0}function bl(e){return!(!za(e)||(t=e,Ae&&Ae in t))&&(Ha(e)?Oe:ie).test(Io(e));var t}function Dl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Il(e[0],e[1]):Tl(e):nd(e)}function Al(e){if(!co(e))return on(e);var t=[];for(var n in pe(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Nl(e,t){var n=-1,l=Ba(e)?Y(e.length):[];return el(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Tl(e){var t=Xi(e);return 1==t.length&&t[0][2]?mo(t[0][0],t[0][1]):function(n){return n===e||_l(n,e,t)}}function Il(e,t){return ro(e)&&vo(t)?mo(To(e),t):function(n){var l=Er(n,e);return void 0===l&&l===t?gr(n,e):yl(t,l,3)}}function wl(e,t,n,l,i){e!==t&&al(t,function(o,a){if(i||(i=new kn),za(o))!function(e,t,n,l,i,o,a){var r=go(e,n),d=go(t,n),u=a.get(d);if(u)Wn(e,n,u);else{var s=o?o(r,d,n+"",e,t,a):void 0,c=void 0===s;if(c){var v=Pa(d),m=!v&&Fa(d),p=!v&&!m&&Qa(d);s=d,v||m||p?Pa(r)?s=r:ka(r)?s=Ei(r):m?(c=!1,s=si(d,!0)):p?(c=!1,s=vi(d,!0)):s=[]:qa(d)||La(d)?(s=r,La(r)?s=rr(r):za(r)&&!Ha(r)||(s=lo(d))):c=!1}c&&(a.set(d,s),i(s,d,l,o,a),a.delete(d)),Wn(e,n,s)}}(e,t,a,n,wl,l,i);else{var r=l?l(go(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Wn(e,a,r)}},br)}function Ol(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function xl(e,t,n){t=t.length?ut(t,function(e){return Pa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=ut(t,Tt(Zi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var d=mi(i[l],o[l]);if(d)return l>=r?d:d*("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,i){return{criteria:ut(t,function(t){return t(e)}),index:++l,value:e}}))}function Rl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(o,ai(a,e),r)}return o}function Ll(e,t,n,l){var i=l?St:gt,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),n&&(r=ut(e,Tt(n)));++o<a;)for(var d=0,u=t[o],s=n?n(u):u;(d=i(r,s,d,l))>-1;)r!==e&&qe.call(r,d,1),qe.call(e,d,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;oo(i)?qe.call(e,i,1):Jl(e,i)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function Bl(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 kl(e,t){return yo(po(e,t,Yr),e+"")}function Fl(e){return Vn(Or(e))}function Vl(e,t){var n=Or(e);return Do(n,Zn(t,0,n.length))}function Ul(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=ai(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var d=To(t[i]),u=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(i!=a){var s=r[d];void 0===(u=l?l(s,d,r):void 0)&&(u=za(s)?s:oo(t[i+1])?[]:{})}jn(r,d,u),r=r[d]}return e}var Hl=Sn?function(e,t){return Sn.set(e,t),e}:Yr,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return Do(Or(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Y(i);++l<i;)o[l]=e[l+t];return o}function Kl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,d=Ja(t),u=void 0===t;i<o;){var s=Qt((i+o)/2),c=n(e[s]),v=void 0!==c,m=null===c,p=c==c,f=Ja(c);if(a)var E=l||p;else E=u?p&&(l||v):r?p&&v&&(l||!m):d?p&&v&&!m&&(l||!f):!m&&!f&&(l?c<=t:c<t);E?i=s+1:o=s}return rn(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Oa(r,d)){var d=r;o[i++]=0===a?0:a}}return o}function Zl(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function $l(e){if("string"==typeof e)return e;if(Pa(e))return ut(e,$l)+"";if(Ja(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],d=r;if(n)a=!1,i=dt;else if(o>=200){var u=t?null:Bi(e);if(u)return Ut(u);a=!1,i=wt,d=new Bn}else d=t?[]:r;e:for(;++l<o;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,a&&c==c){for(var v=d.length;v--;)if(d[v]===c)continue e;t&&d.push(c),r.push(s)}else i(d,c,n)||(d!==r&&d.push(c),r.push(s))}return r}function Jl(e,t){return null==(e=fo(e,t=ai(t,e)))||delete e[To(Uo(t))]}function Ql(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function ei(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ti(e,t){var n=e;return n instanceof Rn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ni(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var i=-1,o=Y(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Qn(o[i]||a,e[r],t,n));return Xl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function ii(e){return ka(e)?e:[]}function oi(e){return"function"==typeof e?e:Yr}function ai(e,t){return Pa(e)?e:ro(e,t)?[e]:No(dr(e))}var ri=kl;function di(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Zt||function(e){return je.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=We?We(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function vi(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,d=t==t,u=Ja(t);if(!r&&!u&&!o&&e>t||o&&a&&d&&!r&&!u||l&&a&&d||!n&&d||!i)return 1;if(!l&&!o&&!u&&e<t||u&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!d)return-1}return 0}function pi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,d=t.length,u=an(o-a,0),s=Y(d+u),c=!l;++r<d;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[n[i]]=e[i]);for(;u--;)s[r++]=e[i++];return s}function fi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,d=-1,u=t.length,s=an(o-r,0),c=Y(s+u),v=!l;++i<s;)c[i]=e[i];for(var m=i;++d<u;)c[m+d]=t[d];for(;++a<r;)(v||i<o)&&(c[m+n[a]]=e[i++]);return c}function Ei(e,t){var n=-1,l=e.length;for(t||(t=Y(l));++n<l;)t[n]=e[n];return t}function gi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=l?l(n[r],e[r],r,n,e):void 0;void 0===d&&(d=e[r]),i?Yn(n,r,d):jn(n,r,d)}return n}function Si(e,t){return function(n,l){var i=Pa(n)?nt:Kn,o=t?t():{};return i(n,e,Zi(l,2),o)}}function hi(e){return kl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=pe(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function yi(e,t){return function(n,l){if(null==n)return n;if(!Ba(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=pe(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function _i(e){return function(t,n,l){for(var i=-1,o=pe(t),a=l(t),r=a.length;r--;){var d=a[e?r:++i];if(!1===n(o[d],d,o))break}return t}}function bi(e){return function(t){var n=Bt(t=dr(t))?jt(t):void 0,l=n?n[0]:t.charAt(0),i=n?di(n,1).join(""):t.slice(1);return l[e]()+i}}function Di(e){return function(t){return ct(Hr(Lr(t).replace(Ie,"")),e,"")}}function Ai(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=wn(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=pe(t);if(!Ba(t)){var o=Zi(n,3);t=_r(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Ni(e){return ji(function(t){var l=t.length,i=l,o=xn.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new ge(n);if(o&&!r&&"wrapper"==Yi(a))var r=new xn([],!0)}for(i=r?i:l;++i<l;){var d=Yi(a=t[i]),u="wrapper"==d?Gi(a):void 0;r=u&&uo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?r[Yi(u[0])].apply(r,u[3]):1==a.length&&uo(a)?r[d]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Pa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ti(e,t,n,l,i,o,a,r,d,u){var s=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:Ai(e);return function E(){for(var g=arguments.length,S=Y(g),h=g;h--;)S[h]=arguments[h];if(m)var y=qi(E),_=Rt(S,y);if(l&&(S=pi(S,l,i,m)),o&&(S=fi(S,o,a,m)),g-=_,m&&g<u){var b=Vt(S,y);return Pi(e,t,Ti,E.placeholder,n,S,b,r,d,u-g)}var D=c?n:this,A=v?D[e]:e;return g=S.length,r?S=Eo(S,r):p&&g>1&&S.reverse(),s&&d<g&&(S.length=d),this&&this!==je&&this instanceof E&&(A=f||Ai(A)),A.apply(D,S)}}function Ii(e,t){return function(n,l){return function(e,t,n,l){return dl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function wi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=$l(n),l=$l(l)):(n=Zl(n),l=Zl(l)),i=e(n,l)}return i}}function Oi(e){return ji(function(t){return t=ut(t,Tt(Zi())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function xi(e,t){var n=(t=void 0===t?" ":$l(t)).length;if(n<2)return n?Bl(t,e):t;var l=Bl(t,Jt(e/Wt(t)));return Bt(t)?di(jt(l),0,e).join(""):l.slice(0,e)}function Ri(e){return function(t,n,l){return l&&"number"!=typeof l&&ao(t,n,l)&&(n=l=void 0),t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n,l){for(var i=-1,o=an(Jt((t-e)/(n||1)),0),a=Y(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:lr(l),e)}}function Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ar(t),n=ar(n)),e(t,n)}}function Pi(e,t,n,l,i,o,a,r,d,u){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,d,u],v=n.apply(void 0,c);return uo(e)&&So(v,c),v.placeholder=l,_o(v,e,t)}function Mi(e){var t=me[e];return function(e,n){if(e=ar(e),(n=null==n?0:rn(ir(n),292))&&nn(e)){var l=(dr(e)+"e").split("e");return+((l=(dr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Bi=fn&&1/Ut(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Jr;function ki(e){return function(t){var n=to(t);return n==v?kt(t):n==E?Ht(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,d,u){var s=2&t;if(!s&&"function"!=typeof e)throw new ge(n);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),d=void 0===d?d:an(ir(d),0),u=void 0===u?u:ir(u),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=s?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,d,u];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?pi(r,a,t[4]):a,e[4]=r?Vt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fi(r,a,t[6]):a,e[6]=r?Vt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:rn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(u=f[9]=void 0===f[9]?s?0:e.length:an(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=Y(o),r=o,d=qi(i);r--;)a[r]=arguments[r];var u=o<3&&a[0]!==d&&a[o-1]!==d?[]:Vt(a,d);if((o-=u.length)<n)return Pi(e,t,Ti,i.placeholder,void 0,a,u,void 0,void 0,n-o);var s=this&&this!==je&&this instanceof i?l:e;return tt(s,this,a)}}(e,t,u):32!=t&&33!=t||a.length?Ti.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,d=-1,u=l.length,s=Y(u+r),c=this&&this!==je&&this instanceof t?o:e;++d<u;)s[d]=l[d];for(;r--;)s[d++]=arguments[++a];return tt(c,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==je&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return _o((p?Hl:So)(E,f),e,t)}function Vi(e,t,n,l){return void 0===e||Oa(e,he[n])&&!be.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),wl(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return qa(e)?void 0:e}function Wi(e,t,n,l,i,o){var a=1&n,r=e.length,d=t.length;if(r!=d&&!(a&&d>r))return!1;var u=o.get(e),s=o.get(t);if(u&&s)return u==t&&s==e;var c=-1,v=!0,m=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,o):l(p,f,c,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!wt(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return yo(po(e,void 0,Mo),e+"")}function zi(e){return vl(e,_r,Qi)}function Ki(e){return vl(e,br,eo)}var Gi=Sn?function(e){return Sn.get(e)}:Jr;function Yi(e){for(var t=e.name+"",n=hn[t],l=be.call(hn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(be.call(In,"placeholder")?In:e).placeholder}function Zi(){var e=In.iteratee||qr;return e=e===qr?Dl:e,arguments.length?e(arguments[0],arguments[1]):e}function $i(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 Xi(e){for(var t=_r(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,vo(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=pe(e),at(en(e),function(t){return Ye.call(e,t)}))}:od,eo=en?function(e){for(var t=[];e;)st(t,Qi(e)),e=ze(e);return t}:od,to=ml;function no(e,t,n){for(var l=-1,i=(t=ai(t,e)).length,o=!1;++l<i;){var a=To(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&oo(a,i)&&(Pa(e)||La(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:wn(ze(e))}function io(e){return Pa(e)||La(e)||!!(pt&&e&&e[pt])}function oo(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 ao(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Ba(n)&&oo(t,n.length):"string"==l&&t in n)&&Oa(n[t],e)}function ro(e,t){if(Pa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||H.test(e)||!U.test(e)||null!=t&&e in pe(t)}function uo(e){var t=Yi(e),n=In[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(vn&&to(new vn(new ArrayBuffer(1)))!=_||mn&&to(new mn)!=v||pn&&"[object Promise]"!=to(pn.resolve())||fn&&to(new fn)!=E||En&&to(new En)!=h)&&(to=function(e){var t=ml(e),n=t==p?e.constructor:void 0,l=n?Io(n):"";if(l)switch(l){case yn:return _;case _n:return v;case bn:return"[object Promise]";case Dn:return E;case An:return h}return t});var so=ye?Ha:ad;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function vo(e){return e==e&&!za(e)}function mo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in pe(n))}}function po(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=an(l.length-t,0),a=Y(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=Y(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function fo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function Eo(e,t){for(var n=e.length,l=rn(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function go(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var So=bo(Hl),ho=Xt||function(e,t){return je.setTimeout(e,t)},yo=bo(Wl);function _o(e,t,n){var l=t+"";return yo(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(Z);return t?t[1].split($):[]}(l),n)))}function bo(e){var t=0,n=0;return function(){var l=dn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Do(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Ml(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao,Co,No=(Ao=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=Ao.cache,Ao);function To(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return _e.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wo(e){if(e instanceof Rn)return e.clone();var t=new xn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Oo=kl(function(e,t){return ka(e)?Qn(e,ol(t,1,ka,!0)):[]}),xo=kl(function(e,t){var n=Uo(t);return ka(n)&&(n=void 0),ka(e)?Qn(e,ol(t,1,ka,!0),Zi(n,2)):[]}),Ro=kl(function(e,t){var n=Uo(t);return ka(n)&&(n=void 0),ka(e)?Qn(e,ol(t,1,ka,!0),void 0,n):[]});function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),Et(e,Zi(t,3),i)}function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ir(n),i=n<0?an(l+i,0):rn(i,l-1)),Et(e,Zi(t,3),i,!0)}function Mo(e){return null!=e&&e.length?ol(e,1):[]}function Bo(e){return e&&e.length?e[0]:void 0}var ko=kl(function(e){var t=ut(e,ii);return t.length&&t[0]===e[0]?gl(t):[]}),Fo=kl(function(e){var t=Uo(e),n=ut(e,ii);return t===Uo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gl(n,Zi(t,2)):[]}),Vo=kl(function(e){var t=Uo(e),n=ut(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gl(n,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=kl(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Pl(e,ut(t,function(e){return oo(e,n)?+e:e}).sort(mi)),l});function zo(e){return null==e?e:cn.call(e)}var Ko=kl(function(e){return Xl(ol(e,1,ka,!0))}),Go=kl(function(e){var t=Uo(e);return ka(t)&&(t=void 0),Xl(ol(e,1,ka,!0),Zi(t,2))}),Yo=kl(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Xl(ol(e,1,ka,!0),void 0,t)});function qo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(ka(e))return t=an(e.length,t),!0}),Ct(t,function(t){return ut(e,_t(t))})}function Zo(e,t){if(!e||!e.length)return[];var n=qo(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var $o=kl(function(e,t){return ka(e)?Qn(e,t):[]}),Xo=kl(function(e){return ni(at(e,ka))}),Jo=kl(function(e){var t=Uo(e);return ka(t)&&(t=void 0),ni(at(e,ka),Zi(t,2))}),Qo=kl(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ni(at(e,ka),void 0,t)}),ea=kl(qo),ta=kl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Zo(e,n)});function na(e){var t=In(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var ia=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new xn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),oa=Si(function(e,t,n){be.call(e,n)?++e[n]:Yn(e,n,1)}),aa=Ci(Lo),ra=Ci(Po);function da(e,t){return(Pa(e)?lt:el)(e,Zi(t,3))}function ua(e,t){return(Pa(e)?it:tl)(e,Zi(t,3))}var sa=Si(function(e,t,n){be.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ca=kl(function(e,t,n){var l=-1,i="function"==typeof t,o=Ba(e)?Y(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):Sl(e,t,n)}),o}),va=Si(function(e,t,n){Yn(e,n,t)});function ma(e,t){return(Pa(e)?ut:Nl)(e,Zi(t,3))}var pa=Si(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fa=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),xl(e,ol(t,1),[])}),Ea=$t||function(){return je.Date.now()};function ga(e,t,n){return t=n?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Sa(e,t){var l;if("function"!=typeof t)throw new ge(n);return e=ir(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ha=kl(function(e,t,n){var l=1;if(n.length){var i=Vt(n,qi(ha));l|=32}return Fi(e,l,t,n,i)}),ya=kl(function(e,t,n){var l=3;if(n.length){var i=Vt(n,qi(ya));l|=32}return Fi(t,l,e,n,i)});function _a(e,t,l){var i,o,a,r,d,u,s=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new ge(n);function p(t){var n=i,l=o;return i=o=void 0,s=t,r=e.apply(l,n)}function f(e){return s=e,d=ho(g,t),c?p(e):r}function E(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-s>=a}function g(){var e=Ea();if(E(e))return S(e);d=ho(g,function(e){var n=t-(e-u);return v?rn(n,a-(e-s)):n}(e))}function S(e){return d=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=Ea(),n=E(e);if(i=arguments,o=this,u=e,n){if(void 0===d)return f(u);if(v)return ui(d),d=ho(g,t),p(u)}return void 0===d&&(d=ho(g,t)),r}return t=ar(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?an(ar(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==d&&ui(d),s=0,i=u=o=d=void 0},h.flush=function(){return void 0===d?r:S(Ea())},h}var ba=kl(function(e,t){return Jn(e,1,t)}),Da=kl(function(e,t,n){return Jn(e,ar(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(Aa.Cache||Mn),l}function Ca(e){if("function"!=typeof e)throw new ge(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)}}Aa.Cache=Mn;var Na=ri(function(e,t){var n=(t=1==t.length&&Pa(t[0])?ut(t[0],Tt(Zi())):ut(ol(t,1),Tt(Zi()))).length;return kl(function(l){for(var i=-1,o=rn(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ta=kl(function(e,t){return Fi(e,32,void 0,t,Vt(t,qi(Ta)))}),Ia=kl(function(e,t){return Fi(e,64,void 0,t,Vt(t,qi(Ia)))}),wa=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Oa(e,t){return e===t||e!=e&&t!=t}var xa=Li(pl),Ra=Li(function(e,t){return e>=t}),La=hl(function(){return arguments}())?hl:function(e){return Ka(e)&&be.call(e,"callee")&&!Ye.call(e,"callee")},Pa=Y.isArray,Ma=Ze?Tt(Ze):function(e){return Ka(e)&&ml(e)==y};function Ba(e){return null!=e&&ja(e.length)&&!Ha(e)}function ka(e){return Ka(e)&&Ba(e)}var Fa=tn||ad,Va=$e?Tt($e):function(e){return Ka(e)&&ml(e)==d};function Ua(e){if(!Ka(e))return!1;var t=ml(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function Ha(e){if(!za(e))return!1;var t=ml(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==ir(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 Ka(e){return null!=e&&"object"==typeof e}var Ga=Xe?Tt(Xe):function(e){return Ka(e)&&to(e)==v};function Ya(e){return"number"==typeof e||Ka(e)&&ml(e)==m}function qa(e){if(!Ka(e)||ml(e)!=p)return!1;var t=ze(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_e.call(n)==Ne}var Za=Je?Tt(Je):function(e){return Ka(e)&&ml(e)==f},$a=Qe?Tt(Qe):function(e){return Ka(e)&&to(e)==E};function Xa(e){return"string"==typeof e||!Pa(e)&&Ka(e)&&ml(e)==g}function Ja(e){return"symbol"==typeof e||Ka(e)&&ml(e)==S}var Qa=et?Tt(et):function(e){return Ka(e)&&ja(e.length)&&!!Be[ml(e)]},er=Li(Cl),tr=Li(function(e,t){return e<=t});function nr(e){if(!e)return[];if(Ba(e))return Xa(e)?jt(e):Ei(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=to(e);return(t==v?kt:t==E?Ut:Or)(e)}function lr(e){return e?(e=ar(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ir(e){var t=lr(e),n=t%1;return t==t?n?t-n:t:0}function or(e){return e?Zn(ir(e),0,4294967295):0}function ar(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=Nt(e);var n=le.test(e);return n||oe.test(e)?Ue(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function rr(e){return gi(e,br(e))}function dr(e){return null==e?"":$l(e)}var ur=hi(function(e,t){if(co(t)||Ba(t))gi(t,_r(t),e);else for(var n in t)be.call(t,n)&&jn(e,n,t[n])}),sr=hi(function(e,t){gi(t,br(t),e)}),cr=hi(function(e,t,n,l){gi(t,br(t),e,l)}),vr=hi(function(e,t,n,l){gi(t,_r(t),e,l)}),mr=ji(qn),pr=kl(function(e,t){e=pe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=br(o),r=-1,d=a.length;++r<d;){var u=a[r],s=e[u];(void 0===s||Oa(s,he[u])&&!be.call(e,u))&&(e[u]=o[u])}return e}),fr=kl(function(e){return e.push(void 0,Ui),tt(Ar,void 0,e)});function Er(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function gr(e,t){return null!=e&&no(e,t,El)}var Sr=Ii(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),hr=Ii(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]},Zi),yr=kl(Sl);function _r(e){return Ba(e)?Fn(e):Al(e)}function br(e){return Ba(e)?Fn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Dr=hi(function(e,t,n){wl(e,t,n)}),Ar=hi(function(e,t,n,l){wl(e,t,n,l)}),Cr=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=ut(t,function(t){return t=ai(t,e),l||(l=t.length>1),t}),gi(e,Ki(e),n),l&&(n=$n(n,7,Hi));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Nr=ji(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return gr(e,n)})}(e,t)});function Tr(e,t){if(null==e)return{};var n=ut(Ki(e),function(e){return[e]});return t=Zi(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Ir=ki(_r),wr=ki(br);function Or(e){return null==e?[]:It(e,_r(e))}var xr=Di(function(e,t,n){return t=t.toLowerCase(),e+(n?Rr(t):t)});function Rr(e){return Ur(dr(e).toLowerCase())}function Lr(e){return(e=dr(e))&&e.replace(re,Lt).replace(we,"")}var Pr=Di(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Mr=Di(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Br=bi("toLowerCase"),kr=Di(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fr=Di(function(e,t,n){return e+(n?" ":"")+Ur(t)}),Vr=Di(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ur=bi("toUpperCase");function Hr(e,t,n){return e=dr(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wr=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new ce(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=To(t),Yn(e,t,ha(e[t],e))}),e});function zr(e){return function(){return e}}var Kr=Ni(),Gr=Ni(!0);function Yr(e){return e}function qr(e){return Dl("function"==typeof e?e:$n(e,1))}var Zr=kl(function(e,t){return function(n){return Sl(n,e,t)}}),$r=kl(function(e,t){return function(n){return Sl(e,n,t)}});function Xr(e,t,n){var l=_r(t),i=sl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,_r(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Ha(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ei(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Qr=Oi(ut),ed=Oi(ot),td=Oi(mt);function nd(e){return ro(e)?_t(To(e)):function(e){return function(t){return cl(t,e)}}(e)}var ld=Ri(),id=Ri(!0);function od(){return[]}function ad(){return!1}var rd,dd=wi(function(e,t){return e+t},0),ud=Mi("ceil"),sd=wi(function(e,t){return e/t},1),cd=Mi("floor"),vd=wi(function(e,t){return e*t},1),md=Mi("round"),pd=wi(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new ge(n);return e=ir(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=ga,In.assign=ur,In.assignIn=sr,In.assignInWith=cr,In.assignWith=vr,In.at=mr,In.before=Sa,In.bind=ha,In.bindAll=jr,In.bindKey=ya,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},In.chain=na,In.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:an(ir(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=Y(Jt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},In.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},In.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 st(Pa(n)?Ei(n):[n],ol(t,1))},In.cond=function(e){var t=null==e?0:e.length,l=Zi();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new ge(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},In.conforms=function(e){return function(e){var t=_r(e);return function(n){return Xn(n,e,t)}}($n(e,1))},In.constant=zr,In.countBy=oa,In.create=function(e,t){var n=wn(e);return null==t?n:Gn(n,t)},In.curry=function e(t,n,l){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},In.curryRight=function e(t,n,l){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},In.debounce=_a,In.defaults=pr,In.defaultsDeep=fr,In.defer=ba,In.delay=Da,In.difference=Oo,In.differenceBy=xo,In.differenceWith=Ro,In.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:ir(t))<0?0:t,l):[]},In.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:ir(t)))<0?0:t):[]},In.dropRightWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3),!0,!0):[]},In.dropWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3),!0):[]},In.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ao(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ir(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ir(l))<0&&(l+=i),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},In.filter=function(e,t){return(Pa(e)?at:il)(e,Zi(t,3))},In.flatMap=function(e,t){return ol(ma(e,t),1)},In.flatMapDeep=function(e,t){return ol(ma(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:ir(n),ol(ma(e,t),n)},In.flatten=Mo,In.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},In.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:ir(t)):[]},In.flip=function(e){return Fi(e,512)},In.flow=Kr,In.flowRight=Gr,In.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},In.functions=function(e){return null==e?[]:sl(e,_r(e))},In.functionsIn=function(e){return null==e?[]:sl(e,br(e))},In.groupBy=sa,In.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},In.intersection=ko,In.intersectionBy=Fo,In.intersectionWith=Vo,In.invert=Sr,In.invertBy=hr,In.invokeMap=ca,In.iteratee=qr,In.keyBy=va,In.keys=_r,In.keysIn=br,In.map=ma,In.mapKeys=function(e,t){var n={};return t=Zi(t,3),dl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},In.mapValues=function(e,t){var n={};return t=Zi(t,3),dl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},In.matches=function(e){return Tl($n(e,1))},In.matchesProperty=function(e,t){return Il(e,$n(t,1))},In.memoize=Aa,In.merge=Dr,In.mergeWith=Ar,In.method=Zr,In.methodOf=$r,In.mixin=Xr,In.negate=Ca,In.nthArg=function(e){return e=ir(e),kl(function(t){return Ol(t,e)})},In.omit=Cr,In.omitBy=function(e,t){return Tr(e,Ca(Zi(t)))},In.once=function(e){return Sa(2,e)},In.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]),xl(e,t,n))},In.over=Qr,In.overArgs=Na,In.overEvery=ed,In.overSome=td,In.partial=Ta,In.partialRight=Ia,In.partition=pa,In.pick=Nr,In.pickBy=Tr,In.property=nd,In.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},In.pull=Ho,In.pullAll=Wo,In.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Zi(n,2)):e},In.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},In.pullAt=jo,In.range=ld,In.rangeRight=id,In.rearg=wa,In.reject=function(e,t){return(Pa(e)?at:il)(e,Ca(Zi(t,3)))},In.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Zi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},In.rest=function(e,t){if("function"!=typeof e)throw new ge(n);return kl(e,t=void 0===t?t:ir(t))},In.reverse=zo,In.sampleSize=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),(Pa(e)?Un:Vl)(e,t)},In.set=function(e,t,n){return null==e?e:Ul(e,t,n)},In.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},In.shuffle=function(e){return(Pa(e)?Hn:jl)(e)},In.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ao(e,t,n)?(t=0,n=l):(t=null==t?0:ir(t),n=void 0===n?l:ir(n)),zl(e,t,n)):[]},In.sortBy=fa,In.sortedUniq=function(e){return e&&e.length?ql(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Zi(t,2)):[]},In.split=function(e,t,n){return n&&"number"!=typeof n&&ao(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=dr(e))&&("string"==typeof t||null!=t&&!Za(t))&&!(t=$l(t))&&Bt(e)?di(jt(e),0,n):e.split(t,n):[]},In.spread=function(e,t){if("function"!=typeof e)throw new ge(n);return t=null==t?0:an(ir(t),0),kl(function(n){var l=n[t],i=di(n,0,t);return l&&st(i,l),tt(e,this,i)})},In.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ir(t))<0?0:t):[]},In.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:ir(t)))<0?0:t,l):[]},In.takeRightWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3)):[]},In.tap=function(e,t){return t(e),e},In.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new ge(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),_a(e,t,{leading:i,maxWait:t,trailing:o})},In.thru=la,In.toArray=nr,In.toPairs=Ir,In.toPairsIn=wr,In.toPath=function(e){return Pa(e)?ut(e,To):Ja(e)?[e]:Ei(No(dr(e)))},In.toPlainObject=rr,In.transform=function(e,t,n){var l=Pa(e),i=l||Fa(e)||Qa(e);if(t=Zi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Ha(o)?wn(ze(e)):{}}return(i?lt:dl)(e,function(e,l,i){return t(n,e,l,i)}),n},In.unary=function(e){return ga(e,1)},In.union=Ko,In.unionBy=Go,In.unionWith=Yo,In.uniq=function(e){return e&&e.length?Xl(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xl(e,Zi(t,2)):[]},In.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},In.unset=function(e,t){return null==e||Jl(e,t)},In.unzip=qo,In.unzipWith=Zo,In.update=function(e,t,n){return null==e?e:Ql(e,t,oi(n))},In.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,oi(n),l)},In.values=Or,In.valuesIn=function(e){return null==e?[]:It(e,br(e))},In.without=$o,In.words=Hr,In.wrap=function(e,t){return Ta(oi(t),e)},In.xor=Xo,In.xorBy=Jo,In.xorWith=Qo,In.zip=ea,In.zipObject=function(e,t){return li(e||[],t||[],jn)},In.zipObjectDeep=function(e,t){return li(e||[],t||[],Ul)},In.zipWith=ta,In.entries=Ir,In.entriesIn=wr,In.extend=sr,In.extendWith=cr,Xr(In,In),In.add=dd,In.attempt=Wr,In.camelCase=xr,In.capitalize=Rr,In.ceil=ud,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ar(n))==n?n:0),void 0!==t&&(t=(t=ar(t))==t?t:0),Zn(ar(e),t,n)},In.clone=function(e){return $n(e,4)},In.cloneDeep=function(e){return $n(e,5)},In.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,_r(t))},In.deburr=Lr,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=sd,In.endsWith=function(e,t,n){e=dr(e),t=$l(t);var l=e.length,i=n=void 0===n?l:Zn(ir(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},In.eq=Oa,In.escape=function(e){return(e=dr(e))&&B.test(e)?e.replace(P,Pt):e},In.escapeRegExp=function(e){return(e=dr(e))&&K.test(e)?e.replace(j,"\\$&"):e},In.every=function(e,t,n){var l=Pa(e)?ot:nl;return n&&ao(e,t,n)&&(t=void 0),l(e,Zi(t,3))},In.find=aa,In.findIndex=Lo,In.findKey=function(e,t){return ft(e,Zi(t,3),dl)},In.findLast=ra,In.findLastIndex=Po,In.findLastKey=function(e,t){return ft(e,Zi(t,3),ul)},In.floor=cd,In.forEach=da,In.forEachRight=ua,In.forIn=function(e,t){return null==e?e:al(e,Zi(t,3),br)},In.forInRight=function(e,t){return null==e?e:rl(e,Zi(t,3),br)},In.forOwn=function(e,t){return e&&dl(e,Zi(t,3))},In.forOwnRight=function(e,t){return e&&ul(e,Zi(t,3))},In.get=Er,In.gt=xa,In.gte=Ra,In.has=function(e,t){return null!=e&&no(e,t,fl)},In.hasIn=gr,In.head=Bo,In.identity=Yr,In.includes=function(e,t,n,l){e=Ba(e)?e:Or(e),n=n&&!l?ir(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Xa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&gt(e,t,n)>-1},In.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),gt(e,t,i)},In.inRange=function(e,t,n){return t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n){return e>=rn(t,n)&&e<an(t,n)}(e=ar(e),t,n)},In.invoke=yr,In.isArguments=La,In.isArray=Pa,In.isArrayBuffer=Ma,In.isArrayLike=Ba,In.isArrayLikeObject=ka,In.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&ml(e)==r},In.isBuffer=Fa,In.isDate=Va,In.isElement=function(e){return Ka(e)&&1===e.nodeType&&!qa(e)},In.isEmpty=function(e){if(null==e)return!0;if(Ba(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Qa(e)||La(e)))return!e.length;var t=to(e);if(t==v||t==E)return!e.size;if(co(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},In.isEqual=function(e,t){return yl(e,t)},In.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?yl(e,t,void 0,n):!!l},In.isError=Ua,In.isFinite=function(e){return"number"==typeof e&&nn(e)},In.isFunction=Ha,In.isInteger=Wa,In.isLength=ja,In.isMap=Ga,In.isMatch=function(e,t){return e===t||_l(e,t,Xi(t))},In.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,_l(e,t,Xi(t),n)},In.isNaN=function(e){return Ya(e)&&e!=+e},In.isNative=function(e){if(so(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},In.isNil=function(e){return null==e},In.isNull=function(e){return null===e},In.isNumber=Ya,In.isObject=za,In.isObjectLike=Ka,In.isPlainObject=qa,In.isRegExp=Za,In.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},In.isSet=$a,In.isString=Xa,In.isSymbol=Ja,In.isTypedArray=Qa,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return Ka(e)&&to(e)==h},In.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==ml(e)},In.join=function(e,t){return null==e?"":ln.call(e,t)},In.kebabCase=Pr,In.last=Uo,In.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=ir(n))<0?an(l+i,0):rn(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,ht,i,!0)},In.lowerCase=Mr,In.lowerFirst=Br,In.lt=er,In.lte=tr,In.max=function(e){return e&&e.length?ll(e,Yr,pl):void 0},In.maxBy=function(e,t){return e&&e.length?ll(e,Zi(t,2),pl):void 0},In.mean=function(e){return yt(e,Yr)},In.meanBy=function(e,t){return yt(e,Zi(t,2))},In.min=function(e){return e&&e.length?ll(e,Yr,Cl):void 0},In.minBy=function(e,t){return e&&e.length?ll(e,Zi(t,2),Cl):void 0},In.stubArray=od,In.stubFalse=ad,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=vd,In.nth=function(e,t){return e&&e.length?Ol(e,ir(t)):void 0},In.noConflict=function(){return je._===this&&(je._=Te),this},In.noop=Jr,In.now=Ea,In.pad=function(e,t,n){e=dr(e);var l=(t=ir(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return xi(Qt(i),n)+e+xi(Jt(i),n)},In.padEnd=function(e,t,n){e=dr(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?e+xi(t-l,n):e},In.padStart=function(e,t,n){e=dr(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?xi(t-l,n)+e:e},In.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(dr(e).replace(G,""),t||0)},In.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ao(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=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return rn(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Ml(e,t)},In.reduce=function(e,t,n){var l=Pa(e)?ct:Dt,i=arguments.length<3;return l(e,Zi(t,4),n,i,el)},In.reduceRight=function(e,t,n){var l=Pa(e)?vt:Dt,i=arguments.length<3;return l(e,Zi(t,4),n,i,tl)},In.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),Bl(dr(e),t)},In.replace=function(){var e=arguments,t=dr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var l=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[To(t[l])];void 0===o&&(l=i,o=n),e=Ha(o)?o.call(e):o}return e},In.round=md,In.runInContext=e,In.sample=function(e){return(Pa(e)?Vn:Fl)(e)},In.size=function(e){if(null==e)return 0;if(Ba(e))return Xa(e)?Wt(e):e.length;var t=to(e);return t==v||t==E?e.size:Al(e).length},In.snakeCase=kr,In.some=function(e,t,n){var l=Pa(e)?mt:Kl;return n&&ao(e,t,n)&&(t=void 0),l(e,Zi(t,3))},In.sortedIndex=function(e,t){return Gl(e,t)},In.sortedIndexBy=function(e,t,n){return Yl(e,t,Zi(n,2))},In.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Oa(e[l],t))return l}return-1},In.sortedLastIndex=function(e,t){return Gl(e,t,!0)},In.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Zi(n,2),!0)},In.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Oa(e[n],t))return n}return-1},In.startCase=Fr,In.startsWith=function(e,t,n){return e=dr(e),n=null==n?0:Zn(ir(n),0,e.length),t=$l(t),e.slice(n,n+t.length)==t},In.subtract=pd,In.sum=function(e){return e&&e.length?At(e,Yr):0},In.sumBy=function(e,t){return e&&e.length?At(e,Zi(t,2)):0},In.template=function(e,t,n){var l=In.templateSettings;n&&ao(e,t,n)&&(t=void 0),e=dr(e),t=cr({},t,l,Vi);var i,o,a=cr({},t.imports,l.imports,Vi),r=_r(a),d=It(a,r),u=0,s=t.interpolate||de,c="__p += '",v=fe((t.escape||de).source+"|"+s.source+"|"+(s===V?ee:de).source+"|"+(t.evaluate||de).source+"|$","g"),m="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,function(t,n,l,a,r,d){return l||(l=a),c+=e.slice(u,d).replace(ue,Mt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),u=d+t.length,t}),c+="';\n";var p=be.call(t,"variable")&&t.variable;if(p){if(J.test(p))throw new ce("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(O,""):c).replace(x,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Wr(function(){return ve(r,m+"return "+c).apply(void 0,d)});if(f.source=c,Ua(f))throw f;return f},In.times=function(e,t){if((e=ir(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Zi(t));++n<e;)t(n);return i},In.toFinite=lr,In.toInteger=ir,In.toLength=or,In.toLower=function(e){return dr(e).toLowerCase()},In.toNumber=ar,In.toSafeInteger=function(e){return e?Zn(ir(e),-9007199254740991,9007199254740991):0===e?e:0},In.toString=dr,In.toUpper=function(e){return dr(e).toUpperCase()},In.trim=function(e,t,n){if((e=dr(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=$l(t)))return e;var l=jt(e),i=jt(t);return di(l,Ot(l,i),xt(l,i)+1).join("")},In.trimEnd=function(e,t,n){if((e=dr(e))&&(n||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=$l(t)))return e;var l=jt(e);return di(l,0,xt(l,jt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=dr(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=$l(t)))return e;var l=jt(e);return di(l,Ot(l,jt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?ir(t.length):n,l="omission"in t?$l(t.omission):l}var o=(e=dr(e)).length;if(Bt(e)){var a=jt(e);o=a.length}if(n>=o)return e;var r=n-Wt(l);if(r<1)return l;var d=a?di(a,0,r).join(""):e.slice(0,r);if(void 0===i)return d+l;if(a&&(r+=d.length-r),Za(i)){if(e.slice(r).search(i)){var u,s=d;for(i.global||(i=fe(i.source,dr(te.exec(i))+"g")),i.lastIndex=0;u=i.exec(s);)var c=u.index;d=d.slice(0,void 0===c?r:c)}}else if(e.indexOf($l(i),r)!=r){var v=d.lastIndexOf(i);v>-1&&(d=d.slice(0,v))}return d+l},In.unescape=function(e){return(e=dr(e))&&M.test(e)?e.replace(L,Kt):e},In.uniqueId=function(e){var t=++De;return dr(e)+t},In.upperCase=Vr,In.upperFirst=Ur,In.each=da,In.eachRight=ua,In.first=Bo,Xr(In,(rd={},dl(In,function(e,t){be.call(In.prototype,t)||(rd[t]=e)}),rd),{chain:!1}),In.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){In[e].placeholder=In}),lt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:an(ir(n),0);var l=this.__filtered__&&!t?new Rn(this):this.clone();return l.__filtered__?l.__takeCount__=rn(n,l.__takeCount__):l.__views__.push({size:rn(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},Rn.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;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Yr)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return Sl(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ca(Zi(e)))},Rn.prototype.slice=function(e,t){e=ir(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ir(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},dl(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=In[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(In.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof Rn,d=a[0],u=r||Pa(t),s=function(e){var t=i.apply(In,st([e],a));return l&&c?t[0]:t};u&&n&&"function"==typeof d&&1!=d.length&&(r=u=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&u){t=p?t:new Rn(this);var f=e.apply(t,a);return f.__actions__.push({func:la,args:[s],thisArg:void 0}),new xn(f,c)}return m&&p?e.apply(this,a):(f=this.thru(s),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Se[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);In.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Pa(i)?i:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),dl(Rn.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";be.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=rn(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,d=r-a,u=l?r:a-1,s=this.__iteratees__,c=s.length,v=0,m=rn(d,this.__takeCount__);if(!n||!l&&i==d&&m==d)return ti(e,this.__actions__);var p=[];e:for(;d--&&v<m;){for(var f=-1,E=e[u+=t];++f<c;){var g=s[f],S=g.type,h=(0,g.iteratee)(E);if(2==S)E=h;else if(!h){if(1==S)continue e;break e}}p[v++]=E}return p},In.prototype.at=ia,In.prototype.chain=function(){return na(this)},In.prototype.commit=function(){return new xn(this.value(),this.__chain__)},In.prototype.next=function(){void 0===this.__values__&&(this.__values__=nr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var l=wo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},In.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:la,args:[zo],thisArg:void 0}),new xn(t,this.__chain__)}return this.thru(zo)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,bt&&(In.prototype[bt]=function(){return this}),In}();Ke?((Ke.exports=Gt)._=Gt,ze._=Gt):je._=Gt}).call(z)});const Y=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],q=e=>{let{searchParams:o,onFilterChange:r,defaultSearchParams:s,statusMap:c,moduleCode:v}=e,m=u(e,Y);const{t:p}=i.useTranslation(),f=a.useQueryClient(),[E,g]=n.useState(()=>d({},o,{services:[]})),[S,h]=n.useState(),[y,_]=n.useState(),[b,D]=n.useState(),A=[{label:"SV_NEW_REGISTRATION",value:"street-vending"}],{data:C}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingActivityType"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingActivityType}});let N=[];C&&C.map(e=>{N.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:T}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingZones"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingZones}});let I=[];T&&T.map(e=>{I.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const w=e=>{let t=e.delete,n=d({},E,e);t&&t.forEach(e=>delete n[e]),delete e.delete,g(d({},n))},O=()=>{g(d({},s,{services:[]})),r(d({},s)),h(null),_(null),D(null)};return n.useEffect(()=>{y&&w({vendingZone:(null==y?void 0:y.code)||""}),S&&w({vendingType:(null==S?void 0:S.code)||""}),b&&w({status:(null==b?void 0:b.i18nKey)||""})},[y,S,b]),l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},p("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:O},p("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&l.createElement("span",{className:"clear-search",onClick:O,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&l.createElement("span",{onClick:m.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("SV_VENDING_ZONES"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:y,select:_,option:I,optionKey:"i18nKey",t:p,placeholder:"Select"})),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("SV_VENDING_TYPE"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:S,select:h,option:N,optionKey:"i18nKey",t:p,placeholder:"Select"})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("SV_APPLICATION_STATUS"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:b,select:D,option:[{i18nKey:"APPLIED"},{i18nKey:"APPROVED"},{i18nKey:"REGISTRATIONCOMPLETED"},{i18nKey:"INSPECTIONPENDING"},{i18nKey:"REJECTED"}],optionKey:"i18nKey",t:p,placeholder:"Select"}))),l.createElement("div",null,l.createElement(j,{searchParams:E,businessServices:E.services,statusMap:c||f.getQueryData("INBOX_STATUS_MAP_"+v),moduleCode:v,onAssignmentChange:(e,t)=>{if(e.target.checked)w({applicationStatus:[...null==E?void 0:E.applicationStatus,t]});else{let e=null==E?void 0:E.applicationStatus.filter(e=>e.state!==t.state);w({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{r(0===E.services.length?d({},E,{services:A.map(e=>e.value)}):E)},label:p("ES_COMMON_APPLY")}))))))},Z=e=>e.substr(0,1).toUpperCase()+e.substr(1),$=function(e,t,n){try{var l;function i(l){var i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T;const I=e=>e.filter(e=>e.value);let w,O;var x,R,L;return null!=e&&null!==(i=e.vendorDetail[0])&&void 0!==i&&i.gender&&(w="M"==(null==e||null===(x=e.vendorDetail[0])||void 0===x?void 0:x.gender)?"Male":"Female"),null!=e&&null!==(o=e.vendorDetail[0])&&void 0!==o&&o.dependentGender&&(O="M"==(null==e||null===(R=e.vendorDetail[0])||void 0===R?void 0:R.dependentGender)?"Male":"Female"),{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(L=n("ULBGRADE_"+(null==t||null===(a=t.city)||void 0===a?void 0:a.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),L.toLowerCase().split(" ").map(Z).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.applicationNo,isTOCRequired:!1,heading:n("SV_ACKNOWLEDGEMENT"),details:[{title:n("SV_VENDOR_PERSONAL_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_VENDOR_NAME"),value:null==e||null===(r=e.vendorDetail[0])||void 0===r?void 0:r.name},{title:n("SV_FATHER_NAME"),value:null==e||null===(d=e.vendorDetail[0])||void 0===d?void 0:d.fatherName},{title:n("SV_REGISTERED_MOB_NUMBER"),value:null==e||null===(u=e.vendorDetail[0])||void 0===u?void 0:u.mobileNo},{title:n("SV_EMAIL"),value:null==e||null===(s=e.vendorDetail[0])||void 0===s?void 0:s.emailId},{title:n("SV_DATE_OF_BIRTH"),value:null==e||null===(c=e.vendorDetail[0])||void 0===c?void 0:c.dob},{title:n("SV_GENDER"),value:w},{title:n("SV_SPOUSE_NAME"),value:null==e||null===(v=e.vendorDetail[0])||void 0===v?void 0:v.spouseName},{title:n("SV_SPOUSE_DATE_OF_BIRTH"),value:null==e||null===(m=e.vendorDetail[0])||void 0===m?void 0:m.spouseDob},{title:n("SV_DEPENDENT_NAME"),value:null==e||null===(p=e.vendorDetail[0])||void 0===p?void 0:p.dependentName},{title:n("SV_DEPENDENT_DATE_OF_BIRTH"),value:null==e||null===(f=e.vendorDetail[0])||void 0===f?void 0:f.dependentDob},{title:n("SV_DEPENDENT_GENDER"),value:O},{title:n("SV_TRADE_NUMBER"),value:null==e||null===(E=e.vendorDetail[0])||void 0===E?void 0:E.tradeNumber}])},{title:n("SV_VENDOR_BUSINESS_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_VENDING_TYPE"),value:null==e?void 0:e.vendingActivity},{title:n("SV_VENDING_ZONES"),value:null==e?void 0:e.vendingZone},{title:n("SV_AREA_REQUIRED"),value:null==e?void 0:e.vendingArea},{title:n("SV_LOCAL_AUTHORITY_NAME"),value:null==e?void 0:e.localAuthorityName},{title:n("SV_VENDING_LISCENCE"),value:null==e?void 0:e.vendingLicenseCertificateId}])},{title:n("SV_BANK_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_ACCOUNT_NUMBER"),value:null==e||null===(g=e.bankDetail)||void 0===g?void 0:g.accountNumber},{title:n("SV_IFSC_CODE"),value:null==e||null===(S=e.bankDetail)||void 0===S?void 0:S.ifscCode},{title:n("SV_BANK_NAME"),value:null==e||null===(h=e.bankDetail)||void 0===h?void 0:h.bankName},{title:n("SV_BANK_BRANCH_NAME"),value:null==e||null===(y=e.bankDetail)||void 0===y?void 0:y.bankBranchName},{title:n("SV_ACCOUNT_HOLDER_NAME"),value:null==e||null===(_=e.bankDetail)||void 0===_?void 0:_.accountHolderName}])},{title:n("SV_ADDRESS_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_ADDRESS_LINE1"),value:null==e||null===(b=e.addressDetails[0])||void 0===b?void 0:b.addressLine1},{title:n("SV_ADDRESS_LINE2"),value:null==e||null===(D=e.addressDetails[0])||void 0===D?void 0:D.addressLine1},{title:n("SV_CITY"),value:null==e||null===(A=e.addressDetails[0])||void 0===A?void 0:A.city},{title:n("SV_LOCALITY"),value:null==e||null===(C=e.addressDetails[0])||void 0===C?void 0:C.locality},{title:n("SV_ADDRESS_PINCODE"),value:null==e||null===(N=e.addressDetails[0])||void 0===N?void 0:N.pincode},{title:n("SV_LANDMARK"),value:null==e||null===(T=e.addressDetails[0])||void 0===T?void 0:T.landmark}])}]}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.fileStoreId);return Promise.resolve((null==o?void 0:o.length)>0?Promise.resolve(Digit.UploadServices.Filefetch(o,Digit.ULBService.getStateId())).then(i):i())}catch(e){return Promise.reject(e)}},X=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("edit")?t("SV_UPDATE_SUCCESSFULL"):t("SV_SUBMIT_SUCCESSFULL"):e.isLoading?t("SV_APPLICATION_PENDING"):e.isSuccess?void 0:t("SV_APPLICATION_FAILED")},J={padding:"4px 0px",justifyContent:"space-between"},Q=e=>{var n,i;return l.createElement(t.Banner,{message:X(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.SVDetail)||void 0===i?void 0:i.applicationNo,info:e.isSuccess?e.t("SV_APPLICATION_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},ee=e=>l.createElement("h1",{className:"heading-m"},e.label),te=()=>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"})),ne=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(te,null)),le=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:S}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,y]=n.useState({}),[_,b]=n.useState({}),[A,C]=n.useState([]),[N,T]=n.useState(null),[I,w]=n.useState(null),[O,x]=n.useState(null),[R,L]=n.useState(null),[P,M]=n.useState([]),[B,k]=n.useState(null),[F,V]=n.useState(!1);function U(e){w(e.target.files[0])}return n.useEffect(()=>{var e;S&&S["egf-master"]&&M(null===(e=S["egf-master"])||void 0===e?void 0:e.FinancialYear)},[S]),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{L(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",I,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?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.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)}}()},[I]),n.useEffect(()=>{r&&y(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:B,setSelectedFinancialYear:k}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:T,selectFile:U,uploadedFile:O,setUploadedFile:x,businessService:m}))},[r,A,P,B,O]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ee,{label:a(h.label.heading)}),headerBarEnd:l.createElement(ne,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:E||(null==r?void 0:r.docUploadRequired)&&!O,formId:"modal-action"},g?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",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:d({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==B?void 0:B.name,propertyId:null==v?void 0:v.propertyId,tenantId:u,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:O}]),c({Property:d({},v,{workflow:t})})}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},ie=e=>l.createElement("h1",{className:"heading-m"},e.label),oe=()=>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"})),ae=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(oe,null)),re=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,S]=n.useState({}),[h,y]=n.useState({}),[_,b]=n.useState([]),[A,C]=n.useState({}),[N,T]=n.useState(null),[I,w]=n.useState(null),[O,x]=n.useState(null),[R,L]=n.useState([]),[P,M]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function k(e){T(e.target.files[0])}return n.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,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?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{r&&S((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:d,uploadedFile:u,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:_,selectedApprover:A,setSelectedApprover:C,selectFile:k,uploadedFile:I,setUploadedFile:w,businessService:m}))},[r,_,R,P,I]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ie,{label:a(g.label.heading)}),headerBarEnd:l.createElement(ae,{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){v=d({},v,{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:I?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:I}]:null}),c({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},de=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ue=()=>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"})),se=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ue,null)),ce=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState({}),[C,N]=n.useState(null),[T,I]=n.useState(null),[w,O]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function R(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(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:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:d,uploadedFile:u,setUploadedFile:s,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:T,setUploadedFile:I,businessService:m,error:w}))},[r,y,T,w]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(de,{label:a(E.label.heading)}),headerBarEnd:l.createElement(se,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.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"}:{}},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=d({},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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null}),c({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},ve=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),me=()=>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"})),pe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(me,null)),fe=e=>{var i,o,r,u,s,c,v,m,p,f,E,g;let{t:S,action:h,tenantId:y,closeModal:_,submitAction:b,applicationDetails:A,applicationData:C,businessService:N,workflowDetails:T,blockReason:I}=e;console.log("applicationData_BPAACTIONMODAL",C),console.log("workflowDetails_BPAACTIONMODAL",T),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:y,!1);const{data:w,isLoading:O}=Digit.Hooks.useEmployeeSearch(y,{roles:null==T||null===(v=T.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===(g=E.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=h&&h.isTerminateState)}),[x,R]=(a.useQueryClient(),n.useState({})),[L,P]=n.useState({}),[M,B]=n.useState([]),[k,F]=n.useState([]),[V,U]=n.useState({}),[H,W]=n.useState({}),[j,z]=n.useState(null),[K,G]=n.useState(null),[Y,q]=n.useState(null),[Z,$]=n.useState(null),X=!!Digit.Utils.browser.isMobile();function J(e){z(e.target.files[0])}n.useEffect(()=>{var e;B(null==w||null===(e=w.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}}))},[w]),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(S("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))q(S("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==y?void 0:y.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):q(S("CS_FILE_UPLOAD_ERROR"))})},function(){q(S("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},ee=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},te=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Q(e.Documents),date:e.InspectionDate,questions:ee(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},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(()=>{F(null==I?void 0:I.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),h&&R((e=>{var n,i,o,a,r,d,u;let{t:s,action:c,approvers:v,selectedApprover:m,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:g,uploadedFile:S,setUploadedFile:h,assigneeLabel:y,businessService:_,error:b,blockReasonFiltered:D}=e,A=!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)||(A=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+_+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||A||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(i=c.state)||void 0===i?void 0:i.state)?null:s(y||"WF_ROLE_"+(null===(o=c.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:c.isTerminateState||A||"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===(d=c.state)||void 0===d?void 0:d.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?l.createElement(t.Dropdown,{option:D,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{h(null)},message:S?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:S,action:h,approvers:M,selectedApprover:V,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:K,setUploadedFile:G,businessService:N,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:k}))},[h,M,Z,K,Y]),h&&x.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ve,{label:S(x.label.heading)}),headerBarEnd:l.createElement(pe,{onClick:_}),actionCancelLabel:S(x.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:S(x.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},O?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:x.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,u,s,c,v,m,p,f,E,g,y,D,N,I,w,O,x,R,L,P,M,B,k,F,U,W,z,G,Y,q,Z,$,X,J,Q,ee;if(C=d({},C,{documents:null===(t=C)||void 0===t?void 0:t.documents,additionalDetails:d({},null===(n=C)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:te(C),pendingapproval:ne(),blockingReason:null==H?void 0:H.name}),workflow:{action:null==h?void 0:h.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(o=T.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==T||null===(s=T.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=V&&V.uuid?[null==V?void 0:V.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(p=T.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.state)||void 0===g?void 0:g.applicationStatus)?[null==T||null===(y=T.data)||void 0===y||null===(D=y.processInstances)||void 0===D||null===(N=D[0])||void 0===N||null===(I=N.assigner)||void 0===I?void 0:I.uuid]:null!=V&&V.uuid?[null==V?void 0:V.uuid]:null,varificationDocuments:K?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:K}]:null},action:null==h?void 0:h.action,riskType:null===(w=C)||void 0===w||null===(O=w.additionalDetails)||void 0===O?void 0:O.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(x=T.data)||void 0===x||null===(R=x.processInstances)||void 0===R||null===(L=R[0])||void 0===L||null===(P=L.state)||void 0===P?void 0:P.applicationStatus)?[null==T||null===(M=T.data)||void 0===M||null===(B=M.processInstances)||void 0===B||null===(k=B[0])||void 0===k||null===(F=k.assigner)||void 0===F?void 0:F.uuid]:null!=V&&V.uuid?[null==V?void 0:V.uuid]:null,wfDocuments:K?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:K}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(U=C)||void 0===U||null===(W=U.additionalDetails)||void 0===W||null===(z=W.selfCertificationCharges)||void 0===z?void 0:z.BPA_MALBA_CHARGES)+parseInt(null===(G=C)||void 0===G||null===(Y=G.additionalDetails)||void 0===Y||null===(q=Y.selfCertificationCharges)||void 0===q?void 0:q.BPA_LABOUR_CESS)+parseInt(null===(Z=C)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(X=$.selfCertificationCharges)||void 0===X?void 0:X.BPA_WATER_CHARGES)+parseInt(null===(J=C)||void 0===J||null===(Q=J.additionalDetails)||void 0===Q||null===(ee=Q.selfCertificationCharges)||void 0===ee?void 0:ee.BPA_GAUSHALA_CHARGES_CESS))_(),alert(S("Enterd Less Adjustment amount is invalid"));else{var le,ie;const e=null==A||null===(le=A.nocData)||void 0===le?void 0:le.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||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];if(e&&e.map(e=>{var t,o,a,r,d,u,s,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(d=e.Noc)||void 0===d||null===(u=d.applicationStatus)||void 0===u?void 0:u.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(_(),alert(S("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},Ee=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ge=()=>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"})),Se=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ge,null)),he=e=>{var i,r,u,s,c,v,m;let{t:p,action:f,tenantId:E,closeModal:g,submitAction:S,applicationData:h,businessService:y}=e;const{data:_,isLoading:b}=Digit.Hooks.useEmployeeSearch(E,{roles:null===(i=workflowDetails)||void 0===i||null===(r=i.data)||void 0===r||null===(u=r.initialActionState)||void 0===u||null===(s=u.nextActions)||void 0===s||null===(c=s.filter(e=>(null==e?void 0:e.action)==(null==f?void 0:f.action)))||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.assigneeRoles)||void 0===m?void 0:m.map(e=>({code:e})),isActive:!0},{enabled:!(null!=f&&f.isTerminateState)}),[A,C]=(a.useQueryClient(),n.useState({})),[N,T]=n.useState({}),[I,w]=n.useState([]),[O,x]=n.useState({}),[R,L]=n.useState(null),[P,M]=n.useState(null),[B,k]=n.useState(null),F=!!Digit.Utils.browser.isMobile();function V(e){L(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;w(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(()=>{!function(){try{k(null);const e=function(){if(R){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(R.size>=5242880)k(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=R&&R.type&&!e.test(null==R?void 0:R.type))k(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",R,Digit.ULBService.getStateId()||(null==E?void 0:E.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?M(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):k(p("CS_FILE_UPLOAD_ERROR"))})},function(){k(p("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)}}()},[R]),n.useEffect(()=>{f&&C((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:f,approvers:I,selectedApprover:O,setSelectedApprover:x,selectFile:V,uploadedFile:P,setUploadedFile:M,businessService:y,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:B}))},[f,I,P,B]),f&&A.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ee,{label:p(A.label.heading)}),headerBarEnd:l.createElement(Se,{onClick:g}),actionCancelLabel:p(A.label.cancel),actionCancelOnSubmit:g,actionSaveLabel:p(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:F?{width:"720px"}:{},style:F?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:F?{paddingLeft:"5px"}:{}},b?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:A.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=h)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=h)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),h=d({},h,{workflow:{action:null==f?void 0:f.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=O&&O.uuid?[null==O?void 0:O.uuid]:null,documents:P?[{documentType:(null==f?void 0:f.action)+" DOC",fileName:null==R?void 0:R.name,fileStoreId:P}]:null},documents:o}),S({Noc:h},!1,{isNoc:!0})},defaultValues:N,formId:"modal-action"})):l.createElement(t.Loader,null)};var ye=function(e,t){return e===t||e!=e&&t!=t},_e=function(e,t){for(var n=e.length;n--;)if(ye(e[n][0],t))return n;return-1},be=Array.prototype.splice;function De(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])}}De.prototype.clear=function(){this.__data__=[],this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=_e(t,e);return!(n<0||(n==t.length-1?t.pop():be.call(t,n,1),--this.size,0))},De.prototype.get=function(e){var t=this.__data__,n=_e(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return _e(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,l=_e(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ae,Ce=De,Ne="object"==typeof z&&z&&z.Object===Object&&z,Te="object"==typeof self&&self&&self.Object===Object&&self,Ie=Ne||Te||Function("return this")(),we=Ie.Symbol,Oe=Object.prototype,xe=Oe.hasOwnProperty,Re=Oe.toString,Le=we?we.toStringTag:void 0,Pe=Object.prototype.toString,Me=we?we.toStringTag:void 0,Be=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Me&&Me in Object(e)?function(e){var t=xe.call(e,Le),n=e[Le];try{e[Le]=void 0;var l=!0}catch(e){}var i=Re.call(e);return l&&(t?e[Le]=n:delete e[Le]),i}(e):function(e){return Pe.call(e)}(e)},ke=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Fe=function(e){if(!ke(e))return!1;var t=Be(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ve=Ie["__core-js_shared__"],Ue=(Ae=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||""))?"Symbol(src)_1."+Ae:"",He=Function.prototype.toString,We=function(e){if(null!=e){try{return He.call(e)}catch(e){}try{return e+""}catch(e){}}return""},je=/^\[object .+?Constructor\]$/,ze=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ke(e)||(t=e,Ue&&Ue in t))&&(Fe(e)?ze:je).test(We(e));var t}(n)?n:void 0},Ge=Ke(Ie,"Map"),Ye=Ke(Object,"create"),qe=Object.prototype.hasOwnProperty,Ze=Object.prototype.hasOwnProperty;function $e(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])}}$e.prototype.clear=function(){this.__data__=Ye?Ye(null):{},this.size=0},$e.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$e.prototype.get=function(e){var t=this.__data__;if(Ye){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(t,e)?t[e]:void 0},$e.prototype.has=function(e){var t=this.__data__;return Ye?void 0!==t[e]:Ze.call(t,e)},$e.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ye&&void 0===t?"__lodash_hash_undefined__":t,this};var Xe=$e,Je=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 Qe(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])}}Qe.prototype.clear=function(){this.size=0,this.__data__={hash:new Xe,map:new(Ge||Ce),string:new Xe}},Qe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Je(this,e).get(e)},Qe.prototype.has=function(e){return Je(this,e).has(e)},Qe.prototype.set=function(e,t){var n=Je(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var et=Qe;function tt(e){var t=this.__data__=new Ce(e);this.size=t.size}tt.prototype.clear=function(){this.__data__=new Ce,this.size=0},tt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},tt.prototype.get=function(e){return this.__data__.get(e)},tt.prototype.has=function(e){return this.__data__.has(e)},tt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ce){var l=n.__data__;if(!Ge||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new et(l)}return n.set(e,t),this.size=n.size,this};var nt=tt,lt=function(){try{var e=Ke(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),it=function(e,t,n){"__proto__"==t&&lt?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ot=Object.prototype.hasOwnProperty,at=function(e,t,n){var l=e[t];ot.call(e,t)&&ye(l,n)&&(void 0!==n||t in e)||it(e,t,n)},rt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=l?l(n[r],e[r],r,n,e):void 0;void 0===d&&(d=e[r]),i?it(n,r,d):at(n,r,d)}return n},dt=function(e){return null!=e&&"object"==typeof e},ut=function(e){return dt(e)&&"[object Arguments]"==Be(e)},st=Object.prototype,ct=st.hasOwnProperty,vt=st.propertyIsEnumerable,mt=ut(function(){return arguments}())?ut:function(e){return dt(e)&&ct.call(e,"callee")&&!vt.call(e,"callee")},pt=Array.isArray,ft=function(){return!1},Et=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Ie.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ft}),gt=/^(?:0|[1-9]\d*)$/,St=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&gt.test(e))&&e>-1&&e%1==0&&e<t},ht=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},yt={};yt["[object Float32Array]"]=yt["[object Float64Array]"]=yt["[object Int8Array]"]=yt["[object Int16Array]"]=yt["[object Int32Array]"]=yt["[object Uint8Array]"]=yt["[object Uint8ClampedArray]"]=yt["[object Uint16Array]"]=yt["[object Uint32Array]"]=!0,yt["[object Arguments]"]=yt["[object Array]"]=yt["[object ArrayBuffer]"]=yt["[object Boolean]"]=yt["[object DataView]"]=yt["[object Date]"]=yt["[object Error]"]=yt["[object Function]"]=yt["[object Map]"]=yt["[object Number]"]=yt["[object Object]"]=yt["[object RegExp]"]=yt["[object Set]"]=yt["[object String]"]=yt["[object WeakMap]"]=!1;var _t=function(e){return function(t){return e(t)}},bt=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&Ne.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Dt=bt&&bt.isTypedArray,At=Dt?_t(Dt):function(e){return dt(e)&&ht(e.length)&&!!yt[Be(e)]},Ct=Object.prototype.hasOwnProperty,Nt=function(e,t){var n=pt(e),l=!n&&mt(e),i=!n&&!l&&Et(e),o=!n&&!l&&!i&&At(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],d=r.length;for(var u in e)!t&&!Ct.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||St(u,d))||r.push(u);return r},Tt=Object.prototype,It=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Tt)},wt=function(e,t){return function(n){return e(t(n))}},Ot=wt(Object.keys,Object),xt=Object.prototype.hasOwnProperty,Rt=function(e){return null!=e&&ht(e.length)&&!Fe(e)},Lt=function(e){return Rt(e)?Nt(e):function(e){if(!It(e))return Ot(e);var t=[];for(var n in Object(e))xt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Pt=Object.prototype.hasOwnProperty,Mt=function(e){return Rt(e)?Nt(e,!0):function(e){if(!ke(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=It(e),n=[];for(var l in e)("constructor"!=l||!t&&Pt.call(e,l))&&n.push(l);return n}(e)},Bt=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Ie.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),kt=function(){return[]},Ft=Object.prototype.propertyIsEnumerable,Vt=Object.getOwnPropertySymbols,Ut=Vt?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];Ft.call(e,r)&&(a[o++]=r)}return a}(Vt(e)))}:kt,Ht=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Wt=wt(Object.getPrototypeOf,Object),jt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ht(t,Ut(e)),e=Wt(e);return t}:kt,zt=function(e,t,n){var l=t(e);return pt(e)?l:Ht(l,n(e))},Kt=function(e){return zt(e,Lt,Ut)},Gt=function(e){return zt(e,Mt,jt)},Yt=Ke(Ie,"DataView"),qt=Ke(Ie,"Promise"),Zt=Ke(Ie,"Set"),$t=Ke(Ie,"WeakMap"),Xt=We(Yt),Jt=We(Ge),Qt=We(qt),en=We(Zt),tn=We($t),nn=Be;(Yt&&"[object DataView]"!=nn(new Yt(new ArrayBuffer(1)))||Ge&&"[object Map]"!=nn(new Ge)||qt&&"[object Promise]"!=nn(qt.resolve())||Zt&&"[object Set]"!=nn(new Zt)||$t&&"[object WeakMap]"!=nn(new $t))&&(nn=function(e){var t=Be(e),n="[object Object]"==t?e.constructor:void 0,l=n?We(n):"";if(l)switch(l){case Xt:return"[object DataView]";case Jt:return"[object Map]";case Qt:return"[object Promise]";case en:return"[object Set]";case tn:return"[object WeakMap]"}return t});var ln=nn,on=Object.prototype.hasOwnProperty,an=Ie.Uint8Array,rn=function(e){var t=new e.constructor(e.byteLength);return new an(t).set(new an(e)),t},dn=/\w*$/,un=we?we.prototype:void 0,sn=un?un.valueOf:void 0,cn=Object.create,vn=function(){function e(){}return function(t){if(!ke(t))return{};if(cn)return cn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mn=bt&&bt.isMap,pn=mn?_t(mn):function(e){return dt(e)&&"[object Map]"==ln(e)},fn=bt&&bt.isSet,En=fn?_t(fn):function(e){return dt(e)&&"[object Set]"==ln(e)},gn={};gn["[object Arguments]"]=gn["[object Array]"]=gn["[object ArrayBuffer]"]=gn["[object DataView]"]=gn["[object Boolean]"]=gn["[object Date]"]=gn["[object Float32Array]"]=gn["[object Float64Array]"]=gn["[object Int8Array]"]=gn["[object Int16Array]"]=gn["[object Int32Array]"]=gn["[object Map]"]=gn["[object Number]"]=gn["[object Object]"]=gn["[object RegExp]"]=gn["[object Set]"]=gn["[object String]"]=gn["[object Symbol]"]=gn["[object Uint8Array]"]=gn["[object Uint8ClampedArray]"]=gn["[object Uint16Array]"]=gn["[object Uint32Array]"]=!0,gn["[object Error]"]=gn["[object Function]"]=gn["[object WeakMap]"]=!1;var Sn=function e(t,n,l,i,o,a){var r,d=1&n,u=2&n,s=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!ke(t))return t;var c=pt(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&on.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!d)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=ln(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(Et(t))return Bt(t,d);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=u||m?{}:function(e){return"function"!=typeof e.constructor||It(e)?{}:vn(Wt(e))}(t),!d)return u?function(e,t){return rt(e,jt(e),t)}(t,function(e,t){return e&&rt(t,Mt(t),e)}(r,t)):function(e,t){return rt(e,Ut(e),t)}(t,function(e,t){return e&&rt(t,Lt(t),e)}(r,t))}else{if(!gn[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rn(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rn(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?rn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,dn.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return sn?Object(sn.call(e)):{}}}(t,v,d)}}a||(a=new nt);var p=a.get(t);if(p)return p;a.set(t,r),En(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(s?u?Gt:Kt:u?Mt:Lt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),at(r,o,e(i,n,l,o,t,a))}),r},hn=function(e){return Sn(e,5)};const yn=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"})),bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_n,null)),Dn=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}},An=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState({}),[C,N]=n.useState(null),[T,I]=n.useState(null),[w,O]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),R=window.location.href.includes("/employee");function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,d({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{v(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m,error:w})):r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m,error:w}))},[r,y,T,w]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(bn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&R?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,g,S,h,y,_,D,A,N;const t=d({},null===(E=v)||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===(S=v)||void 0===S?void 0:S.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(y=h.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(_=v)&&void 0!==_&&null!==(D=_.applicationType)&&void 0!==D&&D.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=v)&&void 0!==A&&null!==(N=A.applicationType)&&void 0!==N&&N.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.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!=b&&b.uuid?[{uuid:null==b?void 0:b.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(v=d({},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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null,processInstance:d({},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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=hn(null==e?void 0:e.date);v.disconnectionExecutionDate=Dn(t)}else if(null!=e&&e.date){const t=hn(null==e?void 0:e.date);v.connectionExecutionDate=Dn(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(m=s.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=v)||void 0===I?void 0:I.serviceType)?c({WaterConnection:v,disconnectRequest:!0}):c({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var w,O,x,R,L,P,M,B,k,F,V,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenalty)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebate)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(V=t.value)&&void 0!==V&&V.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Cn=e=>l.createElement("h1",{className:"heading-m"},e.label),Nn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Nn,null)),In=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState(null),[C,N]=n.useState(null),[T,I]=n.useState(null),[w,O]=n.useState(null),[x,R]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(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:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,y,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Cn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Tn,{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",c({PetRegistrationApplications:[d({},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],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),c({PetRegistrationApplications:[d({},v,{workflow:t})]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},wn=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"})),xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(On,null)),Rn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[g,S]=n.useState({}),[h,y]=n.useState({}),[_,b]=n.useState([]),[D,A]=n.useState(""),[C,N]=n.useState([]),[T,I]=n.useState(null),w=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",w);const O=n.useMemo(()=>{var e;if(E||!f||!w.length)return[];const t=new Set(w.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,w]);return console.log("years",O),n.useEffect(()=>{u&&S((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:d}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:O,selectedApprover:D,setSelectedApprover:A,businessService:m}))},[u,O,C,T]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(xn,{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=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=d({},v,{financialYear:i,action:"INITIATE",additionalDetail:d({},v.additionalDetail,{validityYears:D.length>0?parseInt(D):""})}),c({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),Pn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Mn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pn,null)),Bn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState(null),[C,N]=n.useState(null),[T,I]=n.useState(null),[w,O]=n.useState(null),[x,R]=n.useState(!1);function L(e){R(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(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(R(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:d,selectedApprover:u,setSelectedApprover:s,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:d,t:n,optionKey:"name",select:s,selected:u})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m,isUploading:x}))},[r,y,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ln,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Mn,{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};T&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),c({streetVendingDetail:d({},v,{workflow:n})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},kn=e=>l.createElement("h1",{className:"heading-m"},e.label),Fn=()=>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(Fn,null)),Un=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState(null),[C,N]=n.useState(null),[T,I]=n.useState(null),[w,O]=n.useState(null),[x,R]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(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:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:d}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+d+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,y,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(kn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Vn,{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};T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:T}]),c({hallsBookingApplication:[d({},v,{workflow:t})]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Hn=e=>l.createElement("h1",{className:"heading-m"},e.label),Wn=()=>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"})),jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Wn,null)),zn=e=>{var i,a,r;let{t:u,action:s,tenantId:c,closeModal:v,submitAction:m,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)}),S=o.useHistory(),[h,y]=n.useState({}),[_,b]=n.useState({}),[D,A]=n.useState([]),[C,N]=n.useState(null),[T,I]=n.useState(null);return n.useEffect(()=>{var e;A(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)?S.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):y((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:D,selectedApprover:C,setSelectedApprover:N,uploadedFile:T,setUploadedFile:I,businessService:f}))},[s,D,T]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Hn,{label:u(h.label.heading)}),headerBarEnd:l.createElement(jn,{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};T&&(t.documents=[]),m({Asset:d({},p,{workflow:t})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Kn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(le,e):null!=e&&e.businessService.includes("ptr")?l.createElement(In,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(re,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Rn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ce,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(fe,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(he,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(An,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Bn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Un,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(zn,e):void 0;function Gn(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:d}=e;const{t:u}=i.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==n?void 0:n.map((e,i)=>{var o,s,c;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:d||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},u(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:d||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==n?void 0:n.map((e,n)=>{var 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"}},u(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"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(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"}},""+u(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Yn=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:d,bpaActionsDetails:u}=e;const s=(null==r?void 0:r.status)||"",c=(null==u||null===(t=u.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,S]=n.useState([]),[h,y]=n.useState(!0),[_,b]=n.useState(!1),[D,A]=n.useState(!1),{isLoading:C,data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:T,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==N||null===(o=N.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let u=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==d||null===(l=d[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),u.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(u)),S(u)},[!C,!T]),n.useEffect(()=>{let e=0;g.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)}),y("0"!=e&&0!=e||!(m.length>0))},[m,_]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,u]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(qn,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:D}))))};function qn(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:c,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,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===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[S,h]=n.useState(null),[y,_]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[b,D]=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==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==E?void 0:E.code,fileStoreId:y,documentUid:y,fileName:(null==S?void 0:S.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}]})},[y,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[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[S]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Gn,{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=>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 i;0!==Object.keys(n).length&&D(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Zn(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,i)=>{var o,r,d,u,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(d=e.date)||void 0===d?void 0:d.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===(u=e.questions)||void 0===u?void 0:u.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Gn,{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 $n(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:d}=e;const u=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==u?void 0:u.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Xn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:d,applicationData:u,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==u?void 0:u.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:d}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!d}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[S,h]=n.useState([]),[y,_]=n.useState([]),[b,D]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[N,T]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,s,c;l=d?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==u?void 0:u.status)&&e.RiskType==(null==u?void 0:u.riskType)&&e.ServiceType==(null==u||null===(t=u.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==u||null===(n=u.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==S||S.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)}),_(v))},[f,S]),n.useEffect(()=>{D("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[u,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:I?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:I?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:I?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Gn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==y?void 0:y.map((e,t)=>l.createElement($n,{key:t,document:e,t:o,error:N,setError:T,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:b}))))},Jn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,c,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?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 i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Qn(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 el(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 tl(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 i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const nl=e=>{var o,a;let{scrutinyDetails:r,paymentsList:d=[],additionalDetails:u,applicationData:s}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==s?void 0:s.status))&&window.location.href.includes("bpa");const[c,v]=n.useState(),[m,p]=n.useState(),[f,E]=n.useState(),g=Digit.ULBService.getStateId(),[S,h]=n.useState(),[y,_]=n.useState(),[b,A]=n.useState([]),[C,N]=n.useState(),[T,I]=n.useState(""),[w,O]=n.useState(null),[x,R]=n.useState({}),[L,P]=n.useState(!1),[M,B]=n.useState(!1);n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(C.size>=2e6)O(k("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?A([...b,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):O(k("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else O(k("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(b))},[b]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=u&&null!==(e=u.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==u?void 0:u.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==u||null===(n=u.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==u||null===(l=u.lessAdjustmentFeeFiles[(null==u||null===(i=u.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,g).then(e=>R(null==e?void 0:e.data))}v(null==u||null===(t=u.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==u||null===(n=u.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),p(null==u||null===(l=u.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==u||null===(i=u.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==u||null===(o=u.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==u||null===(a=u.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==u?void 0:u.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==u?void 0:u.otherFeesDiscription),A(null==u?void 0:u.lessAdjustmentFeeFiles)},[u]);const{t:k}=i.useTranslation(),F=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},k(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?k(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void k("NA");return l.createElement(n.Fragment,null,!(null!=r&&r.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==r||null===(o=r.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:""+k(""+e.title),text:null!=e&&e.value?F(e)+" "+k(null==e?void 0:e.isUnit):k("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:""+k(""+e.title),text:F(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},k(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},k(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},ll=e=>{var o,a,r,d,u;let{edcrDetails:s,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 g(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:Number(null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea).toFixed(2),FloorArea:Number(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function S(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==s||null===(o=s.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==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(d=r.value)||void 0===d||null===(u=d.planDetail)||void 0===u?void 0:u.blocks.map((e,n)=>{var i,o,a,r,d;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(d=r.blocks)||void 0===d?void 0:d.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:S(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:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},il=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))},ol=e=>{var o,a,r;let{data:d,OpenImage:u,privacy:s={}}=e;const[c,v]=n.useState(!1),{t:m}=i.useTranslation();return l.createElement("div",null,d.date&&l.createElement("p",null,d.date),l.createElement("p",null,d.name),d.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:d.mobileNumber,privacy:s}),l.createElement("p",null,"    ")),d.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+d.source.toUpperCase())),d.comment&&l.createElement(il,{otherComment:null==d?void 0:d.otherComment,headComment:null==d?void 0:d.comment}),null!=d&&d.wfComment?l.createElement("div",null,null==d||null===(o=d.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==d||null===(a=d.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==d?void 0:d.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==d?void 0:d.thumbnailsToShow)}})):null)};function al(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 rl(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 dl=e=>{var o,a,r,d,u;let{wsAdditionalDetails:s}=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:g,roadCuttingAddlDetails:S,activationDetails:h}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(o=s.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==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==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:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==S?void 0:S.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.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:""})))))))},ul=[{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"}],sl=[{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"}],cl=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),S=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[h,y]=n.useState(!1),[b,D]=n.useState(v||{}),[A,C]=n.useState(null),[N,T]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[I,w]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),O=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(O,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=d({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,c,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(c=v.billDetails)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.taxAmount)}];w(e),T(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),D(i)},[]);let x={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>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"})),P=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=d({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}D(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},I&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==I?void 0:I.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==N?void 0:N.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(S?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:S?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{y(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,h&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{D(v),y(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{D(v),y(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,S,h;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n=d({},null==s||null===(v=s.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(S=s.additionalDetails)||void 0===S||null===(h=S.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,d,u,s,c,v,p,f,g,S;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(S=g.taxHeadEstimates)||void 0===S||S.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const h=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(u=e.Calculation)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(hn(e.Calculation[0])),T(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),w(h),b.billDetails=null==e?void 0:e.Calculation,m(b),y(!1)}).catch(e=>{var t,n,l,i,o,a;C({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===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({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:ul,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"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,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==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},x={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==b?void 0:b.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},x={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:sl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"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,c("PT_REASON")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},x={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==b?void 0:b.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},x={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:c(null==A?void 0:A.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},vl=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"})))},ml=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:d=""}=e;i=i||Digit.SessionStorage.get("userType");const u=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:u?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(vl,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(d)))))},pl=e=>{var o,a,r,d,u,s,c;let{wsAdditionalDetails:v}=e;const{t:m}=i.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),S=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"})),y=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),g(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(S,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(y,{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===(d=E.billSlabData)||void 0===d||null===(u=d.CHARGES)||void 0===u?void 0:u.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},fl={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:{}},El=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:fl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:fl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:d({},fl.cell,fl.cellLeft,fl.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:d({},fl.cell,n.length==t+1?fl.cellRight:{},fl.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({},fl.cell,fl.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:d({},fl.cell,{textAlign:"left"},n.length==i+1?fl.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:d({},fl.cell,fl.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:d({},fl.cell,fl.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:d({},fl.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:fl.cell,key:t,numeric:!0})))))))},gl={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))"}},Sl=e=>{var t,o,a;let{bill:r={}}=e;const{t:d}=i.useTranslation();let u={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||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));s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);u[((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={};!u||Object.keys(u).map((e,t)=>{Object.keys(u[e]).map(t=>{m[t]=u[e]&&u[e][t]&&u[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:gl.headerStyle},d("CS_ARREARS_DETAILS")),f&&l.createElement(El,{headers:[...p],values:u,arrears:v}),!f&&l.createElement("div",{style:gl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},d("CS_SHOW_CARD"))),f&&l.createElement("div",{style:gl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},d("CS_HIDE_CARD"))))},hl=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}},"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),n!==t.length-1&&l.createElement("hr",null)))))},yl=e=>{var t;let{applicationData:i}=e;const[a,r]=n.useState(!1);return o.useHistory(),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:()=>{r(!a)}},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"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{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"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},i.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(d=null===(t=i.auditDetails)||void 0===t?void 0:t.createdTime,new Date(d).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.status)),l.createElement("div",null,l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var d},_l=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payments found"),(null==t?void 0:t.length)>0&&l.createElement("div",null,l.createElement("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"10px"}},l.createElement("thead",null,l.createElement("tr",{style:{backgroundColor:"#f5f5f5"}},l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Receipt Number"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction Date"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Amount Paid"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Payment Mode"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction ID"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Status"))),l.createElement("tbody",null,t.map((e,t)=>{var n,i;return l.createElement("tr",{key:e.id||t},l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},(null===(n=e.paymentDetails)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.receiptNumber)||e.receiptNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionDate?new Date(e.transactionDate).toLocaleDateString():"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},"₹",e.totalAmountPaid||e.amount||"0"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.paymentMode||e.instrumentType||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionNumber||e.instrumentNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},l.createElement("span",{style:{color:"NEW"===e.paymentStatus||"SUCCESSFUL"===e.paymentStatus?"green":"FAILED"===e.paymentStatus?"red":"orange",fontWeight:"bold"}},e.paymentStatus||"N/A")))}))),l.createElement("div",{style:{marginTop:"10px",fontSize:"14px",color:"#666"}},"Total Payments: ",t.length))))};function bl(e){var a,r,u,s,c,v,m,p,f,E,g,S,h,y,b,A;let{applicationDetails:C,demandData:N,workflowDetails:T,isDataLoading:I,applicationData:w,timelineStatusPrefix:O,showTimeLine:x=!0,statusAttribute:R="status",paymentsList:L,oldValue:P,isInfoLabel:M=!1,propertyId:B,moduleCode:k}=e;const{t:F}=i.useTranslation(),V=o.useHistory(),U=Digit.ULBService.getCurrentTenantId(),[H,W]=n.useState(null),[j,z]=n.useState([]);let K=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function G(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}n.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=w&&w.connectionNo){const e=D(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==w?void 0:w.tenantId)||U,filters:{consumerCodes:null==w?void 0:w.connectionNo,consumerCode:null==w?void 0:w.connectionNo},BusinessService:"SEWERAGE"===(null==w?void 0:w.serviceType)?"SW":"WS"})).then(function(e){Array.isArray(e)&&e.length>0?z(e):null!=e&&e.Payments&&e.Payments.length>0&&z(e.Payments)})},function(e){console.error("Payment fetch error:",e)});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[null==w?void 0:w.connectionNo,null==w?void 0:w.tenantId,null==w?void 0:w.serviceType,U]);const[Y,q]=n.useState({}),[Z,$]=n.useState(),[X,J]=n.useState([]),[Q,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==w?void 0:w.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(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)});const o=Array.from(l.values());return J(o),$(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==w?void 0:w.tenantId)||U,null==w?void 0:w.propertyId,q,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ne=function(e,t,n){if(void 0===t&&(t=0),!e)return null;if("OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==w||null===(i=w.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==w?void 0:w.channel)||""};return l.createElement(ol,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,b,D;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},A=n&&Array.isArray(n)&&t>0&&t-1<n.length?n[t-1]:null,N={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:(null==e||null===(d=e.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.name)||"N/A",mobileNumber:(null==w||null===(s=w.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.uuid)&&null!=w&&null!==(f=w.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(g=E[0])&&void 0!==g&&g.mobileNumber?null==w||null===(S=w.processInstance)||void 0===S||null===(h=S.assignes)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber:(null==e||null===(b=e.assignes)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.mobileNumber)||"N/A",comment:null!=e&&e.comment?F(e.comment):"N/A",wfComment:A&&A.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return l.createElement(ol,{data:N,OpenImage:G,privacy:i})}{var A,N,T,I,O;const t={date:te(null==w||null===(A=w.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:(null==e||null===(N=e.assignes)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.name)||"N/A",wfComment:(null==e?void 0:e.wfComment)||[],mobileNumber:(null==e||null===(I=e.assignes)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.mobileNumber)||"N/A"};return l.createElement(ol,{data:t})}},le=(e,t)=>e?t?e:F(e):F("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),de=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)+" "+F(null==e?void 0:e.isUnit):F("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):F("N/A"),[ue,se]=n.useState(!1),ce=(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),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)},U,n)).then(function(){})}catch(e){return Promise.reject(e)}}),ve=null==C?void 0:C.applicationData,me=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return n.useEffect(()=>{try{if("WS"===k)return;let e={consumerCodes:B};const t=!0;"BPREG"===k?Digit.OBPSService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):Digit.PTService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)})}catch(e){}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},M?l.createElement(ml,{t:F,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,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,N,I,w,O,x,R,M,B,k,V,U,H,W,j,z,G,q,Z,$;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"}:ie?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+F(e.title):F(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},F(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"}},F(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},F(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},F(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,i)=>{var a,r,d;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:F(n.title),label:F(n.title),text:l.createElement("img",{src:F(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:F(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"}},F(null==n?void 0:n.title)))):oe||ae?""+F(n.title):F(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===(d=e.values)||void 0===d?void 0:d.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:""+F(""+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:F(n.title),label:F(n.title),text:de(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(Sl,{bill:null===(r=Y.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(nl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:L,additionalDetails:null==C||null===(d=C.applicationData)||void 0===d?void 0:d.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(u=C.applicationData)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(Zn,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(el,{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(tl,{owners:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(rl,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories)&&l.createElement(al,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!K&&(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions)&&(null==T||null===(A=T.data)||void 0===A||null===(N=A.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(Jn,{applicationData:null==C?void 0:C.applicationData,t:F,permissions:null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.permissions}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Yn,{t:F,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.noc)&&l.createElement(Xn,{t:F,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(x=e.additionalDetails)||void 0===x?void 0:x.data,bpaActionsDetails:T}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(nl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.buildingExtractionDetails)&&l.createElement(nl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(ll,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&l.createElement(Gn,{documents:null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documentsWithUrl}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.taxHeadEstimatesCalculation)&&l.createElement(Qn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(dl,{wsAdditionalDetails:e,oldValue:P}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(j=e.additionalDetails)||void 0===j||null===(z=j.redirectUrl)||void 0===z?void 0:z.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(G=e.additionalDetails)||void 0===G||null===(q=G.redirectUrl)||void 0===q?void 0:q.title))),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.estimationDetails)&&l.createElement(cl,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.estimationDetails)&&l.createElement(pl,{wsAdditionalDetails:e,workflowDetails:T}))}),(null==Z?void 0:Z.length)>0&&l.createElement(hl,{assessmentData:X}),l.createElement(_l,{payments:j}),"WS"!==k&&l.createElement(yl,{applicationData:null==C?void 0:C.applicationData}),x&&(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)||I)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!I&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},F("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(v=T.data)&&void 0!==v&&v.timeline&&1===(null==T||null===(m=T.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:F(""+O+(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===(S=T.data)||void 0===S?void 0:S.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)&&(null==T||null===(y=T.data)||void 0===y?void 0:y.timeline.slice(0,ue?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,d,u,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.data)&&void 0!==r&&null!==(d=r.timeline[n-1])&&void 0!==d&&null!==(u=d.state)&&void 0!==u&&u.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:F(""+O+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[R])+a),customChild:ne(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(b=T.data)||void 0===b||null===(A=b.timeline)||void 0===A?void 0:A.length)>2&&l.createElement(t.LinkButton,{label:F(ue?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{se(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(ve,"ACTIVE",me):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(ve,"INACTIVE",me):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&V.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&V.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:F(H.label),onClose:()=>{W(null)},isDleteBtn:"false"}))}function Dl(e){var n,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y;let{t:_,showToast:b,closeToast:D,businessService:A}=e;if(null!=A&&A.includes("NewTL")||null!=A&&A.includes("TL")||null!=A&&A.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:_("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:_("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:_("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:_("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:_("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:_("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:_("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:_("ES_"+A+"_"+(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:D}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.includes("BPA_OC")){var N;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!=A&&A.includes("BPA_OC")?_(e[1]):_(e[0]),n};let n="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.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===(g=b.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==b?void 0:b.key)?null==b||null===(S=b.error)||void 0===S?void 0:S.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:_("ES_"+A+"_"+(null==b||null===(y=b.action)||void 0===y?void 0:y.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:D}))}{var T,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(T=b.error)||void 0===T?void 0:T.message:"ES_"+A+"_"+(null==b||null===(I=b.action)||void 0===I?void 0:I.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:_(e),onClose:D}))}}function Al(e){var o,a,r,u,s,c,v,m,p,f,E,g,S,h,y,_;let{workflowDetails:b,displayMenu:D,onActionSelect:A,setDisplayMenu:C,businessService:N,forcedActionPrefix:T,ActionBarStyle:I={},MenuStyle:w={}}=e;const{t:O}=i.useTranslation();let x=Digit.UserService.getUser();const R=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};x=null==t?void 0:t.value}const L=null===(o=x)||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 P=!1,M=!1,B=(null==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==L?void 0:L.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==L?void 0:L.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",b),Digit.Hooks.useClickOutside(R,()=>{C(!1)},D),(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)?(M=!1,P=!0):(null==B?void 0:B.length)>0&&(M=!0,P=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&M&&!P&&l.createElement(t.ActionBar,{style:d({},I)},D&&(null!=b&&null!==(E=b.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=b&&null!==(S=b.data)&&void 0!==S&&S.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:T||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()),options:B,optionKey:"action",t:O,onSelect:A,style:w}):null,l.createElement(t.SubmitBar,{ref:R,label:O("WF_TAKE_ACTION"),onSubmit:()=>C(!D)})),!(null!=b&&b.isLoading)&&!M&&P&&l.createElement(t.ActionBar,{style:d({},I)},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===(y=B[0])||void 0===y?void 0:y.action,onClick:e=>{A((null==B?void 0:B[0])||{})}},O((T||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()))+"_"+(null==B||null===(_=B[0])||void 0===_?void 0:_.action)))))}const 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"})),Nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Cl,null));function Tl(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(Nl,{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 Il=e=>{var r,u;let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=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,S]=n.useState(!1),[h,y]=n.useState(null),[_,b]=n.useState(!1),[A,C]=n.useState(!1),[N,T]=n.useState(!1),{data:I}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:w,demandData:O,totalDemandTax:x,totalBalanceTax:R,showToast:L,setShowToast:P,isLoading:M,isDataLoading:B,applicationData:k,mutate:F,nocMutation:V,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:z,timelineStatusPrefix:K,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:Z,paymentsList:$,showTimeLine:X=!0,oldValue:J,isInfoLabel:Q=!1,clearDataDetails:ee,propertyId:te}=e;n.useEffect(()=>{L&&U&&U.revalidate&&U.revalidate()},[L]);const ne=a.useQueryClient(),le=()=>{y(null),b(!1)};return console.log("ActionsInPayment2",U),M||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,M?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(bl,{applicationDetails:w,demandData:O,id:H,workflowDetails:U,isDataLoading:B,applicationData:k,totalDemandTax:x,totalBalanceTax:R,businessService:W,timelineStatusPrefix:K,statusAttribute:Y,paymentsList:$,showTimeLine:X,oldValue:J,isInfoLabel:Q,propertyId:te,moduleCode:z}),_?l.createElement(Kn,{t:p,action:h,tenantId:c,state:v,id:E,applicationDetails:w,applicationData:null==w?void 0:w.applicationData,closeModal:le,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,s,c,v,m,E,g,S,y,_,b,A,N,T){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.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===(g=E[0])||void 0===g||null===(S=g.comment)||void 0===S?void 0:S.length))||0==(null==e||null===(y=e.WaterConnection)||void 0===y||null===(_=y.comment)||void 0===_?void 0:_.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(A=b.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(N=e.BPA)||void 0===N||null===(T=N.comment)||void 0===T?void 0:T.length)){var I,w;"INITIATE"===(null==e||null===(I=e.Licenses)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;F&&(C(!0),F(e,{onError:(e,t)=>{C(!1),P({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,d;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var u,s,c,v,m,E,g,S;null!=t&&null!==(u=t.AmendmentUpdate)&&void 0!==u&&null!==(s=u.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(S=g.workflow)&&void 0!==S&&S.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var y,_,b;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(d=e.Licenses[0])&&void 0!==d&&d.applicationNumber)return null!=e&&null!==(y=e.Licenses[0])&&void 0!==y&&null!==(_=y.businessService)&&void 0!==_&&_.includes("BPAREG")?(P({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(b=e.Licenses[0])||void 0===b?void 0:b.applicationNumber)));P({key:"success",action:h}),ee&&setTimeout(ee,3e3),setTimeout(j,5e3);try{const e=(W||"").toUpperCase(),t=((null==h?void 0:h.action)||"").toUpperCase();e.includes("DISCONNECT")&&(t.includes("APPROVE")||t.includes("EXECUTE")||t.includes("APPROVE_CONNECTION"))&&setTimeout(()=>{var e;null!==(e=window)&&void 0!==e&&e.location&&(window.location.href="https://mseva.lgpunjab.gov.in/employee/inbox")},3e3)}catch(e){}ne.clear(),ne.refetchQueries("APPLICATION_SEARCH")}}})),le()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(d({},e)));const i=function(){if(!1!==t&&V){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==V?void 0:V.mutateAsync(e)),i=D(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,d,u,s,c,v,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(d=r.Errors)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;le(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:W,workflowDetails:U,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,N?l.createElement(Tl,{action:h,workflowDetails:U,businessService:W,isWarningPop:N,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(Dl,{t:p,showToast:L,closeToast:j,businessService:W}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==k?void 0:k.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==I||null===(t=I.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==w||null===(n=w.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==w||null===(o=w.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),d={BPA:e.BPA[0]};d.BPA.riskType=r,d.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const u=function(e,t,n,l,i,o,a,r,u,s,v,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==d||null===(e=d.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==d||null===(l=d.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==d||null===(a=d.BPA)||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==d||null===(s=d.BPA)||void 0===s||null===(v=s.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(d,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(u&&u.then)return u.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Al,{workflowDetails:U,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 i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,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 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))b(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:d({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else b(!0);y(e),S(!1)},setDisplayMenu:S,businessService:W,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:Z}))))},wl=["tenantId","payments"];var Ol=l.memo(()=>{var e,a,r,s,c,v,m,p,f,E,g,S;const{t:h}=i.useTranslation(),{data:y}=Digit.Hooks.useStore.getInitData(),_=Digit.ULBService.getCurrentTenantId(),{tenants:b}=y||{},{id:D}=o.useParams(),[A,C]=n.useState(null),[N,T]=n.useState({}),[I,w]=n.useState(!1);let O=!1;window.location.href.includes("applicationsearch")&&(O=!0);const{isLoading:x,data:R}=Digit.Hooks.sv.useSVApplicationDetail(h,_,D,!1),{mutate:L}=Digit.Hooks.sv.useSVApplicationAction(_);let P=Digit.Hooks.useWorkflowDetails({tenantId:(null==R||null===(e=R.applicationData)||void 0===e?void 0:e.tenantId)||_,id:null==R||null===(a=R.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.applicationNo,moduleCode:"street-vending",role:"SV_CEMP"});var M,B;n.useEffect(()=>{R&&T(G.cloneDeep(R))},[R]),!Digit.UserService.hasAccess(["SVCEMP"])||"street-vending"!==(null==P||null===(s=P.data)||void 0===s?void 0:s.applicationBusinessService)||null==P||null===(c=P.data)||void 0===c||null===(v=c.actionState)||void 0===v||null===(m=v.nextActions)||void 0===m||!m.find(e=>"PAY"===e.action)||(P.data.actionState.nextActions=null==P||null===(M=P.data)||void 0===M||null===(B=M.actionState)||void 0===B?void 0:B.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"SV_PAY",redirectionUrl:{pathname:"/digit-ui/employee/payment/collect/sv-services/"+(null==N||null===(t=N.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNo)}}:e}));let k=[{order:1,label:h("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=null==N?void 0:N.applicationData,t=b.find(t=>t.code===e.tenantId);return Promise.resolve($(e.applicationData,t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:F,isLoading:V}=Digit.Hooks.useRecieptSearch({tenantId:_,businessService:"sv-services",consumerCodes:null==N||null===(p=N.applicationData)||void 0===p||null===(f=p.applicationData)||void 0===f?void 0:f.applicationNo,isEmployee:!1},{enabled:!(null==N||null===(E=N.applicationData)||void 0===E||null===(g=E.applicationData)||void 0===g||!g.applicationNo)});return F&&(null==F?void 0:F.Payments.length)>0&&0==V&&k.push({label:h("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;u(e,wl);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[d({},n)]},"svservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==F||null===(e=F.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==F?void 0:F.Payments[0]})}}),F&&(null==F?void 0:F.Payments.length)>0&&0==V&&k.push({label:h("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(_,{SVDetail:[null==R||null===(e=R.applicationData)||void 0===e?void 0:e.applicationData]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(_,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),F&&(null==F?void 0:F.Payments.length)>0&&0==V&&k.push({label:h("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(_,{SVDetail:[null==R||null===(e=R.applicationData)||void 0===e?void 0:e.applicationData]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(_,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},h("SV_APPLICATION_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},k&&k.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>w(!I),displayOptions:I,options:k,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(Il,{isAction:O,applicationDetails:null==N?void 0:N.applicationData,isLoading:x,isDataLoading:x,applicationData:null==N||null===(S=N.applicationData)||void 0===S?void 0:S.applicationData,mutate:L,workflowDetails:P,businessService:"street-vending",moduleCode:"sv-services",showToast:A,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"SV_",forcedActionPrefix:"SV",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const xl=e=>{var a,r,d;let{application:u,buttonLabel:s,previousDraftId:c,onDiscard:v}=e;const{t:m}=i.useTranslation(),p=o.useHistory(),[f,E]=n.useState(null);n.useEffect(()=>{if(f){const e=setTimeout(()=>{E(null)},2e3);return()=>clearTimeout(e)}},[f]);const g=!(null!=u&&null!==(a=u.applicationNo)&&void 0!==a&&a.length);return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:m("SV_APPLICATION_NUMBER"),note:null==u?void 0:u.applicationNo}),l.createElement(t.KeyNote,{keyValue:m("SV_VENDOR_NAME"),note:null==u||null===(r=u.vendorDetail)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.name}),l.createElement(t.KeyNote,{keyValue:m("SV_VENDING_TYPE"),note:null==u?void 0:u.vendingActivity}),l.createElement(t.KeyNote,{keyValue:m("SV_VENDING_ZONES"),note:null==u?void 0:u.vendingZone}),"STATIONARY"===(null==u?void 0:u.vendingActivity)&&l.createElement(t.KeyNote,{keyValue:m("SV_AREA_REQUIRED"),note:null==u?void 0:u.vendingArea}),"CITIZENACTIONREQUIRED"==(null==u?void 0:u.applicationStatus)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:m("SV_EDIT"),onSubmit:()=>{var e,t,n,l,i,o,a,r,d;sessionStorage.setItem("vendingApplicationID",null==u?void 0:u.applicationNo),sessionStorage.setItem("ApplicationId",null==u?void 0:u.applicationId),sessionStorage.setItem("applicationStatus",null==u?void 0:u.applicationStatus),sessionStorage.setItem("addressIdOne",null==u||null===(e=u.addressDetails)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.addressId),sessionStorage.setItem("addressIdTwo",null==u||null===(n=u.addressDetails)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.addressId),sessionStorage.setItem("vendorIds",null==u||null===(i=u.addressDetails)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.vendorId),sessionStorage.setItem("bankIds",null==u||null===(a=u.bankDetail)||void 0===a?void 0:a.id),sessionStorage.setItem("venId",null==u||null===(r=u.vendorDetail)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.id),p.push("/digit-ui/citizen/sv/edit")}}),l.createElement("div",{style:{display:"flex",gap:"5px"}},l.createElement(o.Link,{to:g?"/digit-ui/citizen/sv/apply/info":"/digit-ui/citizen/sv/application/"+(null==u?void 0:u.applicationNo)+"/"+(null==u?void 0:u.tenantId)},l.createElement(t.SubmitBar,{label:g?m("SV_CONTINUE"):s})),g&&l.createElement(t.SubmitBar,{label:m("SV_DISCARD"),onSubmit:function(){try{const e=D(function(){return Promise.resolve(Digit.SVService.deleteDraft({filters:{draftId:c}})).then(function(){E({error:!1,label:m("SV_DISCARD_MESSAGE")}),v&&v(u)})},function(e){console.error("Error discarding application:",e),E({error:!0,label:m("SV_DISCARD_ERROR")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),l.createElement("div",null,f&&l.createElement(t.Toast,{error:f.error,warning:f.warning,label:m(f.label),onClose:()=>{E(null)}})))},Rl=e=>{var n,o,a;let{data:r,OpenImage:d}=e;const{t:u}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Reason,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,u("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)},Ll=e=>{var a,r,d,u,s,c;const{t:v}=i.useTranslation(),m=null==e||null===(a=e.application)||void 0===a||null===(r=a.workflow)||void 0===r?void 0:r.businessService,{isLoading:p,data:f}=Digit.Hooks.useWorkflowDetails({tenantId:null===(d=e.application)||void 0===d?void 0:d.tenantId,id:e.id,moduleCode:m});function E(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const g=t=>{if("OPEN"===t.state){var n,i;const o={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return l.createElement(Rl,{data:o})}if(t.state){var o,a,r,d,u;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name,mobileNumber:null==t||null===(d=t.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(Rl,{data:e,OpenImage:E})}{var s,c;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(c=t.assigner)||void 0===c?void 0:c.name,comment:v(null==t?void 0:t.comment)};return l.createElement(Rl,{data:n})}};return p?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!p&&l.createElement(n.Fragment,null,(null==f||null===(u=f.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=f&&f.timeline&&1===(null==f||null===(s=f.timeline)||void 0===s?void 0:s.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:v((null==f||null===(c=f.timeline[0])||void 0===c?void 0:c.state)&&"WF_"+m+"_"+f.timeline[0].state||"NA"),customChild:g(null==f?void 0:f.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==f?void 0:f.timeline)&&(null==f?void 0:f.timeline.map((e,n,i)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:v("SV_"+(null==f||null===(o=f.processInstances[n].state)||void 0===o?void 0:o.state)),customChild:g(e)}))})))),f&&(n=>{var i,a,r;let d=n[0];const u=n.map(e=>e.action);if(u.includes("PAY")||u.includes("EDIT")){let e=u.indexOf("EDIT")||u.indexOf("PAY");e=-1!=e?e:u.indexOf("PAY"),d=n[e]}switch(null===(i=d)||void 0===i?void 0:i.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/sv-services/"+(null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNo),state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(r=e.application)||void 0===r?void 0:r.applicationNo}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==f?void 0:f.nextActions))};var Pl=function(e){return"symbol"==typeof e||dt(e)&&"[object Symbol]"==Be(e)},Ml=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bl=/^\w*$/;function kl(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(kl.Cache||et),n}kl.Cache=et;var Fl,Vl,Ul=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hl=/\\(\\)?/g,Wl=(Fl=kl(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ul,function(e,n,l,i){t.push(l?i.replace(Hl,"$1"):n||e)}),t},function(e){return 500===Vl.size&&Vl.clear(),e}),Vl=Fl.cache,Fl),jl=we?we.prototype:void 0,zl=jl?jl.toString:void 0,Kl=function(e){if("string"==typeof e||Pl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const Gl=["tenantId","payments"],Yl={Create:e=>{var t,n,r,u,c,v;const m=a.useQueryClient(),p=o.useRouteMatch(),{t:f}=i.useTranslation(),{pathname:E}=o.useLocation(),g=o.useHistory();Digit.ULBService.getStateId();let S=[];const[h,y,_]=Digit.Hooks.useSessionStorage("SV_CREATES",{}),b=sessionStorage.getItem("vendingApplicationID")?sessionStorage.getItem("vendingApplicationID"):null,{data:D}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{applicationNumber:b,isDraftApplication:!1},enabled:!!b}),A=null==D||null===(t=D.SVDetail)||void 0===t?void 0:t[0],{data:C}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{isDraftApplication:!0}}),N=null==C||null===(n=C.SVDetail)||void 0===n?void 0:n[0];function T(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=h.owners||[];n[l]=t,y(d({},h,{[e]:[...n]}))}else if("units"===e){let e=h.units||[];e=t,y(d({},h,{units:e}))}else y(d({},h,{[e]:d({},h[e],t)}));((e,t,n,l)=>{let i,o=E.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=E.slice(0,-3),o=o.split("/").pop(),r=!0):(o=E.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:d={}}=S.find(e=>e.route===o),u=g.push;if(e&&(u=g.replace),n&&(d=l),null===d)return u(p.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?p.path+"/"+d+"/"+t:p.path+"/"+d,u(i)})(n,l,i,e)}h&&Object.keys(h).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(_(),m.invalidateQueries("SV_CREATES"));const I=()=>{},w=()=>{};s.forEach(e=>{S=S.concat(e.body.filter(e=>!e.hideInCitizen))}),S.indexRoute="info";const O=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("CheckPage"),x=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,S.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,d="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n,u=Digit.UserService.getUser().info.type;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(d,{config:{texts:i,inputs:a,key:r},onSelect:T,onSkip:I,t:f,formData:h,onAdd:w,userType:u,editdata:E.includes("apply")?{}:A,previousData:N}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(O,{onSubmit:function(){try{return g.replace(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:h,editdata:E.includes("apply")?{}:A})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(x,{data:h,onSuccess:()=>{_(),m.invalidateQueries("SV_CREATES"),sessionStorage.removeItem("CategoryDocument"),sessionStorage.removeItem("vendingApplicationID"),sessionStorage.removeItem("ApplicationId"),sessionStorage.removeItem("applicationStatus"),sessionStorage.removeItem("Response"),sessionStorage.removeItem("addressIdOne"),sessionStorage.removeItem("addressIdTwo"),sessionStorage.removeItem("vendorIds"),sessionStorage.removeItem("bankIds"),sessionStorage.removeItem("venId")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+S.indexRoute})))},SVApplicantDetails:e=>{var i,o,a,u,s,c,v,m,f,E,g,S,h,y,_,b,D,A,C,N,T,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he,ye,_e,be,De,Ae,Ce,Ne,Te,Ie,we,Oe,xe,Re,Le,Pe,Me,Be,ke,Fe,Ve,Ue,He,We,je,ze,Ke,Ge,Ye,qe;let{t:Ze,config:$e,onSelect:Xe,formData:Je,editdata:Qe,previousData:et}=e,tt={};const nt=Digit.UserService.getUser().info,lt=e=>{if(!e)return null;switch(e.toUpperCase()){case"M":return{i18nKey:"MALE",code:"MALE",value:"Male"};case"F":return{i18nKey:"FEMALE",code:"FEMALE",value:"Female"};case"O":return{i18nKey:"OTHERS",code:"OTHERS",value:"Others"};default:return null}},[it,ot]=n.useState((null==Je||null===(i=Je.owner)||void 0===i||null===(o=i.units)||void 0===o?void 0:o.vendorName)||(null==Je||null===(a=Je.owner)||void 0===a?void 0:a.vendorName)||""),[at,rt]=n.useState((null==Je||null===(u=Je.owner)||void 0===u||null===(s=u.units)||void 0===s?void 0:s.userCategory)||(null==Je||null===(c=Je.owner)||void 0===c?void 0:c.userCategory)||""),[dt,ut]=n.useState((null==Je||null===(v=Je.owner)||void 0===v||null===(m=v.units)||void 0===m?void 0:m.vendorDateOfBirth)||(null==Je||null===(f=Je.owner)||void 0===f?void 0:f.vendorDateOfBirth)||""),[st,ct]=n.useState((null==Je||null===(E=Je.owner)||void 0===E||null===(g=E.units)||void 0===g?void 0:g.gender)||(null==Je||null===(S=Je.owner)||void 0===S?void 0:S.gender)||""),[vt,mt]=n.useState((null==Qe||null===(h=Qe.vendorDetail)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.fatherName)||(null==Je||null===(_=Je.owner)||void 0===_||null===(b=_.units)||void 0===b?void 0:b.fatherName)||(null==Je||null===(D=Je.owner)||void 0===D?void 0:D.fatherName)||""),[pt,ft]=n.useState((null==Je||null===(A=Je.owner)||void 0===A||null===(C=A.units)||void 0===C?void 0:C.spouseName)||(null==Je||null===(N=Je.owner)||void 0===N?void 0:N.spouseName)||""),[Et,gt]=n.useState(!1),[St,ht]=n.useState((null==Je||null===(T=Je.owner)||void 0===T||null===(I=T.units)||void 0===I?void 0:I.mobileNumber)||(null==Je||null===(w=Je.owner)||void 0===w?void 0:w.mobileNumber)||""),[yt,_t]=n.useState((null==Je||null===(O=Je.owner)||void 0===O||null===(x=O.units)||void 0===x?void 0:x.spouseDateBirth)||(null==Je||null===(R=Je.owner)||void 0===R?void 0:R.spouseDateBirth)||""),[bt,Dt]=n.useState((null==Je||null===(L=Je.owner)||void 0===L||null===(P=L.units)||void 0===P?void 0:P.dependentName)||(null==Je||null===(M=Je.owner)||void 0===M?void 0:M.dependentName)||""),[At,Ct]=n.useState((null==Je||null===(B=Je.owner)||void 0===B||null===(k=B.units)||void 0===k?void 0:k.dependentDateBirth)||(null==Je||null===(F=Je.owner)||void 0===F?void 0:F.dependentDateBirth)||""),[Nt,Tt]=n.useState((null==Je||null===(V=Je.owner)||void 0===V||null===(U=V.units)||void 0===U?void 0:U.dependentGender)||(null==Je||null===(H=Je.owner)||void 0===H?void 0:H.dependentGender)||""),[It,wt]=n.useState((null==Je||null===(W=Je.owner)||void 0===W||null===(j=W.units)||void 0===j?void 0:j.email)||(null==Je||null===(z=Je.owner)||void 0===z?void 0:z.email)||""),[Ot,xt]=n.useState((null==Je||null===(K=Je.owner)||void 0===K||null===(G=K.units)||void 0===G?void 0:G.tradeNumber)||(null==Je||null===(Y=Je.owner)||void 0===Y?void 0:Y.tradeNumber)||""),[Rt,Lt]=n.useState(null),[Pt,Mt]=n.useState((null==Je||null===(q=Je.owner)||void 0===q?void 0:q.spouseDependentChecked)||!1),[Bt,kt]=n.useState((null==Je||null===(Z=Je.owner)||void 0===Z?void 0:Z.dependentNameChecked)||!1),Ft="EMPLOYEE"===nt.type?"50%":"86%",[Vt,Ut]=n.useState(null),{control:Ht}=r.useForm(),[Wt,jt]=n.useState((null==Je?void 0:Je.owner)&&(null==Je||null===($=Je.owner)||void 0===$?void 0:$.units)||[{vendorName:(null==et||null===(X=et.vendorDetail)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.name)||(null==Qe||null===(Q=Qe.vendorDetail)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.name)||("CITIZEN"===(null==nt?void 0:nt.type)?null==nt?void 0:nt.name:"")||"",userCategory:(e=>e?{i18nKey:e,code:e,value:e}:null)((null==et||null===(te=et.vendorDetail)||void 0===te||null===(ne=te[0])||void 0===ne?void 0:ne.userCategory)||(null==Qe||null===(le=Qe.vendorDetail)||void 0===le||null===(ie=le[0])||void 0===ie?void 0:ie.userCategory))||"",vendorDateOfBirth:(null==et||null===(oe=et.vendorDetail)||void 0===oe||null===(ae=oe[0])||void 0===ae?void 0:ae.dob)||(null==Qe||null===(re=Qe.vendorDetail)||void 0===re||null===(de=re[0])||void 0===de?void 0:de.dob)||"",gender:lt((null==et||null===(ue=et.vendorDetail)||void 0===ue||null===(se=ue[0])||void 0===se?void 0:se.gender)||(null==Qe||null===(ce=Qe.vendorDetail)||void 0===ce||null===(ve=ce[0])||void 0===ve?void 0:ve.gender))||"",fatherName:(null==et||null===(me=et.vendorDetail)||void 0===me||null===(pe=me[0])||void 0===pe?void 0:pe.fatherName)||(null==Qe||null===(fe=Qe.vendorDetail)||void 0===fe||null===(Ee=fe[0])||void 0===Ee?void 0:Ee.fatherName)||"",spouseName:(null==et||null===(ge=et.vendorDetail)||void 0===ge||null===(Se=ge[1])||void 0===Se?void 0:Se.name)||(null==Qe||null===(he=Qe.vendorDetail)||void 0===he||null===(ye=he[1])||void 0===ye?void 0:ye.name)||"",mobileNumber:(null==et||null===(_e=et.vendorDetail)||void 0===_e||null===(be=_e[0])||void 0===be?void 0:be.mobileNo)||(null==Qe||null===(De=Qe.vendorDetail)||void 0===De||null===(Ae=De[0])||void 0===Ae?void 0:Ae.mobileNo)||("CITIZEN"===(null==nt?void 0:nt.type)?null==nt?void 0:nt.mobileNumber:"")||"",spouseDateBirth:(null==et||null===(Ce=et.vendorDetail)||void 0===Ce||null===(Ne=Ce[1])||void 0===Ne?void 0:Ne.dob)||(null==Qe||null===(Te=Qe.vendorDetail)||void 0===Te||null===(Ie=Te[1])||void 0===Ie?void 0:Ie.dob)||"",dependentName:(null==et||null===(we=et.vendorDetail)||void 0===we||null===(Oe=we[2])||void 0===Oe?void 0:Oe.name)||(null==Qe||null===(xe=Qe.vendorDetail)||void 0===xe||null===(Re=xe[2])||void 0===Re?void 0:Re.name)||"",dependentDateBirth:(null==et||null===(Le=et.vendorDetail)||void 0===Le||null===(Pe=Le[2])||void 0===Pe?void 0:Pe.dob)||(null==Qe||null===(Me=Qe.vendorDetail)||void 0===Me||null===(Be=Me[2])||void 0===Be?void 0:Be.dob)||"",dependentGender:lt((null==et||null===(ke=et.vendorDetail)||void 0===ke||null===(Fe=ke[2])||void 0===Fe?void 0:Fe.gender)||(null==Qe||null===(Ve=Qe.vendorDetail)||void 0===Ve||null===(Ue=Ve[2])||void 0===Ue?void 0:Ue.gender))||"",email:(null==et||null===(He=et.vendorDetail)||void 0===He||null===(We=He[0])||void 0===We?void 0:We.emailId)||(null==Qe||null===(je=Qe.vendorDetail)||void 0===je||null===(ze=je[0])||void 0===ze?void 0:ze.emailId)||("CITIZEN"===(null==nt?void 0:nt.type)?null==nt?void 0:nt.emailId:"")||"",tradeNumber:(null==et||null===(Ke=et.vendorDetail)||void 0===Ke||null===(Ge=Ke[0])||void 0===Ge?void 0:Ge.tradeNumber)||(null==Qe||null===(Ye=Qe.vendorDetail)||void 0===Ye||null===(qe=Ye[0])||void 0===qe?void 0:qe.tradeNumber)||""}]),zt=e=>{""===e||/^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/.test(e)?Lt(""):Lt(Ze("CORE_INVALID_EMAIL_ID_PATTERN"))},{data:Kt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"Category"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.Category}});let Gt=[];Kt&&Kt.map(e=>{Gt.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Yt=(e,t)=>!(e&&(e=>{const t=new Date,n=new Date(e);let l=t.getFullYear()-n.getFullYear();const i=t.getMonth()-n.getMonth();return(i<0||0===i&&t.getDate()<n.getDate())&&l--,l})(e)<18&&(Ut({error:!0,label:Ze({vendor:"VENDOR_AGE_ERROR",spouse:"SPOUSE_AGE_ERROR",dependent:"DEPENDENT_AGE_ERROR"}[t])}),1));n.useEffect(()=>{if(Vt){const e=setTimeout(()=>{Ut(null)},2e3);return()=>clearTimeout(e)}},[Vt]);const qt=[{code:"MALE",i18nKey:"MALE",value:"Male"},{code:"FEMALE",i18nKey:"FEMALE",value:"Female"},{code:"OTHERS",i18nKey:"OTHERS",value:"Others"}],Zt=()=>{Mt(!Pt)},$t=()=>{kt(!Bt)};return n.useEffect(()=>{It&&zt(It)},[It]),l.createElement(l.Fragment,null,l.createElement(p,{currentStep:1}),l.createElement(t.FormStep,{config:$e,onSelect:()=>{const e=Yt(Wt[0].vendorDateOfBirth,"vendor"),t=!Pt||Yt(Wt[0].spouseDateBirth,"spouse"),n=!Bt||Yt(Wt[0].dependentDateBirth,"dependent");if(!e||!t||!n)return;let l=d({},Je.owner||{},{units:Wt,spouseDependentChecked:Pt,dependentNameChecked:Bt});Xe($e.key,d({},Je[$e.key],l),!1),!window.location.href.includes("edit")&&(()=>{var e,t,n;let l=[],i=Digit.ULBService.getCitizenCurrentTenant(!0);const o=e=>{var t,n,l,i,o,a,r,d,u;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e[0])||void 0===t?void 0:t.vendorDateOfBirth,userCategory:null==e||null===(n=e[0])||void 0===n||null===(l=n.userCategory)||void 0===l?void 0:l.code,emailId:null==e||null===(i=e[0])||void 0===i?void 0:i.email,fatherName:null==e||null===(o=e[0])||void 0===o?void 0:o.fatherName,gender:null==e||null===(a=e[0])||void 0===a||null===(r=a.gender)||void 0===r?void 0:r.code.charAt(0),id:"",mobileNo:null==e||null===(d=e[0])||void 0===d?void 0:d.mobileNumber,name:null==e||null===(u=e[0])||void 0===u?void 0:u.vendorName,relationshipType:"VENDOR",vendorId:null}},a=e=>{var t,n,l,i;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e[1])||void 0===t?void 0:t.spouseDateBirth,userCategory:null==e||null===(n=e[1])||void 0===n||null===(l=n.userCategory)||void 0===l?void 0:l.code,emailId:"",isInvolved:null==e?void 0:e.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(i=e[1])||void 0===i?void 0:i.spouseName,relationshipType:"SPOUSE",vendorId:null}},r=e=>{var t,n,l,i,o,a;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e[2])||void 0===t?void 0:t.dependentDateBirth,userCategory:null==e||null===(n=e[2])||void 0===n||null===(l=n.userCategory)||void 0===l?void 0:l.code,emailId:"",isInvolved:null==e?void 0:e.dependentNameChecked,fatherName:"",gender:null==e||null===(i=e[2])||void 0===i||null===(o=i.dependentGender)||void 0===o?void 0:o.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(a=e[2])||void 0===a?void 0:a.dependentName,relationshipType:"DEPENDENT",vendorId:null}},d=e=>!e||""===e.trim();if(!d(null==Wt||null===(e=Wt[0])||void 0===e?void 0:e.vendorName)){var u,s;const e=null==Wt||null===(u=Wt[0])||void 0===u?void 0:u.spouseName,t=null==Wt||null===(s=Wt[0])||void 0===s?void 0:s.dependentName;d(e)&&d(t)?l=[o(Wt)]:!d(e)&&d(t)?l=[o(Wt),a(Wt)]:d(e)||d(t)||(l=[o(Wt),a(Wt),r(Wt)])}const c=sessionStorage.getItem("Response"),v=c?JSON.parse(c):null;let m={addressDetails:[{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:""},{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:"",isAddressSame:""}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:"",accountNumber:"",applicationId:"",bankBranchName:"",bankName:"",id:"",ifscCode:"",refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==et?void 0:et.draftId)||(null==v||null===(t=v.SVDetail)||void 0===t?void 0:t.draftId)||"",documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:"",tenantId:i,termsAndCondition:"Y",tradeLicenseNo:null==Wt||null===(n=Wt[0])||void 0===n?void 0:n.tradeNumber,vendingActivity:"",vendingArea:"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:"MONDAY",fromTime:"09:00",id:"",toTime:"09:00"}],vendingZone:"",vendorDetail:[...l],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:m,draftApplication:!0},i).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()},onSkip:()=>Xe(),t:Ze,isDisabled:!Wt[0].vendorName||!Wt[0].userCategory||!Wt[0].vendorDateOfBirth||!Wt[0].gender||!Wt[0].fatherName||Pt&&!Wt[0].spouseName||Bt&&!Wt[0].dependentName},Wt.map((e,n)=>l.createElement("div",{key:e+"-"+n},l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement(t.CardLabel,null,""+Ze("SV_VENDOR_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:{float:"right",position:"relative",bottom:"32px"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z",fill:1!=Wt.length?"#494848":"#FAFAFA"})))),style:{width:"100px",display:"inline"},onClick:e=>function(e){const t=[...Wt];1!=t.length&&(t.splice(e,1),jt(t))}(n)}),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vendorName",value:null==e?void 0:e.vendorName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].vendorName=t.target.value,ot(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:!0},tt={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")})),l.createElement(t.CardLabel,null,""+Ze("SV_OWNER_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:Ht,name:"userCategory-"+n,defaultValue:at,rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG")},render:i=>l.createElement(t.Dropdown,{className:"form-field",style:{width:"100%"},selected:null==e?void 0:e.userCategory,select:e=>function(e,t){let n=[...Wt];n[e].userCategory=t,rt(t),jt(n)}(n,e),option:Gt,optionKey:"i18nKey",t:Ze,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Ze("SV_REGISTERED_MOB_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.MobileNumber,{style:{background:"#FAFAFA"},value:null==e?void 0:e.mobileNumber,name:"mobileNumber",onChange:e=>function(e,t){let n=[...Wt];n[e].mobileNumber=t,ht(t),jt(n)}(n,e),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:Ze("SV_INVALID_NUMBER")}),l.createElement(t.CardLabel,null,""+Ze("SV_EMAIL")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:null==e?void 0:e.email,onChange:e=>function(e,t){let n=[...Wt];n[e].email=t.target.value;const l=t.target.value;wt(t.target.value),zt(l),jt(n)}(n,e),disable:!1}),l.createElement(t.CardLabel,null,""+Ze("SV_DATE_OF_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"vendorDateOfBirth",value:null==e?void 0:e.vendorDateOfBirth,onChange:e=>function(e,t){let n=[...Wt];n[e].vendorDateOfBirth=t.target.value,ut(t.target.value),jt(n),Yt(t.target.value,"vendor")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||Ze("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+Ze("SV_GENDER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:Ze,options:qt,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"gender-"+n,value:null==e?void 0:e.gender,selectedOption:null==e?void 0:e.gender,onSelect:e=>function(e,t){let n=[...Wt];n[e].gender=t,ct(t),jt(n)}(n,e),labelKey:"i18nKey",isPTFlow:!0}),l.createElement(t.CardLabel,null,""+Ze("SV_FATHER_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",value:null==e?void 0:e.fatherName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].fatherName=t.target.value,mt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:!0},tt={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")}))),l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement("div",null,l.createElement("div",{style:{display:"flex",gap:"22px"}},l.createElement(t.CardLabel,null,""+Ze("SV_SPOUSE_NAME")," ",Pt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.CheckBox,{label:Ze("SV_INVOLVED_IN_VENDING"),onChange:Zt,checked:Pt})),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"spouseName",value:null==e?void 0:e.spouseName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].spouseName=t.target.value,ft(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:Pt},tt={isRequired:Pt,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")}))),l.createElement(t.CardLabel,null,""+Ze("SV_SPOUSE_DATE_OF_BIRTH")," ",Pt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"spouseDateBirth",value:null==e?void 0:e.spouseDateBirth,onChange:e=>function(e,t){let n=[...Wt];n[e].spouseDateBirth=t.target.value,_t(t.target.value),jt(n),Yt(t.target.value,"spouse")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||Ze("ERR_DEFAULT_INPUT_FIELD_MSG")}})),l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement("div",null,l.createElement("div",{style:{display:"flex",gap:"22px"}},l.createElement(t.CardLabel,null,""+Ze("SV_DEPENDENT_NAME")," ",Bt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.CheckBox,{label:Ze("SV_INVOLVED_IN_VENDING"),onChange:$t,checked:Bt})),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"dependentName",value:null==e?void 0:e.dependentName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].dependentName=t.target.value,Dt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:Bt},tt={isRequired:Bt,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")}))),l.createElement(t.CardLabel,null,""+Ze("SV_DEPENDENT_DATE_OF_BIRTH")," ",Bt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"dependentDateBirth",value:null==e?void 0:e.dependentDateBirth,onChange:e=>function(e,t){let n=[...Wt];n[e].dependentDateBirth=t.target.value,Ct(t.target.value),jt(n),Yt(t.target.value,"dependent")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||Ze("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+Ze("SV_DEPENDENT_GENDER")," ",Bt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:Ze,options:qt,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"dependentGender-"+n,value:null==e?void 0:e.dependentGender,selectedOption:null==e?void 0:e.dependentGender,onSelect:e=>function(e,t){let n=[...Wt];n[e].dependentGender=t,Tt(t),jt(n)}(n,e),labelKey:"i18nKey",isPTFlow:!0})),l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement(t.CardLabel,null,""+Ze("SV_TRADE_NUMBER")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"tradeNumber",value:null==e?void 0:e.tradeNumber,onChange:e=>function(e,t){let n=[...Wt];n[e].tradeNumber=t.target.value,xt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:!0},tt={isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")})),l.createElement("div",{className:"astericColor",style:{display:"flex",paddingBottom:"15px",color:"#FF8C00",marginTop:"10px"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>function(){const e=[...Wt];e.push({vendorName:"",userCategory:"",vendorDateOfBirth:"",gender:"",fatherName:"",spouseName:"",mobileNumber:"",spouseDateBirth:"",dependentName:"",dependentDateBirth:"",dependentGender:"",email:"",tradeNumber:""}),jt(e)}()},""+Ze("SV_ADD_DEPENDENT")))),l.createElement("br",null)))),Vt&&l.createElement(t.Toast,{error:Vt.error,warning:Vt.warning,label:Ze(Vt.label),onClose:()=>{Ut(null)}}))},SVBusinessDetails:e=>{var i,o,a,u,s,c,v,m,f,E,g,S,h,_,D,A,C,N,T,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he,ye,_e,be;let{t:De,config:Ae,onSelect:Ce,userType:Ne,formData:Te,editdata:Ie,previousData:we}=e,Oe={};const xe=Digit.UserService.getUser().info,Re=e=>e?{i18nKey:e,code:e,value:e}:null,[Le,Pe]=n.useState((null==Te||null===(i=Te.businessDetails)||void 0===i?void 0:i.vendingType)||Re((null==we?void 0:we.vendingActivity)||(null==Ie?void 0:Ie.vendingActivity))||(null==Te||null===(o=Te.businessDetails)||void 0===o?void 0:o.vendingType)||""),[Me,Be]=n.useState((null==Te||null===(a=Te.businessDetails)||void 0===a?void 0:a.vendingZones)||Re((null==we?void 0:we.vendingZone)||(null==Ie?void 0:Ie.vendingZone))||""),[ke,Fe]=n.useState((null==Te||null===(u=Te.businessDetails)||void 0===u?void 0:u.location)||""),[Ve,Ue]=n.useState((null==Te||null===(s=Te.businessDetails)||void 0===s?void 0:s.areaRequired)||(null==we?void 0:we.vendingArea)||(null==Ie?void 0:Ie.vendingArea)||""),[He,We]=n.useState((null==Te||null===(c=Te.businessDetails)||void 0===c?void 0:c.nameOfAuthority)||(null==we?void 0:we.localAuthorityName)||(null==Ie?void 0:Ie.localAuthorityName)||""),[je,ze]=n.useState((null==Te||null===(v=Te.businessDetails)||void 0===v?void 0:v.vendingLiscence)||(null==we?void 0:we.vendingLiscence)||(null==Ie?void 0:Ie.vendingLiscence)||""),Ke={width:"EMPLOYEE"===xe.type?"50%":"86%"},[Ge,Ye]=n.useState(null),[qe,Ze]=n.useState(7===(null==we||null===(m=we.vendingOperationTimeDetails)||void 0===m?void 0:m.length)||7===(null==Ie||null===(f=Ie.vendingOperationTimeDetails)||void 0===f?void 0:f.length)||(null==Te||null===(E=Te.businessDetails)||void 0===E?void 0:E.isSameForAll)),[$e,Xe]=n.useState((null==Te||null===(g=Te.businessDetails)||void 0===g?void 0:g.daysOfOperation)||[{name:"Monday",isSelected:!1,startTime:(null==we||null===(S=we.vendingOperationTimeDetails)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.fromTime)||(null==Ie||null===(_=Ie.vendingOperationTimeDetails)||void 0===_||null===(D=_[0])||void 0===D?void 0:D.fromTime)||"",endTime:(null==we||null===(A=we.vendingOperationTimeDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.toTime)||(null==Ie||null===(N=Ie.vendingOperationTimeDetails)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.toTime)||""},{name:"Tuesday",isSelected:!1,startTime:(null==we||null===(I=we.vendingOperationTimeDetails)||void 0===I||null===(w=I[1])||void 0===w?void 0:w.fromTime)||(null==Ie||null===(O=Ie.vendingOperationTimeDetails)||void 0===O||null===(x=O[1])||void 0===x?void 0:x.fromTime)||"",endTime:(null==we||null===(R=we.vendingOperationTimeDetails)||void 0===R||null===(L=R[1])||void 0===L?void 0:L.toTime)||(null==Ie||null===(P=Ie.vendingOperationTimeDetails)||void 0===P||null===(M=P[1])||void 0===M?void 0:M.toTime)||""},{name:"Wednesday",isSelected:!1,startTime:(null==we||null===(B=we.vendingOperationTimeDetails)||void 0===B||null===(k=B[2])||void 0===k?void 0:k.fromTime)||(null==Ie||null===(F=Ie.vendingOperationTimeDetails)||void 0===F||null===(V=F[2])||void 0===V?void 0:V.fromTime)||"",endTime:(null==we||null===(U=we.vendingOperationTimeDetails)||void 0===U||null===(H=U[2])||void 0===H?void 0:H.toTime)||(null==Ie||null===(W=Ie.vendingOperationTimeDetails)||void 0===W||null===(j=W[2])||void 0===j?void 0:j.toTime)||""},{name:"Thursday",isSelected:!1,startTime:(null==we||null===(z=we.vendingOperationTimeDetails)||void 0===z||null===(K=z[3])||void 0===K?void 0:K.fromTime)||(null==Ie||null===(G=Ie.vendingOperationTimeDetails)||void 0===G||null===(Y=G[3])||void 0===Y?void 0:Y.fromTime)||"",endTime:(null==we||null===(q=we.vendingOperationTimeDetails)||void 0===q||null===(Z=q[3])||void 0===Z?void 0:Z.toTime)||(null==Ie||null===($=Ie.vendingOperationTimeDetails)||void 0===$||null===(X=$[3])||void 0===X?void 0:X.toTime)||""},{name:"Friday",isSelected:!1,startTime:(null==we||null===(J=we.vendingOperationTimeDetails)||void 0===J||null===(Q=J[4])||void 0===Q?void 0:Q.fromTime)||(null==Ie||null===(ee=Ie.vendingOperationTimeDetails)||void 0===ee||null===(te=ee[4])||void 0===te?void 0:te.fromTime)||"",endTime:(null==we||null===(ne=we.vendingOperationTimeDetails)||void 0===ne||null===(le=ne[4])||void 0===le?void 0:le.toTime)||(null==Ie||null===(ie=Ie.vendingOperationTimeDetails)||void 0===ie||null===(oe=ie[4])||void 0===oe?void 0:oe.toTime)||""},{name:"Saturday",isSelected:!1,startTime:(null==we||null===(ae=we.vendingOperationTimeDetails)||void 0===ae||null===(re=ae[5])||void 0===re?void 0:re.fromTime)||(null==Ie||null===(de=Ie.vendingOperationTimeDetails)||void 0===de||null===(ue=de[5])||void 0===ue?void 0:ue.fromTime)||"",endTime:(null==we||null===(se=we.vendingOperationTimeDetails)||void 0===se||null===(ce=se[5])||void 0===ce?void 0:ce.toTime)||(null==Ie||null===(ve=Ie.vendingOperationTimeDetails)||void 0===ve||null===(me=ve[5])||void 0===me?void 0:me.toTime)||""},{name:"Sunday",isSelected:!1,startTime:(null==we||null===(pe=we.vendingOperationTimeDetails)||void 0===pe||null===(fe=pe[6])||void 0===fe?void 0:fe.fromTime)||(null==Ie||null===(Ee=Ie.vendingOperationTimeDetails)||void 0===Ee||null===(ge=Ee[6])||void 0===ge?void 0:ge.fromTime)||"",endTime:(null==we||null===(Se=we.vendingOperationTimeDetails)||void 0===Se||null===(he=Se[6])||void 0===he?void 0:he.toTime)||(null==Ie||null===(ye=Ie.vendingOperationTimeDetails)||void 0===ye||null===(_e=ye[6])||void 0===_e?void 0:_e.toTime)||""}]),[Je,Qe]=n.useState((null==Te||null===(be=Te.businessDetails)||void 0===be?void 0:be.backupDays)||[...$e]),et=()=>$e.some(e=>e.startTime,e=>e.endTime),tt=(e,t,n)=>{let l=[...$e];if(l[e][t]=n,l[e].isSelected=!(!l[e].startTime&&!l[e].endTime),qe){const{startTime:t,endTime:n}=l[e];l=l.map(e=>d({},e,{startTime:t,endTime:n}))}Xe(l)},nt=()=>{if(qe)Xe([...Je]);else{Qe([...$e]);const{startTime:e,endTime:t,isSelected:n}=$e.find(e=>e.startTime||e.endTime)||$e[0];Xe($e.map(l=>d({},l,{startTime:e,endTime:t,isSelected:n})))}Ze(!qe)},lt=[{id:"selection",Header:()=>l.createElement("div",{className:"SVTableHeader"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:qe,disabled:!et(),onChange:nt}),l.createElement("h4",{style:{marginLeft:"8px"}},De("SV_SELECT_ALL"))),Cell:()=>l.createElement("div",{className:"SVTableCells"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:qe,disabled:!0}))},{Header:De("SV_DAY"),accessor:"name"},{Header:De("SV_FROM_TIME"),accessor:"startTime",Cell:e=>{var n;let{row:i}=e;return l.createElement(t.TextInput,{style:{width:"126px"},type:"time",name:"startTime",value:(null===(n=$e[i.index])||void 0===n?void 0:n.startTime)||"",onChange:e=>tt(i.index,"startTime",e.target.value),placeholder:"Start Time"})}},{Header:De("SV_TO_TIME"),accessor:"endTime",Cell:e=>{var n;let{row:i}=e;return l.createElement(t.TextInput,{style:{width:"128px"},type:"time",name:"endTime",value:(null===(n=$e[i.index])||void 0===n?void 0:n.endTime)||"",onChange:e=>tt(i.index,"endTime",e.target.value),placeholder:"End Time"})}}],{control:it}=r.useForm(),[ot,at]=n.useState(!1),{data:rt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingActivityType"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingActivityType}});let dt=[];rt&&rt.map(e=>{dt.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:ut}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingZones"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingZones}});let st=[];ut&&ut.map(e=>{st.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const ct=()=>{if(!et())return void Ye({error:!0,label:De("SV_TIME_OPERATIONS_VALIDATION")});let e;e=d({},Te.businessDetails,{vendingType:Le,vendingZones:Me,location:ke,areaRequired:Ve,nameOfAuthority:He,vendingLiscence:je,daysOfOperation:$e,isSameForAll:qe,backupDays:Je}),Ce(Ae.key,e,!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a;let r=[],d=Digit.ULBService.getCitizenCurrentTenant(!0);const u=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},s=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},c=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},v=e=>!e||""===e.trim();if(!v(null==Te||null===(e=Te.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var m,p,f,E,g,S;const e=null==Te||null===(m=Te.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.spouseName,t=null==Te||null===(E=Te.owner)||void 0===E||null===(g=E.units)||void 0===g||null===(S=g[0])||void 0===S?void 0:S.dependentName;v(e)&&v(t)?r=[u(Te)]:!v(e)&&v(t)?r=[u(Te),s(Te)]:v(e)||v(t)||(r=[u(Te),s(Te),c(Te)])}const h=$e.filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),y=sessionStorage.getItem("Response"),_=JSON.parse(y);let b={addressDetails:[{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:""},{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:"",isAddressSame:""}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:"",accountNumber:"",applicationId:"",bankBranchName:"",bankName:"",id:"",ifscCode:"",refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==we?void 0:we.draftId)||(null==_||null===(l=_.SVDetail)||void 0===l?void 0:l.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:He,tenantId:d,termsAndCondition:"Y",tradeLicenseNo:null==Te||null===(i=Te.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tradeNumber,vendingActivity:null==Le?void 0:Le.code,vendingArea:Ve||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:h,vendingZone:null==Me?void 0:Me.code,vendorDetail:[...r],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:b,draftApplication:!0},d).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()};return n.useEffect(()=>{if(Ge){const e=setTimeout(()=>{Ye(null)},2e3);return()=>clearTimeout(e)}},[Ge]),n.useEffect(()=>{"citizen"===Ne&&ct()},[Le,Me,ke,Ve,He,je,$e]),l.createElement(l.Fragment,null,l.createElement(p,{currentStep:2}),l.createElement("div",null,ot&&l.createElement(y,{t:De,onSelect:Ce,formData:Te,handleRemove:()=>{at(!ot)},onSave:function(e){Fe(e),at(!1)}}),!ot&&l.createElement(t.FormStep,{config:Ae,onSelect:ct,onSkip:()=>Ce(),t:De,isDisabled:!Le||!Me||("STATIONARY"===(null==Le?void 0:Le.code)?!Ve:null)||!He||!$e},l.createElement("div",null,l.createElement(t.CardLabel,null,""+De("SV_VENDING_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:it,name:"vendingType",defaultValue:Le,rules:{required:De("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Le,select:Pe,option:dt,optionKey:"i18nKey",t:De,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+De("SV_VENDING_ZONES")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:it,name:"vendingZones",defaultValue:Me,rules:{required:De("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Me,select:Be,option:st,optionKey:"i18nKey",t:De,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+De("SV_LOCATION")),l.createElement("div",null,l.createElement(t.TextInput,{isMandatory:!1,optionKey:"i18nKey",t:De,style:Ke,name:"location",value:ke,onChange:function(e){Te.businessDetails.location="object"==typeof e&&null!==e?e.target.value:e,Fe(e.target.value)}}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:{float:"right",position:"relative",bottom:"25px",marginTop:"-17px",marginRight:"51%"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 7C8.79 7 7 8.79 7 11C7 13.21 8.79 15 11 15C13.21 15 15 13.21 15 11C15 8.79 13.21 7 11 7ZM19.94 10C19.48 5.83 16.17 2.52 12 2.06V0H10V2.06C5.83 2.52 2.52 5.83 2.06 10H0V12H2.06C2.52 16.17 5.83 19.48 10 19.94V22H12V19.94C16.17 19.48 19.48 16.17 19.94 12H22V10H19.94ZM11 18C7.13 18 4 14.87 4 11C4 7.13 7.13 4 11 4C14.87 4 18 7.13 18 11C18 14.87 14.87 18 11 18Z",fill:"#a82227"})))),onClick:e=>{at(!ot)}})),l.createElement(t.CardLabel,null,De("SV_DAY_HOUR_OPERATION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(b,{t:De,data:$e,columns:lt,getCellProps:e=>({style:{padding:"4px 0px 0px 18px",height:"18px"}}),isPaginationRequired:!1}),"STATIONARY"===(null==Le?void 0:Le.code)&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+De("SV_AREA_REQUIRED")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:De,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"areaRequired",value:Ve,onChange:function(e){/[a-zA-Z]/.test(e.target.value)&&Ye({error:!0,label:De("SV_CITIZEN_AREA_VALIDATION")}),Ue(e.target.value)},style:Ke,ValidationRequired:!1},Oe={isRequired:!0,pattern:"^[0-9. ]{1,3}$",type:"tel",title:De("SV_INVALID_AREA")}))),l.createElement(t.CardLabel,null,""+De("SV_LOCAL_AUTHORITY_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:De,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"nameOfAuthority",value:He,onChange:function(e){We(e.target.value)},style:Ke,ValidationRequired:!1},Oe={isRequired:!0,pattern:"^[a-zA-Z-/ ]*$",type:"text",title:De("SV_INPUT_DID_NOT_MATCH")})),l.createElement(t.CardLabel,null,""+De("SV_VENDING_LISCENCE")),l.createElement(t.TextInput,d({t:De,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vendingLiscence",value:je,onChange:function(e){ze(e.target.value)},style:Ke,ValidationRequired:!1},Oe={isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]+$",type:"text",title:De("PT_NAME_ERROR_MESSAGE")})))),Ge&&l.createElement(t.Toast,{error:Ge.error,warning:Ge.warning,label:De(Ge.label),onClose:()=>{Ye(null)}})))},GIS:y,SVRequiredDoc:e=>{var n;let{t:i,onSelect:o}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:r,data:d={}}=Digit.Hooks.sv.useSVDoc(a,"StreetVending","Documents");let u=null==d||null===(n=d.StreetVending)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,i("MODULE_SV")),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,i("SV_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOCUMENT_ACCEPTED_PDF_JPG_PNG")),l.createElement("div",null,r&&l.createElement(t.Loader,null),Array.isArray(u)?u.map((e,n)=>{let{code:o,dropdownData:a}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(f(o,".","_"))),a.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(f(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("CS_COMMON_NEXT"),onSubmit:o}))))},SVDayAndTimeSlot:e=>{let{day:n,onDayToggle:i,onSameForAllChange:o,isSameForAll:a,onTimeChange:r}=e,u={};return l.createElement("div",{style:{marginBottom:"10px",display:"flex"}},l.createElement("div",{style:{display:"flex",width:"65px"}},l.createElement(t.CheckBox,{checked:n.isSelected,onChange:i,label:n.name})),n.isSelected&&l.createElement("div",null,l.createElement("div",{style:{display:"flex",gap:"120%",width:"111px",marginLeft:"30px",alignItems:"center"}},l.createElement(t.TextInput,d({style:{width:"100%",marginLeft:"80px"},type:"time",name:"startTime",value:(null==n?void 0:n.startTime)||"",onChange:e=>r("startTime",e.target.value),placeholder:"Start Time"},u={isRequired:!!n.isSelecte})),l.createElement(t.TextInput,d({style:{width:"100%",marginLeft:"15px"},type:"time",name:"endTime",value:(null==n?void 0:n.endTime)||"",onChange:e=>r("endTime",e.target.value),placeholder:"End Time"},u={isRequired:!!n.isSelecte})),(null==n?void 0:n.startTime)&&(null==n?void 0:n.endTime)&&l.createElement(t.CheckBox,{style:{width:"100%"},checked:!a,onChange:()=>o(null==n?void 0:n.startTime,null==n?void 0:n.endTime),label:"Same for All Fields"}))))},SVAdrressDetails:e=>{var i,a,u,s,c,v,m,f,E,g,S,h,y,_,b,D,A,C,N,T,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he,ye,_e,be,De,Ae,Ce,Ne,Te,Ie;let{t:we,config:Oe,onSelect:xe,userType:Re,formData:Le,editdata:Pe,previousData:Me}=e;const Be=Digit.Hooks.sv.useTenants(),ke=e=>e?{i18nKey:e,code:e,value:e}:null,{pathname:Fe}=o.useLocation();let Ve={};const Ue=Digit.UserService.getUser().info,[He,We]=n.useState((null==Le||null===(i=Le.address)||void 0===i?void 0:i.pincode)||(null==Me||null===(a=Me.addressDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.pincode)||(null==Pe||null===(s=Pe.addressDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.pincode)||""),[je,ze]=n.useState((null==Le||null===(v=Le.address)||void 0===v?void 0:v.city)||ke((null==Me||null===(m=Me.addressDetails)||void 0===m||null===(f=m[0])||void 0===f?void 0:f.city)||(null==Pe||null===(E=Pe.addressDetails)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.city))||""),[Ke,Ge]=n.useState((null==Le||null===(S=Le.address)||void 0===S?void 0:S.locality)||ke((null==Me||null===(h=Me.addressDetails)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.locality)||(null==Pe||null===(_=Pe.addressDetails)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.locality))||""),[Ye,qe]=n.useState((null==Le||null===(D=Le.address)||void 0===D?void 0:D.houseNo)||(null==Me||null===(A=Me.addressDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.houseNo)||(null==Pe||null===(N=Pe.addressDetails)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.houseNo)||""),[Ze,$e]=n.useState((null==Le||null===(I=Le.address)||void 0===I?void 0:I.landmark)||(null==Me||null===(w=Me.addressDetails)||void 0===w||null===(O=w[0])||void 0===O?void 0:O.landmark)||(null==Pe||null===(x=Pe.addressDetails)||void 0===x||null===(R=x[0])||void 0===R?void 0:R.landmark)||""),[Xe,Je]=n.useState((null==Le||null===(L=Le.address)||void 0===L?void 0:L.addressline1)||(null==Me||null===(P=Me.addressDetails)||void 0===P||null===(M=P[0])||void 0===M?void 0:M.addressLine1)||(null==Pe||null===(B=Pe.addressDetails)||void 0===B||null===(k=B[0])||void 0===k?void 0:k.addressLine1)||""),[Qe,et]=n.useState((null==Le||null===(F=Le.address)||void 0===F?void 0:F.addressline2)||(null==Me||null===(V=Me.addressDetails)||void 0===V||null===(U=V[0])||void 0===U?void 0:U.addressLine2)||(null==Pe||null===(H=Pe.addressDetails)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.addressLine2)||""),[tt,nt]=n.useState((null==Le||null===(j=Le.correspondenceAddress)||void 0===j?void 0:j.cpincode)||(null==Me||null===(z=Me.addressDetails)||void 0===z||null===(K=z[1])||void 0===K?void 0:K.pincode)||(null==Pe||null===(G=Pe.addressDetails)||void 0===G||null===(Y=G[1])||void 0===Y?void 0:Y.pincode)||""),[lt,it]=n.useState((null==Le||null===(q=Le.correspondenceAddress)||void 0===q?void 0:q.ccity)||ke((null==Me||null===(Z=Me.addressDetails)||void 0===Z||null===($=Z[1])||void 0===$?void 0:$.city)||(null==Pe||null===(X=Pe.addressDetails)||void 0===X||null===(J=X[1])||void 0===J?void 0:J.city))||""),[ot,at]=n.useState((null==Le||null===(Q=Le.correspondenceAddress)||void 0===Q?void 0:Q.clocality)||ke((null==Me||null===(ee=Me.addressDetails)||void 0===ee||null===(te=ee[1])||void 0===te?void 0:te.locality)||(null==Pe||null===(ne=Pe.addressDetails)||void 0===ne||null===(le=ne[1])||void 0===le?void 0:le.locality))||""),[rt,dt]=n.useState((null==Le||null===(ie=Le.correspondenceAddress)||void 0===ie?void 0:ie.chouseNo)||(null==Me||null===(oe=Me.addressDetails)||void 0===oe||null===(ae=oe[1])||void 0===ae?void 0:ae.houseNo)||(null==Pe||null===(re=Pe.addressDetails)||void 0===re||null===(de=re[1])||void 0===de?void 0:de.houseNo)||""),[ut,st]=n.useState((null==Le||null===(ue=Le.correspondenceAddress)||void 0===ue?void 0:ue.clandmark)||(null==Me||null===(se=Me.addressDetails)||void 0===se||null===(ce=se[1])||void 0===ce?void 0:ce.landmark)||(null==Pe||null===(ve=Pe.addressDetails)||void 0===ve||null===(me=ve[1])||void 0===me?void 0:me.landmark)||""),[ct,vt]=n.useState((null==Le||null===(pe=Le.correspondenceAddress)||void 0===pe?void 0:pe.caddressline1)||(null==Me||null===(fe=Me.addressDetails)||void 0===fe||null===(Ee=fe[1])||void 0===Ee?void 0:Ee.addressLine1)||(null==Pe||null===(ge=Pe.addressDetails)||void 0===ge||null===(Se=ge[1])||void 0===Se?void 0:Se.addressLine1)||""),[mt,pt]=n.useState((null==Le||null===(he=Le.correspondenceAddress)||void 0===he?void 0:he.caddressline2)||(null==Me||null===(ye=Me.addressDetails)||void 0===ye||null===(_e=ye[1])||void 0===_e?void 0:_e.addressLine2)||(null==Pe||null===(be=Pe.addressDetails)||void 0===be||null===(De=be[1])||void 0===De?void 0:De.addressLine2)||""),[ft,Et]=n.useState((null==Le||null===(Ae=Le.correspondenceAddress)||void 0===Ae?void 0:Ae.isAddressSame)||(null==Me||null===(Ce=Me.addressDetails)||void 0===Ce||null===(Ne=Ce[1])||void 0===Ne?void 0:Ne.isAddressSame)||(null==Pe||null===(Te=Pe.addressDetails)||void 0===Te||null===(Ie=Te[1])||void 0===Ie?void 0:Ie.isAddressSame)||!1),{control:gt}=r.useForm(),St={width:"EMPLOYEE"===Ue.type?"50%":"86%"},{data:ht}=Digit.Hooks.useBoundaryLocalities(null==je?void 0:je.code,"revenue",{enabled:!!je},we);let yt=[];ht&&ht.map((e,t)=>{yt.push({i18nKey:null==e?void 0:e.i18nkey,code:null==e?void 0:e.code,label:null==e?void 0:e.label,area:null==e?void 0:e.area,boundaryNum:null==e?void 0:e.boundaryNum})});const _t=()=>{var e,t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T,I,w,O,x,R,L,P;let M=[],B=Digit.ULBService.getCitizenCurrentTenant(!0);const k=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},F=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},V=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},U=e=>!e||""===e.trim();if(!U(null==Le||null===(e=Le.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var H,W,j,z,K,G;const e=null==Le||null===(H=Le.owner)||void 0===H||null===(W=H.units)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.spouseName,t=null==Le||null===(z=Le.owner)||void 0===z||null===(K=z.units)||void 0===K||null===(G=K[0])||void 0===G?void 0:G.dependentName;U(e)&&U(t)?M=[k(Le)]:!U(e)&&U(t)?M=[k(Le),F(Le)]:U(e)||U(t)||(M=[k(Le),F(Le),V(Le)])}const Y=(null==Le||null===(l=Le.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),q=sessionStorage.getItem("Response"),Z=JSON.parse(q);let $={addressDetails:[{addressId:"",addressLine1:(null==Le||null===(i=Le.address)||void 0===i?void 0:i.addressline1)||Xe,addressLine2:(null==Le||null===(o=Le.address)||void 0===o?void 0:o.addressline2)||Xe,addressType:"",city:(null==Me||null===(a=Me.addressDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.city)||(null==Le||null===(d=Le.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.name)||(null==je?void 0:je.name),cityCode:(null==Me||null===(s=Me.addressDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.cityCode)||(null==Le||null===(v=Le.address)||void 0===v||null===(m=v.city)||void 0===m?void 0:m.code)||(null==je?void 0:je.code),doorNo:"",houseNo:(null==Le||null===(p=Le.address)||void 0===p?void 0:p.houseNo)||Ye,landmark:(null==Le||null===(f=Le.address)||void 0===f?void 0:f.landmark)||Ze,locality:(null==Le||null===(E=Le.address)||void 0===E||null===(g=E.locality)||void 0===g?void 0:g.i18nKey)||(null==Ke?void 0:Ke.i18nKey),localityCode:(null==Le||null===(S=Le.address)||void 0===S||null===(h=S.locality)||void 0===h?void 0:h.code)||(null==Ke?void 0:Ke.code),pincode:(null==Le||null===(y=Le.address)||void 0===y?void 0:y.pincode)||He,streetName:"",vendorId:""},{addressId:"",addressLine1:ct,addressLine2:mt,addressType:"",city:(null==Me||null===(_=Me.addressDetails)||void 0===_||null===(b=_[1])||void 0===b?void 0:b.city)||(null==lt?void 0:lt.name),cityCode:(null==Me||null===(D=Me.addressDetails)||void 0===D||null===(A=D[1])||void 0===A?void 0:A.cityCode)||(null==lt?void 0:lt.code),doorNo:"",houseNo:rt,landmark:ut,locality:null==ot?void 0:ot.i18nKey,localityCode:null==ot?void 0:ot.code,pincode:tt,streetName:"",vendorId:"",isAddressSame:ft}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:"",accountNumber:"",applicationId:"",bankBranchName:"",bankName:"",id:"",ifscCode:"",refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==Me?void 0:Me.draftId)||(null==Z||null===(C=Z.SVDetail)||void 0===C?void 0:C.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:null==Le||null===(N=Le.businessDetails)||void 0===N?void 0:N.nameOfAuthority,tenantId:B,termsAndCondition:"Y",tradeLicenseNo:null==Le||null===(T=Le.owner)||void 0===T||null===(I=T.units)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.tradeNumber,vendingActivity:null==Le||null===(O=Le.businessDetails)||void 0===O||null===(x=O.vendingType)||void 0===x?void 0:x.code,vendingArea:(null==Le||null===(R=Le.businessDetails)||void 0===R?void 0:R.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:Y,vendingZone:null==Le||null===(L=Le.businessDetails)||void 0===L||null===(P=L.vendingZones)||void 0===P?void 0:P.code,vendorDetail:[...M],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:$,draftApplication:!0},B).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})},bt=()=>{let e=Le.address;if(Fe.includes("correspondence")){e=null==Le?void 0:Le.correspondenceAddress;let t=d({},e,{cpincode:tt,ccity:lt,clocality:ot,chouseNo:rt,clandmark:ut,caddressline1:ct,caddressline2:mt,isAddressSame:ft});xe(Oe.key,d({},Le[Oe.key],t),!1),!window.location.href.includes("edit")&&_t()}else{let t=d({},e,{pincode:He,city:je,locality:Ke,houseNo:Ye,landmark:Ze,addressline1:Xe,addressline2:Qe});xe(Oe.key,d({},Le[Oe.key],t),!1),!window.location.href.includes("edit")&&_t()}},Dt=()=>xe();return n.useEffect(()=>{"citizen"===Re&&bt()},[He,je,Ke,Ye,Ze,Xe,Qe,lt,rt,ot,ct,mt]),Fe.includes("correspondence")?l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(p,{currentStep:3}):null,l.createElement(t.FormStep,{config:Oe,onSelect:bt,onSkip:Dt,t:we,isDisabled:!(lt&&rt&&ot&&ct&&mt&&tt)},l.createElement("div",null,l.createElement(t.CheckBox,{label:we("SV_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{0==ft?(Et(!0),nt(He),it(je),at(Ke),dt(Ye),st(Ze),vt(Xe),pt(Qe)):(Et(!1),nt(""),it(""),at(""),dt(""),st(""),vt(""),pt(""))},checked:ft,style:{paddingBottom:"10px",paddingTop:"10px"}}),l.createElement(t.CardLabel,null,""+we("SV_HOUSE_NO")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"chouseNo",value:rt,placeholder:"Enter House No",onChange:e=>{dt(e.target.value)},style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!1},Ve={isRequired:!0,pattern:"^[a-zA-z0-9- ]*$",type:"text",title:we("SV_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_ADDRESS_LINE1")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"caddressline1",value:ct,placeholder:"Enter Address",onChange:e=>{vt(e.target.value)},style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:we("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_ADDRESS_LINE2")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"caddressline2",value:mt,placeholder:"Enter Address",onChange:e=>{pt(e.target.value)},style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:we("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_LANDMARK")),l.createElement(t.TextArea,d({t:we,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"clandmark",value:ut,placeholder:"Enter Landmark",onChange:e=>{st(e.target.value)},style:{width:"50%"},ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,- ]*$",type:"textarea",title:we("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_CITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"ccity",defaultValue:lt,rules:{required:we("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:lt,select:it,option:Be,optionKey:"i18nKey",t:we,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+we("SV_LOCALITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"clocality",defaultValue:ot,rules:{required:we("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ot,select:at,option:yt,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:we,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+we("SV_ADDRESS_PINCODE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:we,type:"tel",isMandatory:!1,optionKey:"i18nKey",name:"cpincode",value:tt,onChange:e=>{nt(e.target.value)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!0,validation:{required:!0,pattern:"^[0-9]{6}$",type:"tel",title:we("SV_ADDRESS_PINCODE_INVALID")},minLength:6,maxLength:6})))):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(p,{currentStep:3}):null,l.createElement(t.FormStep,{config:Oe,onSelect:bt,onSkip:Dt,t:we,isDisabled:!(je&&Ye&&Ke&&Xe&&Qe&&He)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+we("SV_HOUSE_NO")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:Ye,placeholder:"Enter House No",onChange:e=>{qe(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!0,pattern:"^[a-zA-z0-9- ]*$",type:"text",title:we("SV_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_ADDRESS_LINE1")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:Xe,placeholder:"Enter Address",onChange:e=>{Je(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:we("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_ADDRESS_LINE2")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:Qe,placeholder:"Enter Address",onChange:e=>{et(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:we("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_LANDMARK")),l.createElement(t.TextInput,d({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:Ze,placeholder:"Enter Landmark",onChange:e=>{$e(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,- ]*$",type:"text",title:we("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+we("SV_CITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"city",defaultValue:je,rules:{required:we("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:je,select:ze,option:Be,optionKey:"i18nKey",t:we,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+we("SV_LOCALITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"locality",defaultValue:Ke,rules:{required:we("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Ke,select:Ge,option:yt,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:we,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+we("SV_ADDRESS_PINCODE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:we,type:"tel",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:He,onChange:e=>{We(e.target.value)},placeholder:"Enter Pincode",style:St,ValidationRequired:!0,validation:{required:!0,pattern:"^[0-9]{6}$",type:"tel",title:we("SV_ADDRESS_PINCODE_INVALID")},maxLength:6}))))},SVBankDetails:e=>{var i,o,a,r,u,s,c,v,m,f,E,g,S,h,y,_,b,A;let{t:C,config:N,onSelect:T,userType:I,formData:w,editdata:O,previousData:x}=e;const[R,L]=n.useState({accountNumber:(null==w||null===(i=w.bankdetails)||void 0===i?void 0:i.accountNumber)||(null==x||null===(o=x.bankDetail)||void 0===o?void 0:o.accountNumber)||(null==O||null===(a=O.bankDetail)||void 0===a?void 0:a.accountNumber)||"",confirmAccountNumber:(null==w||null===(r=w.bankdetails)||void 0===r?void 0:r.confirmAccountNumber)||(null==x||null===(u=x.bankDetail)||void 0===u?void 0:u.accountNumber)||(null==O||null===(s=O.bankDetail)||void 0===s?void 0:s.accountNumber)||"",ifscCode:(null==w||null===(c=w.bankdetails)||void 0===c?void 0:c.ifscCode)||(null==x||null===(v=x.bankDetail)||void 0===v?void 0:v.ifscCode)||(null==O||null===(m=O.bankDetail)||void 0===m?void 0:m.ifscCode)||"",bankName:(null==w||null===(f=w.bankdetails)||void 0===f?void 0:f.bankName)||(null==x||null===(E=x.bankDetail)||void 0===E?void 0:E.bankName)||(null==O||null===(g=O.bankDetail)||void 0===g?void 0:g.bankName)||"",bankBranchName:(null==w||null===(S=w.bankdetails)||void 0===S?void 0:S.bankBranchName)||(null==x||null===(h=x.bankDetail)||void 0===h?void 0:h.bankBranchName)||(null==O||null===(y=O.bankDetail)||void 0===y?void 0:y.bankBranchName)||"",accountHolderName:(null==w||null===(_=w.bankdetails)||void 0===_?void 0:_.accountHolderName)||(null==x||null===(b=x.bankDetail)||void 0===b?void 0:b.accountHolderName)||(null==O||null===(A=O.bankDetail)||void 0===A?void 0:A.accountHolderName)||""}),[P,M]=n.useState(null),B=Digit.UserService.getUser().info,k=n.useCallback(function(){try{const e=D(function(){return Promise.resolve(fetch("https://ifsc.razorpay.com/"+R.ifscCode)).then(function(e){return Promise.resolve(e.json()).then(function(e){null!=e&&e.BANK&&null!=e&&e.BRANCH?L(t=>d({},t,{bankName:e.BANK,bankBranchName:e.BRANCH})):M({error:!0,label:C("SV_IFSC_CODE_INVALID")})})})},function(){M({error:!0,label:C("SV_IFSC_CODE_INVALID")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[R.ifscCode,C]);n.useEffect(()=>{R.accountNumber&&R.confirmAccountNumber&&R.accountNumber===R.confirmAccountNumber&&M({error:!1,label:C("SV_ACCOUNT_NUMBER_MATCHES")})},[R.accountNumber,R.confirmAccountNumber,C]),n.useEffect(()=>{11===R.ifscCode.length&&k()},[R.ifscCode,k]),n.useEffect(()=>{if(P){const e=setTimeout(()=>M(null),2e3);return()=>clearTimeout(e)}},[P]),n.useEffect(()=>{"citizen"===I&&F()},[R.accountNumber||R.confirmAccountNumber||R.ifscCode||R.bankName||R.bankBranchName||R.accountHolderName]);const F=()=>{R.accountNumber===R.confirmAccountNumber?(T(N.key,d({},w.bankdetails,R),!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T,I,O,L,P,M,B,k,F,V,U,H,W,j;let z=[],K=Digit.ULBService.getCitizenCurrentTenant(!0);const G=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},Y=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},q=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},Z=e=>!e||""===e.trim();if(!Z(null==w||null===(e=w.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var $,X,J,Q,ee,te;const e=null==w||null===($=w.owner)||void 0===$||null===(X=$.units)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.spouseName,t=null==w||null===(Q=w.owner)||void 0===Q||null===(ee=Q.units)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.dependentName;Z(e)&&Z(t)?z=[G(w)]:!Z(e)&&Z(t)?z=[G(w),Y(w)]:Z(e)||Z(t)||(z=[G(w),Y(w),q(w)])}const ne=(null==w||null===(l=w.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),le=sessionStorage.getItem("Response"),ie=JSON.parse(le);let oe={addressDetails:[{addressId:"",addressLine1:null==w||null===(i=w.address)||void 0===i?void 0:i.addressline1,addressLine2:null==w||null===(o=w.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==w||null===(a=w.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==w||null===(d=w.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==w||null===(s=w.address)||void 0===s?void 0:s.houseNo,landmark:null==w||null===(c=w.address)||void 0===c?void 0:c.landmark,locality:null==w||null===(v=w.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.i18nKey,localityCode:null==w||null===(p=w.address)||void 0===p||null===(f=p.locality)||void 0===f?void 0:f.code,pincode:null==w||null===(E=w.address)||void 0===E?void 0:E.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==w||null===(g=w.correspondenceAddress)||void 0===g?void 0:g.caddressline1,addressLine2:null==w||null===(S=w.correspondenceAddress)||void 0===S?void 0:S.caddressline2,addressType:"",city:null==w||null===(h=w.correspondenceAddress)||void 0===h||null===(y=h.ccity)||void 0===y?void 0:y.name,cityCode:null==w||null===(_=w.correspondenceAddress)||void 0===_||null===(b=_.ccity)||void 0===b?void 0:b.code,doorNo:"",houseNo:null==w||null===(D=w.correspondenceAddress)||void 0===D?void 0:D.chouseNo,landmark:null==w||null===(A=w.correspondenceAddress)||void 0===A?void 0:A.clandmark,locality:null==w||null===(C=w.correspondenceAddress)||void 0===C||null===(N=C.clocality)||void 0===N?void 0:N.i18nKey,localityCode:null==w||null===(T=w.correspondenceAddress)||void 0===T||null===(I=T.clocality)||void 0===I?void 0:I.code,pincode:null==w||null===(O=w.correspondenceAddress)||void 0===O?void 0:O.cpincode,streetName:"",vendorId:"",isAddressSame:null==w||null===(L=w.correspondenceAddress)||void 0===L?void 0:L.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==R?void 0:R.accountHolderName,accountNumber:null==R?void 0:R.accountNumber,applicationId:"",bankBranchName:null==R?void 0:R.bankBranchName,bankName:null==R?void 0:R.bankName,id:"",ifscCode:null==R?void 0:R.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==x?void 0:x.draftId)||(null==ie||null===(P=ie.SVDetail)||void 0===P?void 0:P.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:null==w||null===(M=w.businessDetails)||void 0===M?void 0:M.nameOfAuthority,tenantId:K,termsAndCondition:"Y",tradeLicenseNo:null==w||null===(B=w.owner)||void 0===B||null===(k=B.units)||void 0===k||null===(F=k[0])||void 0===F?void 0:F.tradeNumber,vendingActivity:null==w||null===(V=w.businessDetails)||void 0===V||null===(U=V.vendingType)||void 0===U?void 0:U.code,vendingArea:(null==w||null===(H=w.businessDetails)||void 0===H?void 0:H.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:ne,vendingZone:null==w||null===(W=w.businessDetails)||void 0===W||null===(j=W.vendingZones)||void 0===j?void 0:j.code,vendorDetail:[...z],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:oe,draftApplication:!0},K).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()):M({error:!0,label:C("SV_INVALID_ACCOUNTNUMBER")})},V={width:"EMPLOYEE"===B.type?"50%":null};return l.createElement(l.Fragment,null,l.createElement(p,{currentStep:4}),l.createElement(t.FormStep,{config:N,onSelect:F,onSkip:()=>T(),t:C},[{label:"SV_ACCOUNT_NUMBER",field:"accountNumber",maxLength:16,regex:/\D/g},{label:"SV_CONFIRM_ACCOUNT_NUMBER",field:"confirmAccountNumber",maxLength:16,regex:/\D/g},{label:"SV_IFSC_CODE",field:"ifscCode",maxLength:11,regex:/[^a-zA-Z0-9]/g},{label:"SV_BANK_NAME",field:"bankName",disabled:!0},{label:"SV_BANK_BRANCH_NAME",field:"bankBranchName",disabled:!0},{label:"SV_ACCOUNT_HOLDER_NAME",field:"accountHolderName",regex:/[^a-zA-Z\s]/g}].map(e=>{let{label:n,field:i,maxLength:o,regex:a,disabled:r}=e;return l.createElement("div",{key:i},l.createElement(t.CardLabel,null,C(n)),l.createElement(t.TextInput,d({t:C,type:"text",name:i,value:R[i],placeholder:C("Enter "+n),onChange:e=>function(e,t,n,l){void 0===n&&(n=null),void 0===l&&(l=null),l&&(t=t.replace(l,"")),n&&t.length>n||L(n=>d({},n,{[e]:t}))}(i,e.target.value,o,a),style:V,disabled:r||!1},"accountHolderName"===i?{pattern:"^[a-zA-Z ]+$",title:C("SV_INVALID_ACCOUNT_HOLDER_NAME")}:{pattern:11===o?"[a-zA-Z0-9]{11}":"[0-9]{8,16}",title:C("SV_INVALID_"+n)})))})),P&&l.createElement(t.Toast,{error:P.error,warning:P.warning,label:C(P.label),onClose:()=>M(null)}))},SVDocumentsDetail:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:c,editdata:v,previousData:m}=e;const[f,E]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[g,S]=n.useState(null),[h,y]=n.useState(!0),[_,b]=n.useState(!0),D=Digit.ULBService.getStateId(),{isLoading:C,data:N}=Digit.Hooks.sv.useSVDoc(D,"StreetVending","Documents"),T=e=>Array.isArray(e)?e.map(e=>({applicationId:"",documentType:e.documentType,fileStoreId:e.fileStoreId,documentDetailId:e.documentUid,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}})):[];return n.useEffect(()=>{var e;let t=0;null==N||null===(e=N.StreetVending)||void 0===e||e.Documents.forEach(e=>{e.hasDropdown=!0,!f.some(t=>e.required&&(null==t?void 0:t.documentType.includes(e.code)))&&e.required&&(t+=1)}),y(!(0===t&&f.length>0))},[f,_,N]),l.createElement("div",null,l.createElement(p,{currentStep:5}),C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:()=>{let e=d({},c.documents,{documents:f});s(u.key,e),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,s,v,p,E,g,S,h,y,_,b,D,A,C,N,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z;let $=[],X=Digit.ULBService.getCitizenCurrentTenant(!0);const J=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},Q=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},ee=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},te=e=>!e||""===e.trim();if(!te(null==c||null===(e=c.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var ne,le,ie,oe,ae,re;const e=null==c||null===(ne=c.owner)||void 0===ne||null===(le=ne.units)||void 0===le||null===(ie=le[0])||void 0===ie?void 0:ie.spouseName,t=null==c||null===(oe=c.owner)||void 0===oe||null===(ae=oe.units)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.dependentName;te(e)&&te(t)?$=[J(c)]:!te(e)&&te(t)?$=[J(c),Q(c)]:te(e)||te(t)||($=[J(c),Q(c),ee(c)])}const de=(null==c||null===(l=c.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),ue=sessionStorage.getItem("Response"),se=JSON.parse(ue);let ce={addressDetails:[{addressId:"",addressLine1:null==c||null===(i=c.address)||void 0===i?void 0:i.addressline1,addressLine2:null==c||null===(o=c.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==c||null===(a=c.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==c||null===(d=c.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==c||null===(s=c.address)||void 0===s?void 0:s.houseNo,landmark:null==c||null===(v=c.address)||void 0===v?void 0:v.landmark,locality:null==c||null===(p=c.address)||void 0===p||null===(E=p.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==c||null===(g=c.address)||void 0===g||null===(S=g.locality)||void 0===S?void 0:S.code,pincode:null==c||null===(h=c.address)||void 0===h?void 0:h.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==c||null===(y=c.correspondenceAddress)||void 0===y?void 0:y.caddressline1,addressLine2:null==c||null===(_=c.correspondenceAddress)||void 0===_?void 0:_.caddressline2,addressType:"",city:null==c||null===(b=c.correspondenceAddress)||void 0===b||null===(D=b.ccity)||void 0===D?void 0:D.name,cityCode:null==c||null===(A=c.correspondenceAddress)||void 0===A||null===(C=A.ccity)||void 0===C?void 0:C.code,doorNo:"",houseNo:null==c||null===(N=c.correspondenceAddress)||void 0===N?void 0:N.chouseNo,landmark:null==c||null===(I=c.correspondenceAddress)||void 0===I?void 0:I.clandmark,locality:null==c||null===(w=c.correspondenceAddress)||void 0===w||null===(O=w.clocality)||void 0===O?void 0:O.i18nKey,localityCode:null==c||null===(x=c.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.code,pincode:null==c||null===(L=c.correspondenceAddress)||void 0===L?void 0:L.cpincode,streetName:"",vendorId:"",isAddressSame:null==c||null===(P=c.correspondenceAddress)||void 0===P?void 0:P.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==c||null===(M=c.bankDetails)||void 0===M?void 0:M.accountHolderName,accountNumber:null==c||null===(B=c.bankDetails)||void 0===B?void 0:B.accountNumber,applicationId:"",bankBranchName:null==c||null===(k=c.bankDetails)||void 0===k?void 0:k.bankBranchName,bankName:null==c||null===(F=c.bankDetails)||void 0===F?void 0:F.bankName,id:"",ifscCode:null==c||null===(V=c.bankDetails)||void 0===V?void 0:V.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==m?void 0:m.draftId)||(null==se||null===(U=se.SVDetail)||void 0===U?void 0:U.draftId),documentDetails:T(f),localAuthorityName:null==c||null===(H=c.businessDetails)||void 0===H?void 0:H.nameOfAuthority,tenantId:X,termsAndCondition:"Y",tradeLicenseNo:null==c||null===(W=c.owner)||void 0===W||null===(j=W.units)||void 0===j||null===(z=j[0])||void 0===z?void 0:z.tradeNumber,vendingActivity:null==c||null===(K=c.businessDetails)||void 0===K||null===(G=K.vendingType)||void 0===G?void 0:G.code,vendingArea:(null==c||null===(Y=c.businessDetails)||void 0===Y?void 0:Y.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:de,vendingZone:null==c||null===(q=c.businessDetails)||void 0===q||null===(Z=q.vendingZones)||void 0===Z?void 0:Z.code,vendorDetail:[...$],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:ce,draftApplication:!0},X).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()},onSkip:()=>s(),isDisabled:h},null==N||null===(o=N.StreetVending)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(A,{key:t,document:e,t:r,error:g,setError:S,setDocuments:E,documents:f,setCheckRequiredFields:b,formData:c,editdata:v,previousData:m})),g&&l.createElement(t.Toast,{label:g,onClose:()=>S(null),error:!0})))},CheckPage:e=>{var o,a,r,u,s,c,v,m,f,S,y,D,A,N,T,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re;let{onSubmit:de,editdata:ue,value:se={}}=e;const{t:ce}=i.useTranslation(),{owner:ve,businessDetails:me,address:pe,bankdetails:fe,documents:Ee,specialCategoryData:ge}=se,[Se,he]=n.useState(!1),ye=[{Header:ce("SV_WEEK_DAYS"),accessor:"name"},{Header:ce("SV_START_TIME"),accessor:"startTime"},{Header:ce("SV_END_TIME"),accessor:"endTime"}],_e=(null==me||null===(o=me.daysOfOperation)||void 0===o?void 0:o.filter(e=>e.isSelected).map((e,t)=>({name:null==e?void 0:e.name,startTime:parseInt(null==e?void 0:e.startTime)>=12?(null==e?void 0:e.startTime)+" PM":(null==e?void 0:e.startTime)+" AM",endTime:parseInt(null==e?void 0:e.endTime)>=12?(null==e?void 0:e.endTime)+" PM":(null==e?void 0:e.endTime)+" AM"})))||[];let be=[];if(null!=ue&&ue.documentDetails&&Array.isArray(null==ue?void 0:ue.documentDetails)&&(null==ue||ue.documentDetails.map(e=>{be.push(d({},e,{module:"StreetVending"}))})),_.isEmpty(ue)&&null!=Ee&&Ee.documents&&Ee.documents.forEach(e=>{be.some(t=>t.documentType===e.documentType)||be.push(d({},e,{module:"StreetVending"}))}),_.isEmpty(ue)){const e=JSON.parse(sessionStorage.getItem("CategoryDocument"));e&&Array.isArray(e)&&e.forEach(e=>{be.some(t=>t.documentType===e.documentType)||be.push(d({},e,{module:"StreetVending"}))})}const{data:De}=Digit.Hooks.useDocumentSearch(be,{enabled:(null==be?void 0:be.length)>0});let Ae=[];var Ce;return(null==De||null===(a=De.pdfFiles)||void 0===a?void 0:a.length)>0&&(null==De||null===(Ce=De.pdfFiles)||void 0===Ce||Ce.map(e=>{"StreetVending"==(null==e?void 0:e.module)&&Ae.push(e)})),l.createElement(l.Fragment,null,l.createElement(p,{currentStep:7}),l.createElement(t.Card,null,l.createElement(t.CardHeader,null,ce("SV_SUMMARY_PAGE")),l.createElement("div",null,l.createElement(t.CardSubHeader,null,ce("SV_VENDOR_PERSONAL_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_VENDOR_NAME"),text:""+ce(E(null==ve||null===(r=ve.units)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.vendorName)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/applicant-details"})}),l.createElement(t.Row,{label:ce("SV_REGISTERED_MOB_NUMBER"),text:""+ce(E(null==ve||null===(s=ve.units)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.mobileNumber))}),l.createElement(t.Row,{label:ce("SV_DATE_OF_BIRTH"),text:""+ce(E(null==ve||null===(v=ve.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.vendorDateOfBirth))}),l.createElement(t.Row,{label:ce("SV_GENDER"),text:""+ce(E(null==ve||null===(f=ve.units)||void 0===f||null===(S=f[0])||void 0===S||null===(y=S.gender)||void 0===y?void 0:y.code))}),l.createElement(t.Row,{label:ce("SV_FATHER_NAME"),text:""+ce(E(null==ve||null===(D=ve.units)||void 0===D||null===(A=D[0])||void 0===A?void 0:A.fatherName))}),null!=ve&&null!==(N=ve.units)&&void 0!==N&&null!==(T=N[0])&&void 0!==T&&T.email?l.createElement(t.Row,{label:ce("SV_EMAIL"),text:""+ce(E(null==ve||null===(I=ve.units)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.email))}):null,(null==ve||null===(O=ve.units)||void 0===O||null===(x=O[0])||void 0===x?void 0:x.spouseName)&&l.createElement(t.Row,{label:ce("SV_SPOUSE_NAME"),text:l.createElement("span",null,ce(E(null==ve||null===(R=ve.units)||void 0===R||null===(L=R[0])||void 0===L?void 0:L.spouseName))," ",l.createElement("span",{className:"astericColor"},"(",ce(null!=ve&&ve.spouseDependentChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ve&&null!==(P=ve.units)&&void 0!==P&&null!==(M=P[0])&&void 0!==M&&M.spouseDateBirth?l.createElement(t.Row,{label:ce("SV_SPOUSE_DATE_OF_BIRTH"),text:""+ce(E(null==ve||null===(B=ve.units)||void 0===B||null===(k=B[0])||void 0===k?void 0:k.spouseDateBirth))}):null,(null==ve||null===(F=ve.units)||void 0===F||null===(V=F[0])||void 0===V?void 0:V.dependentName)&&l.createElement(t.Row,{label:ce("SV_DEPENDENT_NAME"),text:l.createElement("span",null,ce(E(null==ve||null===(U=ve.units)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.dependentName))," ",l.createElement("span",{className:"astericColor"},"(",ce(null!=ve&&ve.dependentNameChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ve&&null!==(W=ve.units)&&void 0!==W&&null!==(j=W[0])&&void 0!==j&&j.dependentDateBirth?l.createElement(t.Row,{label:ce("SV_DEPENDENT_DATE_OF_BIRTH"),text:""+ce(E(null==ve||null===(z=ve.units)||void 0===z||null===(K=z[0])||void 0===K?void 0:K.dependentDateBirth))}):null,null!=ve&&null!==(G=ve.units)&&void 0!==G&&null!==(Y=G[0])&&void 0!==Y&&Y.dependentGender?l.createElement(t.Row,{label:ce("SV_DEPENDENT_GENDER"),text:""+ce(E(null==ve||null===(q=ve.units)||void 0===q||null===(Z=q[0])||void 0===Z||null===($=Z.dependentGender)||void 0===$?void 0:$.code))}):null,null!=ve&&null!==(X=ve.units)&&void 0!==X&&null!==(J=X[0])&&void 0!==J&&J.dependentGender?l.createElement(t.Row,{label:ce("SV_TRADE_NUMBER"),text:""+ce(E(null==ve||null===(Q=ve.units)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.tradeNumber))}):null),l.createElement(t.CardSubHeader,null,ce("SV_VENDOR_BUSINESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_VENDING_TYPE"),text:""+ce(E(null==me||null===(te=me.vendingType)||void 0===te?void 0:te.code)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/business-details"})}),l.createElement(t.Row,{label:ce("SV_VENDING_ZONES"),text:""+ce(E(null==me||null===(ne=me.vendingZones)||void 0===ne?void 0:ne.value))}),l.createElement(t.Row,{label:ce("SV_AREA_REQUIRED"),text:""+ce(E(null==me?void 0:me.areaRequired))}),l.createElement(t.Row,{label:ce("SV_LOCAL_AUTHORITY_NAME"),text:""+ce(E(null==me?void 0:me.nameOfAuthority))}),null!=me&&me.vendingLiscence?l.createElement(t.Row,{label:ce("SV_VENDING_LISCENCE"),text:""+ce(E(null==me?void 0:me.vendingLiscence))}):null,l.createElement("span",{style:{marginTop:"5px",fontSize:"18px",fontWeight:"bold"}},ce("SV_DAY_HOUR_OPERATION")),l.createElement(b,{t:ce,data:_e,columns:ye,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:_e.length})),(null==fe?void 0:fe.accountNumber)&&(null==fe?void 0:fe.ifscCode)&&(null==fe?void 0:fe.bankName)&&(null==fe?void 0:fe.bankBranchName)&&(null==fe?void 0:fe.accountHolderName)&&l.createElement(l.Fragment,null,l.createElement(t.CardSubHeader,null,ce("SV_BANK_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_ACCOUNT_NUMBER"),text:""+ce(E(null==fe?void 0:fe.accountNumber)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/bank-details"})}),l.createElement(t.Row,{label:ce("SV_IFSC_CODE"),text:""+ce(E(null==fe?void 0:fe.ifscCode))}),l.createElement(t.Row,{label:ce("SV_BANK_NAME"),text:""+ce(E(null==fe?void 0:fe.bankName))}),l.createElement(t.Row,{label:ce("SV_BANK_BRANCH_NAME"),text:""+ce(E(null==fe?void 0:fe.bankBranchName))}),l.createElement(t.Row,{label:ce("SV_ACCOUNT_HOLDER_NAME"),text:""+ce(E(null==fe?void 0:fe.accountHolderName))}))),l.createElement(t.CardSubHeader,null,ce("SV_ADDRESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_ADDRESS_LINE1"),text:""+ce(E(null==pe?void 0:pe.addressline1)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/address-details"})}),l.createElement(t.Row,{label:ce("SV_ADDRESS_LINE2"),text:""+ce(E(null==pe?void 0:pe.addressline2))}),l.createElement(t.Row,{label:ce("SV_CITY"),text:""+ce(E(null==pe||null===(le=pe.city)||void 0===le||null===(ie=le.city)||void 0===ie?void 0:ie.name))}),l.createElement(t.Row,{label:ce("SV_LOCALITY"),text:""+ce(E(null==pe||null===(oe=pe.locality)||void 0===oe?void 0:oe.i18nKey))}),null!=pe&&pe.pincode?l.createElement(t.Row,{label:ce("SV_ADDRESS_PINCODE"),text:""+ce(E(null==pe?void 0:pe.pincode))}):null,null!=pe&&pe.landmark?l.createElement(t.Row,{label:ce("SV_LANDMARK"),text:""+ce(E(null==pe?void 0:pe.landmark))}):null),l.createElement(t.CardSubHeader,null,ce("SV_ADDITIONAL_DETAILS")),l.createElement(t.StatusTable,{style:{marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_CATEGORY"),text:""+ce(E(null==ge||null===(ae=ge.ownerCategory)||void 0===ae?void 0:ae.value)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/special-category"})}),null!==(null==ge?void 0:ge.beneficiary)?l.createElement(t.Row,{label:ce("SV_BENEFICIARY_SCHEMES"),text:""+ce(E(null==ge||null===(re=ge.beneficiary)||void 0===re?void 0:re.value))}):null,null!==(null==ge?void 0:ge.enrollmentId)?l.createElement(t.Row,{label:ce("SV_ENROLLMENT_APPLICATION_NUMBER"),text:""+ce(E(null==ge?void 0:ge.enrollmentId))}):null),l.createElement(t.CardSubHeader,null,ce("SV_DOCUMENT_DETAILS_LABEL")),l.createElement(h,{documents:g(Ae),svgStyles:{},isSendBackFlow:!1,titleStyles:{fontSize:"18px",fontWeight:700,marginBottom:"10px"}}),l.createElement("br",null),l.createElement(t.CheckBox,{label:ce("SV_FINAL_DECLARATION_MESSAGE"),onChange:()=>{he(!Se)},styles:{height:"auto",marginBottom:"30px",marginTop:"10px"}})),l.createElement(t.SubmitBar,{label:ce("SV_COMMON_BUTTON_SUBMIT"),onSubmit:de,disabled:!Se})))},SVEmpCreate:e=>{var t,n,r,u;const c=a.useQueryClient(),v=o.useRouteMatch(),{t:m}=i.useTranslation(),{pathname:p}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let E=[];const[g,S,h]=Digit.Hooks.useSessionStorage("SV_EMP_CREATES",{});function y(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=g.owners||[];n[l]=t,S(d({},g,{[e]:[...n]}))}else if("units"===e){let e=g.units||[];e=t,S(d({},g,{units:e}))}else S(d({},g,{[e]:d({},g[e],t)}));((e,t,n,l)=>{let i,o=p.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=p.slice(0,-3),o=o.split("/").pop(),r=!0):(o=p.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:d={}}=E.find(e=>e.route===o),u=f.push;if(e&&(u=f.replace),n&&(d=l),null===d)return u(v.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?v.path+"/"+d+"/"+t:v.path+"/"+d,u(i)})(n,l,i,e)}g&&Object.keys(g).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(h(),c.invalidateQueries("SV_EMP_CREATE"));const _=()=>{},b=()=>{};s.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const D=null===(t=Digit)||void 0===t||null===(n=t.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CheckPage"),A=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,d="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n,u=Digit.UserService.getUser().info.type;return l.createElement(o.Route,{path:v.path+"/"+e.route,key:t},l.createElement(d,{config:{texts:i,inputs:a,key:r},onSelect:y,onSkip:_,t:m,formData:g,onAdd:b,userType:u}))}),l.createElement(o.Route,{path:v.path+"/check"},l.createElement(D,{onSubmit:function(){try{return f.replace(v.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:g})),l.createElement(o.Route,{path:v.path+"/acknowledgement"},l.createElement(A,{data:g,onSuccess:()=>{h(),c.invalidateQueries("SV_EMP_CREATE"),sessionStorage.removeItem("CategoryDocument"),sessionStorage.removeItem("vendingApplicationID"),sessionStorage.removeItem("ApplicationId"),sessionStorage.removeItem("Response")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:v.path+"/"+E.indexRoute})))},SVAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:u}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),c=Digit.Hooks.sv.useSvCreateApi(s,!window.location.href.includes("edit")),v=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:p}=m||{};return n.useEffect(()=>{try{a.tenantId=s;let e=window.location.href.includes("edit")?(e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,h,y,_,b,D,A,C,N,T,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne;let le=[];const ie=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C;return{applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,specialCategory:null==e||null===(p=e.specialCategoryData)||void 0===p||null===(f=p.ownerCategory)||void 0===f?void 0:f.code,gender:null==e||null===(E=e.owner)||void 0===E||null===(g=E.units)||void 0===g||null===(S=g[0])||void 0===S||null===(h=S.gender)||void 0===h?void 0:h.code.charAt(0),id:sessionStorage.getItem("venId"),mobileNo:null==e||null===(y=e.owner)||void 0===y||null===(_=y.units)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.mobileNumber,name:null==e||null===(D=e.owner)||void 0===D||null===(A=D.units)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},oe=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m;return{applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(s=u.ownerCategory)||void 0===s?void 0:s.code,gender:"N/A",id:sessionStorage.getItem("venId"),mobileNo:"",name:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.spouseName,relationshipType:"SPOUSE",vendorId:null}},ae=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g;return{applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(s=u.ownerCategory)||void 0===s?void 0:s.code,gender:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m||null===(p=m.dependentGender)||void 0===p?void 0:p.code.charAt(0),id:sessionStorage.getItem("venId"),mobileNo:"",name:null==e||null===(f=e.owner)||void 0===f||null===(E=f.units)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.dependentName,relationshipType:"DEPENDENT",vendorId:null}},re=e=>!e||""===e.trim();if(!re(null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorName)){var de,ue,se,ce,ve,me;const t=null==e||null===(de=e.owner)||void 0===de||null===(ue=de.units)||void 0===ue||null===(se=ue[0])||void 0===se?void 0:se.spouseName,n=null==e||null===(ce=e.owner)||void 0===ce||null===(ve=ce.units)||void 0===ve||null===(me=ve[0])||void 0===me?void 0:me.dependentName;re(t)&&re(n)?le=[ie(e)]:!re(t)&&re(n)?le=[ie(e),oe(e)]:re(t)||re(n)||(le=[ie(e),oe(e),ae(e)])}const pe=(null==e||null===(i=e.businessDetails)||void 0===i?void 0:i.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""}));return{streetVendingDetail:{addressDetails:[{addressId:sessionStorage.getItem("addressIdOne"),addressLine1:null==e||null===(o=e.address)||void 0===o?void 0:o.addressline1,addressLine2:null==e||null===(a=e.address)||void 0===a?void 0:a.addressline2,addressType:"PERMANENT",city:(null==e||null===(r=e.address)||void 0===r||null===(d=r.city)||void 0===d?void 0:d.name)||(null==e||null===(u=e.address)||void 0===u||null===(s=u.city)||void 0===s?void 0:s.code),cityCode:null==e||null===(c=e.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code,doorNo:"",houseNo:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo,landmark:null==e||null===(p=e.address)||void 0===p?void 0:p.landmark,locality:null==e||null===(f=e.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==e||null===(g=e.address)||void 0===g||null===(h=g.locality)||void 0===h?void 0:h.code,pincode:null==e||null===(y=e.address)||void 0===y?void 0:y.pincode,streetName:"",vendorId:sessionStorage.getItem("vendorIds")},{addressId:sessionStorage.getItem("addressIdTwo"),addressLine1:null==e||null===(_=e.correspondenceAddress)||void 0===_?void 0:_.caddressline1,addressLine2:null==e||null===(b=e.correspondenceAddress)||void 0===b?void 0:b.caddressline2,addressType:"CORRESPONDENCE",city:(null==e||null===(D=e.correspondenceAddress)||void 0===D||null===(A=D.ccity)||void 0===A?void 0:A.name)||(null==e||null===(C=e.correspondenceAddress)||void 0===C||null===(N=C.ccity)||void 0===N?void 0:N.code),cityCode:null==e||null===(T=e.correspondenceAddress)||void 0===T||null===(I=T.ccity)||void 0===I?void 0:I.code,doorNo:"",houseNo:null==e||null===(w=e.correspondenceAddress)||void 0===w?void 0:w.chouseNo,landmark:null==e||null===(O=e.correspondenceAddress)||void 0===O?void 0:O.clandmark,locality:null==e||null===(x=e.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.i18nKey,localityCode:null==e||null===(L=e.correspondenceAddress)||void 0===L||null===(P=L.clocality)||void 0===P?void 0:P.code,pincode:null==e||null===(M=e.correspondenceAddress)||void 0===M?void 0:M.cpincode,streetName:"",vendorId:sessionStorage.getItem("vendorIds"),isAddressSame:null==e||null===(B=e.correspondenceAddress)||void 0===B?void 0:B.isAddressSame}],applicationDate:0,applicationId:sessionStorage.getItem("ApplicationId"),applicationNo:sessionStorage.getItem("vendingApplicationID"),applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==e||null===(k=e.bankdetails)||void 0===k?void 0:k.accountHolderName,accountNumber:null==e||null===(F=e.bankdetails)||void 0===F?void 0:F.accountNumber,applicationId:sessionStorage.getItem("ApplicationId"),bankBranchName:null==e||null===(V=e.bankdetails)||void 0===V?void 0:V.bankBranchName,bankName:null==e||null===(U=e.bankdetails)||void 0===U?void 0:U.bankName,id:sessionStorage.getItem("bankIds"),ifscCode:null==e||null===(H=e.bankdetails)||void 0===H?void 0:H.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==e||null===(W=e.specialCategoryData)||void 0===W||null===(j=W.beneficiary)||void 0===j?void 0:j.value,enrollmentId:null==e||null===(z=e.specialCategoryData)||void 0===z?void 0:z.enrollmentId,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==e||null===(K=e.specialCategoryData)||void 0===K||null===(G=K.ownerCategory)||void 0===G?void 0:G.code,documentDetails:S(null==e||null===(Y=e.documents)||void 0===Y?void 0:Y.documents),localAuthorityName:null==e||null===(q=e.businessDetails)||void 0===q?void 0:q.nameOfAuthority,tenantId:null==e?void 0:e.tenantId,termsAndCondition:"Y",tradeLicenseNo:null==e||null===(Z=e.owner)||void 0===Z||null===($=Z.units)||void 0===$||null===(X=$[0])||void 0===X?void 0:X.tradeNumber,vendingActivity:null==e||null===(J=e.businessDetails)||void 0===J||null===(Q=J.vendingType)||void 0===Q?void 0:Q.code,vendingArea:(null==e||null===(ee=e.businessDetails)||void 0===ee?void 0:ee.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:pe,vendingZone:null==e||null===(te=e.businessDetails)||void 0===te||null===(ne=te.vendingZones)||void 0===ne?void 0:ne.code,vendorDetail:[...le],workflow:{action:"RESUBMIT",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}}}})(a):(e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,h,y,_,b,D,A,C,N,T,I,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he;let ye=[];const _e=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,specialCategory:null==e||null===(p=e.specialCategoryData)||void 0===p||null===(f=p.ownerCategory)||void 0===f?void 0:f.code,gender:null==e||null===(E=e.owner)||void 0===E||null===(g=E.units)||void 0===g||null===(S=g[0])||void 0===S||null===(h=S.gender)||void 0===h?void 0:h.code.charAt(0),id:"",isInvolved:!0,mobileNo:null==e||null===(y=e.owner)||void 0===y||null===(_=y.units)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.mobileNumber,name:null==e||null===(D=e.owner)||void 0===D||null===(A=D.units)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},be=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",specialCategory:null==e||null===(d=e.specialCategoryData)||void 0===d||null===(u=d.ownerCategory)||void 0===u?void 0:u.code,isInvolved:null==e||null===(s=e.owner)||void 0===s?void 0:s.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.spouseName,relationshipType:"SPOUSE",vendorId:null}},De=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(s=u.ownerCategory)||void 0===s?void 0:s.code,fatherName:"",gender:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m||null===(p=m.dependentGender)||void 0===p?void 0:p.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(f=e.owner)||void 0===f||null===(E=f.units)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.dependentName,relationshipType:"DEPENDENT",vendorId:null}},Ae=e=>!e||""===e.trim();if(!Ae(null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorName)){var Ce,Ne,Te,Ie,we,Oe;const t=null==e||null===(Ce=e.owner)||void 0===Ce||null===(Ne=Ce.units)||void 0===Ne||null===(Te=Ne[0])||void 0===Te?void 0:Te.spouseName,n=null==e||null===(Ie=e.owner)||void 0===Ie||null===(we=Ie.units)||void 0===we||null===(Oe=we[0])||void 0===Oe?void 0:Oe.dependentName;Ae(t)&&Ae(n)?ye=[_e(e)]:!Ae(t)&&Ae(n)?ye=[_e(e),be(e)]:Ae(t)||Ae(n)||(ye=[_e(e),be(e),De(e)])}const xe=(null==e||null===(i=e.businessDetails)||void 0===i?void 0:i.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),Re=sessionStorage.getItem("Response"),Le=Re?JSON.parse(Re):null;return{streetVendingDetail:{addressDetails:[{addressId:"",addressLine1:null==e||null===(o=e.address)||void 0===o?void 0:o.addressline1,addressLine2:null==e||null===(a=e.address)||void 0===a?void 0:a.addressline2,addressType:"",city:(null==e||null===(r=e.address)||void 0===r||null===(d=r.city)||void 0===d?void 0:d.name)||(null==e||null===(u=e.address)||void 0===u||null===(s=u.city)||void 0===s?void 0:s.code),cityCode:(null==e||null===(c=e.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code)||(null==e?void 0:e.tenantId),doorNo:"",houseNo:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo,landmark:null==e||null===(p=e.address)||void 0===p?void 0:p.landmark,locality:(null==Le||null===(f=Le.SVDetail)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.addressDetails)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.locality)||(null==e||null===(y=e.address)||void 0===y||null===(_=y.locality)||void 0===_?void 0:_.i18nKey),localityCode:(null==Le||null===(b=Le.SVDetail)||void 0===b||null===(D=b[0])||void 0===D||null===(A=D.addressDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.localityCode)||(null==e||null===(N=e.address)||void 0===N||null===(T=N.locality)||void 0===T?void 0:T.code),pincode:null==e||null===(I=e.address)||void 0===I?void 0:I.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==e||null===(w=e.correspondenceAddress)||void 0===w?void 0:w.caddressline1,addressLine2:null==e||null===(O=e.correspondenceAddress)||void 0===O?void 0:O.caddressline2,addressType:"",city:(null==e||null===(x=e.correspondenceAddress)||void 0===x||null===(R=x.ccity)||void 0===R?void 0:R.name)||(null==e||null===(L=e.correspondenceAddress)||void 0===L||null===(P=L.ccity)||void 0===P?void 0:P.code),cityCode:(null==e||null===(M=e.correspondenceAddress)||void 0===M||null===(B=M.ccity)||void 0===B?void 0:B.code)||(null==e?void 0:e.tenantId),doorNo:"",houseNo:null==e||null===(k=e.correspondenceAddress)||void 0===k?void 0:k.chouseNo,landmark:null==e||null===(F=e.correspondenceAddress)||void 0===F?void 0:F.clandmark,locality:(null==Le||null===(V=Le.SVDetail)||void 0===V||null===(U=V[0])||void 0===U||null===(H=U.addressDetails)||void 0===H||null===(W=H[1])||void 0===W?void 0:W.locality)||(null==e||null===(j=e.correspondenceAddress)||void 0===j||null===(z=j.clocality)||void 0===z?void 0:z.i18nKey),localityCode:(null==Le||null===(K=Le.SVDetail)||void 0===K||null===(G=K[0])||void 0===G||null===(Y=G.addressDetails)||void 0===Y||null===(q=Y[1])||void 0===q?void 0:q.localityCode)||(null==e||null===(Z=e.correspondenceAddress)||void 0===Z||null===($=Z.clocality)||void 0===$?void 0:$.code),pincode:null==e||null===(X=e.correspondenceAddress)||void 0===X?void 0:X.cpincode,streetName:"",vendorId:"",isAddressSame:null==e||null===(J=e.correspondenceAddress)||void 0===J?void 0:J.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==e||null===(Q=e.bankdetails)||void 0===Q?void 0:Q.accountHolderName,accountNumber:null==e||null===(ee=e.bankdetails)||void 0===ee?void 0:ee.accountNumber,applicationId:"",bankBranchName:null==e||null===(te=e.bankdetails)||void 0===te?void 0:te.bankBranchName,bankName:null==e||null===(ne=e.bankdetails)||void 0===ne?void 0:ne.bankName,id:"",ifscCode:null==e||null===(le=e.bankdetails)||void 0===le?void 0:le.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==e||null===(ie=e.specialCategoryData)||void 0===ie||null===(oe=ie.beneficiary)||void 0===oe?void 0:oe.value,enrollmentId:null==e||null===(ae=e.specialCategoryData)||void 0===ae?void 0:ae.enrollmentId,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==e||null===(re=e.specialCategoryData)||void 0===re||null===(de=re.ownerCategory)||void 0===de?void 0:de.code,draftId:(null==Le||null===(ue=Le.SVDetail)||void 0===ue?void 0:ue.draftId)||"",documentDetails:S(null==e||null===(se=e.documents)||void 0===se?void 0:se.documents),localAuthorityName:null==e||null===(ce=e.businessDetails)||void 0===ce?void 0:ce.nameOfAuthority,tenantId:null==e?void 0:e.tenantId,termsAndCondition:"Y",tradeLicenseNo:null==e||null===(ve=e.owner)||void 0===ve||null===(me=ve.units)||void 0===me||null===(pe=me[0])||void 0===pe?void 0:pe.tradeNumber,vendingActivity:null==e||null===(fe=e.businessDetails)||void 0===fe||null===(Ee=fe.vendingType)||void 0===Ee?void 0:Ee.code,vendingArea:(null==e||null===(ge=e.businessDetails)||void 0===ge?void 0:ge.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:xe,vendingZone:null==e||null===(Se=e.businessDetails)||void 0===Se||null===(he=Se.vendingZones)||void 0===he?void 0:he.code,vendorDetail:[...ye],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}},draftApplication:!1}})(a);c.mutate(e,{onSuccess:r})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(Q,{t:u,data:c.data,isSuccess:c.isSuccess,isLoading:c.isIdle||c.isLoading}),l.createElement(t.StatusTable,null,c.isSuccess&&l.createElement(t.Row,{rowContainerStyle:J,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),c.isSuccess&&l.createElement(t.SubmitBar,{label:u("SV_ACKNOWLEDGEMENT"),onSubmit:function(){try{const{SVDetail:e=[]}=c.data;let t=e||{};const n=p.find(e=>e.code===t.tenantId);return Promise.resolve($(d({},t),n,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},SVApplicationDetails:Ol,SVMyApplications:()=>{var e,a;const{t:r}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.UserService.getUser().info,[c,v]=n.useState(""),[m,p]=n.useState(""),[f,E]=n.useState(null),[g,S]=n.useState([]);let h,y=window.location.href.split("/").pop();h=isNaN(parseInt(y))?4:parseInt(y)+50;let _={limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:u,isDraftApplication:!1,mobileNumber:null==s?void 0:s.mobileNumber};n.useEffect(()=>{E(_)},[y]);const{isLoading:b,data:D}=Digit.Hooks.sv.useSvSearchApplication({filters:d({},f,{isDraftApplication:!1})}),{isLoading:A,data:C}=Digit.Hooks.sv.useSvSearchApplication({filters:d({},f,{isDraftApplication:!0,sortOrder:"DESC"})}),N=null==C||null===(e=C.SVDetail)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.draftId;n.useEffect(()=>{null!=C&&C.SVDetail&&null!=D&&D.SVDetail&&S([...C.SVDetail||[],...D.SVDetail||[]])},[C,D]);const T=e=>{S(t=>t.filter(t=>t!==e))};return b||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,r("SV_MY_APPLICATIONS")+" "+(g?"("+g.length+")":"")),l.createElement(t.Card,null,l.createElement("div",{style:{marginLeft:"16px"}},l.createElement("div",{className:"svsearchbox"},l.createElement("div",{style:{flex:1}},l.createElement("div",{className:"svsearchfield"},l.createElement(t.CardLabel,null,r("SV_APPLICATION_NUMBER")),l.createElement(t.TextInput,{placeholder:r("Enter Application No."),value:c,onChange:e=>v(e.target.value),style:{width:"100%",padding:"8px",height:"150%"}}))),l.createElement("div",{style:{flex:1}},l.createElement("div",{className:"svsearchfield"},l.createElement(t.CardLabel,null,r("SV_REGISTERED_MOB_NUMBER")),l.createElement(t.TextInput,{placeholder:r("Enter Mobile No."),value:m,onChange:e=>p(e.target.value),style:{width:"100%",padding:"8px",height:"150%"}}))),l.createElement("div",null,l.createElement("div",{style:{marginTop:"17%"}},l.createElement(t.SubmitBar,{label:r("ES_COMMON_SEARCH"),onSubmit:()=>{const e=c.trim(),t=d({},_,{applicationNumber:e||null,mobileNumber:m||null});E(t)}}),l.createElement("p",{className:"link svclearall",onClick:()=>{v(""),p("")}},r("ES_COMMON_CLEAR_ALL"))))))),l.createElement("div",null,(null==g?void 0:g.length)>0&&g.map((e,t)=>l.createElement("div",{key:t},l.createElement(xl,{application:e,tenantId:null==s?void 0:s.permanentCity,buttonLabel:r("SV_TRACK"),previousDraftId:N,onDiscard:T}))),!(null!=g&&g.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r("SV_NO_APPLICATION_FOUND_MSG")),0!==(null==g?void 0:g.length)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/citizen/sv/my-applications/"+h},r("SV_LOAD_MORE_MSG")))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r("SV_NO_APPLICATION_FOUND")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(o.Link,{to:"/digit-ui/citizen/sv/apply/info"},r("SV_CLICK_TO_APPLY_NEW_APPLICATION")))))},SvApplicationDetails:()=>{var e,a,r,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T,I;const{t:w}=i.useTranslation(),{applicationNo:O,tenantId:x}=o.useParams(),[R,L]=n.useState(!1),[P,M]=n.useState(!1),[B,k]=n.useState(null),{data:F}=Digit.Hooks.useStore.getInitData(),{tenants:V}=F||{},{isLoading:U,data:H}=Digit.Hooks.sv.useSvSearchApplication({tenantId:x,filters:{applicationNumber:O,isDraftApplication:!1}}),[W,j]=n.useState(null),z=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return pt(e)?e:function(e,t){if(pt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Pl(e))||Bl.test(e)||!Ml.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Wl(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(pt(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(Pl(t))return zl?zl.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[Kl(t[n++])];return n&&n==l?e:void 0}(e,"SVDetail");return void 0===l?[]:l}(H);let K=z&&z.length>0&&z[0]||{};const G=K;sessionStorage.setItem("streetvending",JSON.stringify(G));const[Y,q]=n.useState(!1);n.useEffect(()=>{!function(){try{q(!0),Promise.resolve(Digit.PaymentService.fetchBill(x,{businessService:"sv-services",consumerCode:O})).then(function(e){j(e),q(!1)})}catch(e){return Promise.reject(e)}}()},[x,O]);const{data:Z,isLoading:X}=Digit.Hooks.useRecieptSearch({tenantId:x,businessService:"sv-services",consumerCodes:O,isEmployee:!1},{enabled:!!O});if(K.workflow||(K.workflow={id:null,tenantId:x,businessService:"street-vending",businessId:null==G?void 0:G.applicationNo,action:"",moduleName:"sv-services",state:null,comment:null,documents:null,assignes:null}),U)return l.createElement(t.Loader,null);let J=[];return J.push({label:w("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=G||{},t=V.find(t=>t.code===e.tenantId);return Promise.resolve($(d({},e),t,w)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&J.push({label:w("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;u(e,Gl);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[d({},n)]},"svservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==Z||null===(e=Z.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Z?void 0:Z.Payments[0]})}}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&J.push({label:w("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(x,{SVDetail:[null==H||null===(e=H.SVDetail)||void 0===e?void 0:e[0]]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(x,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&J.push({label:w("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(x,{SVDetail:[null==H||null===(e=H.SVDetail)||void 0===e?void 0:e[0]]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(x,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},w("SV_APPLICATION_DETAILS")),J&&J.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>L(!R),displayOptions:R,options:J})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("SV_APPLICATION_NUMBER"),text:null==K?void 0:K.applicationNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("SV_VENDOR_PERSONAL_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("SV_VENDOR_NAME"),text:(null==K||null===(e=K.vendorDetail)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.name)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_FATHER_NAME"),text:(null==K||null===(r=K.vendorDetail)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.fatherName)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_REGISTERED_MOB_NUMBER"),text:(null==K||null===(c=K.vendorDetail)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.mobileNo)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_DATE_OF_BIRTH"),text:(null==K||null===(m=K.vendorDetail)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.dob)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_EMAIL"),text:(null==K||null===(f=K.vendorDetail)||void 0===f||null===(E=f[0])||void 0===E?void 0:E.emailId)||w("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("SV_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("SV_HOUSE_NO"),text:(null==K||null===(g=K.addressDetails)||void 0===g||null===(S=g[0])||void 0===S?void 0:S.houseNo)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_ADDRESS_LINE1"),text:(null==K||null===(h=K.addressDetails)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.addressLine1)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_ADDRESS_LINE2"),text:(null==K||null===(_=K.addressDetails)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.addressLine2)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_ADDRESS_PINCODE"),text:(null==K||null===(D=K.addressDetails)||void 0===D||null===(A=D[0])||void 0===A?void 0:A.pincode)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_CITY"),text:(null==K||null===(C=K.addressDetails)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.city)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_LOCALITY"),text:(null==K||null===(T=K.addressDetails)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.locality)||w("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("SV_VENDOR_BUSINESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("SV_VENDING_ZONES"),text:(null==K?void 0:K.vendingZone)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_VENDING_TYPE"),text:(null==K?void 0:K.vendingActivity)||w("CS_NA")}),"STATIONARY"===(null==K?void 0:K.vendingActivity)&&l.createElement(t.Row,{className:"border-none",label:w("SV_AREA_REQUIRED"),text:(null==K?void 0:K.vendingArea)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_LOCAL_AUTHORITY_NAME"),text:(null==K?void 0:K.localAuthorityName)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_BENEFICIARY_SCHEMES"),text:(null==K?void 0:K.benificiaryOfSocialSchemes)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_CATEGORY"),text:(null==K?void 0:K.disabilityStatus)||w("CS_NA")})),l.createElement(Ll,{application:G,id:null==G?void 0:G.applicationNo,userType:"citizen"}),B&&l.createElement(t.Toast,{error:B.key,label:w(B.label),style:{bottom:"0px"},onClose:()=>{k(null)}})),P&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:M,setShowToast:k,data:H})))},Caption:Rl,ViewTimeline:Ll,SVSpecialCategory:e=>{var i,o,a,u,s,c,v;let{t:m,config:f,onSelect:E,userType:g,formData:h,editdata:y,previousData:_}=e;const b=Digit.UserService.getUser().info,D=e=>e?{i18nKey:e,code:e,value:e}:null,[A,C]=n.useState((null==h||null===(i=h.specialCategoryData)||void 0===i?void 0:i.ownerCategory)||D((null==_?void 0:_.disabilityStatus)||(null==y?void 0:y.disabilityStatus))||""),[N,T]=n.useState((null==h||null===(o=h.specialCategoryData)||void 0===o?void 0:o.enrollmentId)||(null==_?void 0:_.enrollmentId)||(null==y?void 0:y.enrollmentId)||""),[I,w]=n.useState((null==h||null===(a=h.specialCategoryData)||void 0===a?void 0:a.beneficiary)||D((null==_?void 0:_.benificiaryOfSocialSchemes)||(null==y?void 0:y.benificiaryOfSocialSchemes))||""),O={width:"EMPLOYEE"===b.type?"50%":"100%"},[x,R]=n.useState(null),L=null==_||null===(u=_.documentDetails)||void 0===u?void 0:u.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==A?void 0:A.code)}),P=null==y||null===(s=y.documentDetails)||void 0===s?void 0:s.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==A?void 0:A.code)}),[M,B]=n.useState((null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId)||(null==h||null===(c=h.specialCategoryData)||void 0===c?void 0:c.uploadedFile)||null),[k,F]=n.useState(!1);((null==_||null===(v=_.draftId)||void 0===v?void 0:v.length)>0||null!=y&&y.applicationNo)&&sessionStorage.setItem("CategoryDocument",JSON.stringify([{documentType:(null==_?void 0:_.disabilityStatus)||(null==y?void 0:y.disabilityStatus),documentUid:(null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId),fileStoreId:(null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId)}]));const[V,U]=n.useState(null),{control:H}=r.useForm(),{data:W}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"PropertyTax",[{name:"OwnerType"}],{select:e=>{var t;return null==e||null===(t=e.PropertyTax)||void 0===t?void 0:t.OwnerType}});let j=[];W&&W.map(e=>{j.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:z}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"Schemes"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.Schemes}});let K=[];z&&z.map(e=>{K.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),n.useEffect(()=>{x&&(x.size>=5242880?setError(m("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")):(B(null),F(!0),Digit.UploadServices.Filestorage("StreetVending",x,Digit.ULBService.getStateId()).then(e=>{var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){const t=[{documentType:null==A?void 0:A.code,documentUid:e.data.files[0].fileStoreId,fileStoreId:e.data.files[0].fileStoreId}];B(e.data.files[0].fileStoreId),sessionStorage.setItem("CategoryDocument",JSON.stringify(t))}else setError(m("CS_FILE_UPLOAD_ERROR"))}).catch(()=>setError(m("CS_FILE_UPLOAD_ERROR"))).finally(()=>{F(!1)})))},[x,m]);const G=()=>{let e=d({},h.specialCategoryData,{ownerCategory:A,beneficiary:I,uploadedFile:M,enrollmentId:N});E(f.key,e,!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,y,b,D,C,T,w,O,x,R,L,P,M,B,k,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J;let Q=[],ee=Digit.ULBService.getCitizenCurrentTenant(!0);const te=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},ne=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},le=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},ie=e=>!e||""===e.trim();if(!ie(null==h||null===(e=h.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var oe,ae,re,de,ue,se;const e=null==h||null===(oe=h.owner)||void 0===oe||null===(ae=oe.units)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.spouseName,t=null==h||null===(de=h.owner)||void 0===de||null===(ue=de.units)||void 0===ue||null===(se=ue[0])||void 0===se?void 0:se.dependentName;ie(e)&&ie(t)?Q=[te(h)]:!ie(e)&&ie(t)?Q=[te(h),ne(h)]:ie(e)||ie(t)||(Q=[te(h),ne(h),le(h)])}const ce=(null==h||null===(l=h.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),ve=sessionStorage.getItem("Response"),me=JSON.parse(ve);let pe={addressDetails:[{addressId:"",addressLine1:null==h||null===(i=h.address)||void 0===i?void 0:i.addressline1,addressLine2:null==h||null===(o=h.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==h||null===(a=h.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==h||null===(d=h.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==h||null===(s=h.address)||void 0===s?void 0:s.houseNo,landmark:null==h||null===(c=h.address)||void 0===c?void 0:c.landmark,locality:null==h||null===(v=h.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.i18nKey,localityCode:null==h||null===(p=h.address)||void 0===p||null===(f=p.locality)||void 0===f?void 0:f.code,pincode:null==h||null===(E=h.address)||void 0===E?void 0:E.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==h||null===(g=h.correspondenceAddress)||void 0===g?void 0:g.caddressline1,addressLine2:null==h||null===(y=h.correspondenceAddress)||void 0===y?void 0:y.caddressline2,addressType:"",city:null==h||null===(b=h.correspondenceAddress)||void 0===b||null===(D=b.ccity)||void 0===D?void 0:D.name,cityCode:null==h||null===(C=h.correspondenceAddress)||void 0===C||null===(T=C.ccity)||void 0===T?void 0:T.code,doorNo:"",houseNo:null==h||null===(w=h.correspondenceAddress)||void 0===w?void 0:w.chouseNo,landmark:null==h||null===(O=h.correspondenceAddress)||void 0===O?void 0:O.clandmark,locality:null==h||null===(x=h.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.i18nKey,localityCode:null==h||null===(L=h.correspondenceAddress)||void 0===L||null===(P=L.clocality)||void 0===P?void 0:P.code,pincode:null==h||null===(M=h.correspondenceAddress)||void 0===M?void 0:M.cpincode,streetName:"",vendorId:"",isAddressSame:null==h||null===(B=h.correspondenceAddress)||void 0===B?void 0:B.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==h||null===(k=h.bankDetails)||void 0===k?void 0:k.accountHolderName,accountNumber:null==h||null===(F=h.bankDetails)||void 0===F?void 0:F.accountNumber,applicationId:"",bankBranchName:null==h||null===(V=h.bankDetails)||void 0===V?void 0:V.bankBranchName,bankName:null==h||null===(U=h.bankDetails)||void 0===U?void 0:U.bankName,id:"",ifscCode:null==h||null===(H=h.bankDetails)||void 0===H?void 0:H.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==I?void 0:I.value,enrollmentId:N,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==A?void 0:A.code,draftId:(null==_?void 0:_.draftId)||(null==me||null===(W=me.SVDetail)||void 0===W?void 0:W.draftId),documentDetails:S(null==h||null===(j=h.documents)||void 0===j?void 0:j.documents),localAuthorityName:null==h||null===(z=h.businessDetails)||void 0===z?void 0:z.nameOfAuthority,tenantId:ee,termsAndCondition:"Y",tradeLicenseNo:null==h||null===(K=h.owner)||void 0===K||null===(G=K.units)||void 0===G||null===(Y=G[0])||void 0===Y?void 0:Y.tradeNumber,vendingActivity:null==h||null===(q=h.businessDetails)||void 0===q||null===(Z=q.vendingType)||void 0===Z?void 0:Z.code,vendingArea:(null==h||null===($=h.businessDetails)||void 0===$?void 0:$.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:ce,vendingZone:null==h||null===(X=h.businessDetails)||void 0===X||null===(J=X.vendingZones)||void 0===J?void 0:J.code,vendorDetail:[...Q],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:pe,draftApplication:!0},ee).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()};n.useEffect(()=>{if(V){const e=setTimeout(()=>{U(null)},2e3);return()=>clearTimeout(e)}},[V]),n.useEffect(()=>{"citizen"===g&&G()},[A,I]);const Y=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement(l.Fragment,null,l.createElement(p,{currentStep:6}),l.createElement("div",null,l.createElement(t.FormStep,{config:f,onSelect:G,onSkip:()=>E(),t:m,isDisabled:!A},l.createElement("div",null,l.createElement(t.CardLabel,null,""+m("SV_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:H,name:"ownerCategory",defaultValue:A,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:A,select:C,option:j,style:O,optionKey:"i18nKey",t:m,placeholder:"Select"})}),A&&"NONE"!==(null==A?void 0:A.code)&&l.createElement("div",{className:"field",style:{marginRight:"EMPLOYEE"===(null==b?void 0:b.type)?"50%":null,marginBottom:"10px"}},l.createElement(t.UploadFile,{onUpload:e=>{R(e.target.files[0])},onDelete:()=>{B(null)},id:"SV",message:k?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(Y,null),l.createElement("span",null,"Uploading...")):M?"1 File Uploaded":"No File Uploaded",accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!M})),l.createElement(t.CardLabel,null,""+m("SV_BENEFICIARY_SCHEMES")),l.createElement(r.Controller,{control:H,name:"beneficiary",defaultValue:I,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:I,select:w,style:O,optionCardStyles:{overflowY:"auto",maxHeight:"315px"},option:K,optionKey:"i18nKey",t:m,placeholder:"Select"})}),I&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+m("SV_ENROLLMENT_APPLICATION_NUMBER")),l.createElement(t.TextInput,d({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"enrollmentId",value:N,onChange:function(e){T(e.target.value)},style:O,ValidationRequired:!1},{isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]*$",type:"text",title:m("SV_INPUT_DID_NOT_MATCH")}))))),V&&l.createElement(t.Toast,{error:V.error,warning:V.warning,label:m(V.label),onClose:()=>{U(null)}})))}},ql=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:d}=o.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"SV",language:u}),Object.entries(Yl).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("SV_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(V,{path:r,url:d,userType:i}):l.createElement(v,null)},Zl=e=>{let{matchPath:o}=e;const{t:a}=i.useTranslation(),[r,d,u]=Digit.Hooks.useSessionStorage("SV",{});n.useEffect(()=>{u()},[]);const s=[{link:o+"/sv/apply",i18nKey:a("sv_APPLY")},{link:o+"/sv/my-applications",i18nKey:a("sv_MY_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:a("STREET_VENDING_SERVICES"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.SVComponents={SVModule:ql,SVLinks:Zl,SVCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("0"),{data:r,isLoading:d,isFetching:u,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"SV",filters:{limit:10,offset:0,services:["street-vending"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.svAccess()}});if(n.useEffect(()=>{!u&&s&&a(r)},[u]),!Digit.Utils.svAccess())return null;const c=[{count:d?"-":null==o?void 0:o.totalCount,label:e("SV_INBOX"),link:"/digit-ui/employee/sv/inbox"},{label:e("SV_CREATE_APPLICATION"),link:"/digit-ui/employee/sv/apply"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/sv/my-applications"}],v=Digit.UserService.hasAccess(["SV_VENDOR"])||!1,m={Icon:l.createElement(t.PropertyHouse,null),moduleName:l.createElement("div",{style:{width:"200px",wordWrap:"break-word"}},e("MODULE_SV")),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/sv/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,m)},SV_INBOX_FILTER:e=>l.createElement(q,e),SVInboxTableConfig:e=>({SV:{inboxColumns:t=>[{Header:e("SV_APPLICATION_NUMBER"),Cell:e=>{var n,i,a,r;let{row:d}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/application-details/"+(null==d||null===(n=d.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.applicationNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.applicationNo)))},mobileCell:e=>{var t;return H(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationNumber)}},{Header:e("SV_VENDOR_NAME"),Cell:e=>{var t,n,l,i,o;return U(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.vendorDetail[0])||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return H(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.vendorDetail[0])||void 0===n?void 0:n.name)}},{Header:e("SV_VENDING_TYPE"),Cell:e=>{var t,n,l,i;return U(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.vendingActivity))},mobileCell:e=>{var t;return H(null==e||null===(t=e.searchData)||void 0===t?void 0:t.vendingActivity)}},{Header:e("SV_VENDING_ZONES"),Cell:e=>{var t,n,l,i;return U(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.vendingZone))},mobileCell:e=>{var t;return H(null==e||null===(t=e.searchData)||void 0===t?void 0:t.vendingZone)}},{Header:e("SV_APPLICATION_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return U(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return H(e("ES_SV_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("SV_INBOX_UNIQUE_APPLICATION_NUMBER")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.SVLinks=Zl,exports.SVModule=ql;
1
+ var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),a=require("react-query"),r=require("react-hook-form");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 u(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 s=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"SVRequiredDoc",nextStep:"applicant-details",key:"Documents"},{route:"applicant-details",component:"SVApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"business-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_VENDOR_PERSONAL_DETAILS"}},{route:"business-details",component:"SVBusinessDetails",withoutLabel:!0,key:"businessDetails",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_VENDOR_BUSINESS_DETAILS"}},{route:"address-details",component:"SVAdrressDetails",withoutLabel:!0,key:"address",type:"component",nextStep:"correspondence-address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_ADDRESS_DETAILS"}},{route:"correspondence-address-details",component:"SVAdrressDetails",withoutLabel:!0,key:"correspondenceAddress",type:"component",nextStep:"bank-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_CORRESPONDENCE_ADDRESS_DETAILS"}},{route:"bank-details",component:"SVBankDetails",withoutLabel:!0,key:"bankdetails",type:"component",nextStep:"document-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_BANK_DETAILS"}},{route:"document-details",component:"SVDocumentsDetail",type:"component",nextStep:"special-category",isMandatory:!0,key:"documents",texts:{header:"SV_DOCUMENT_DETAILS_LABEL",submitBarLabel:"COMMON_SAVE_NEXT"}},{route:"special-category",component:"SVSpecialCategory",withoutLabel:!0,key:"specialCategoryData",type:"component",nextStep:null,hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"SV_SPECIAL_CATEGORY_DETAILS"}}]}],c=["path","url"],v=()=>{var e,n,i,a,r,d;const s=o.useRouteMatch(),{path:v}=s,m=(u(s,c),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("Create")),p=null===(i=Digit)||void 0===i||null===(a=i.ComponentRegistryService)||void 0===a?void 0:a.getComponent("SVMyApplications"),f=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("SvApplicationDetails");return l.createElement("span",{className:"sv-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(t.PrivateRoute,{path:v+"/apply",component:m}),l.createElement(t.PrivateRoute,{path:v+"/edit",component:m}),l.createElement(t.PrivateRoute,{path:v+"/my-applications",component:p}),l.createElement(t.PrivateRoute,{path:v+"/application/:applicationNo/:tenantId",component:f}))))};let m=["SV_VENDOR_PERSONAL_DETAILS","SV_VENDOR_BUSINESS_DETAILS","SV_ADDRESS_DETAILS","SV_BANK_DETAILS","SV_DOCUMENT_DETAILS_LABEL","SV_SPECIAL_CATEGORY","SV_SUMMARY_PAGE"];const p=e=>{let{currentStep:n=1}=e;const{t:o}=i.useTranslation(),a=Digit.UserService.getUser().info,r=window.Digit.Utils.browser.isMobile();return l.createElement("div",{className:"timeline-container",style:r?{}:"EMPLOYEE"===(null==a?void 0:a.type)?{maxWidth:"960px",minWidth:"640px",marginRight:"auto",marginLeft:"auto",display:"flex",justifyContent:"center"}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto",display:"flex",justifyContent:"center"}},m.map((e,i,a)=>l.createElement("div",{className:"timeline-checkpoint",key:i},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(i<=n-1&&"active")},i<n-1?l.createElement(t.TickMark,null):i+1),l.createElement("span",{className:"secondary-color"},o(e))),i<a.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))},f=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},E=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},g=function(e,t){let n=[];if((null==e?void 0:e.length)>0){let t=e.filter((t,n)=>e.findIndex(e=>{var n,l,i,o,a,r;return(null==e||null===(n=e.documentType)||void 0===n||null===(l=n.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))===(null==t||null===(o=t.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))})===n);null==t||t.map(t=>{var l,i,o,a;const r=null==e?void 0:e.filter(e=>{var n,l,i,o,a,r;return(null==t||null===(n=t.documentType)||void 0===n||null===(l=n.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))==(null==e||null===(o=e.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))});null==r||r.forEach(e=>e.title=e.documentType),n.push({title:null==r||null===(l=r[0])||void 0===l||null===(i=l.documentType)||void 0===i||null===(o=i.split("."))||void 0===o||null===(a=o.slice(0,2))||void 0===a?void 0:a.join("_"),values:r})})}return n},S=e=>{if(!Array.isArray(e))return[];const t=sessionStorage.getItem("CategoryDocument"),n=t?JSON.parse(t):null,l=e.map(e=>{var t,n;return{applicationId:"",documentType:e.documentType,fileStoreId:window.location.href.includes("edit")?null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId:e.fileStoreId,documentDetailId:window.location.href.includes("edit")?null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId:e.documentUid,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}}});var i,o,a;return n&&l.push({applicationId:"",documentType:(null==n||null===(i=n[0])||void 0===i?void 0:i.documentType)||"",fileStoreId:(null==n||null===(o=n[0])||void 0===o?void 0:o.fileStoreId)||"",documentDetailId:(null==n||null===(a=n[0])||void 0===a?void 0:a.documentUid)||"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}}),l};function h(e){let{documents:t,isSendBackFlow:n=!1,isHrLine:o=!1}=e;const{t:a}=i.useTranslation(),r=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{width:"24",height:"24",rx:"4",fill:"#D32F2F"}),l.createElement("text",{x:"0",y:"16","font-family":"Arial, sans-serif","font-size":"12","font-weight":"bold",fill:"#FFFFFF"},"PDF"));return l.createElement("div",{style:{marginTop:"19px"}},null==t?void 0:t.map((e,i)=>{var d;return l.createElement(l.Fragment,{key:i},l.createElement("div",{className:"documentWidth",style:{width:"50%"}},l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(d=e.values)||void 0===d?void 0:d.map((e,t)=>{var i;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:t},l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"8px"}},l.createElement("p",{style:{margin:0,fontWeight:"bold",color:"#0000FF",textDecoration:"underline"}},a(null==e?void 0:e.title)),l.createElement(r,null)," "),n?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},a(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},a(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,a("SV_NO_DOCUMENTS_UPLOADED_LABEL")))),o&&(null==t?void 0:t.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))}))}const y=e=>{var i;let{t:o,onSelect:a,formData:r={},handleRemove:d,onSave:u}=e;const[s,c]=n.useState((null==r||null===(i=r.address)||void 0===i?void 0:i.location)||{}),v=Digit.Hooks.obps.useTenants();Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let m=!Digit.Utils.browser.isMobile();return l.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"21px",left:"0"}},l.createElement("div",{style:{position:"relative",marginTop:"60px"}},l.createElement("div",{style:m?{marginLeft:"25%",marginRight:"25%"}:{}},l.createElement(t.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:o("SV_GIS_LABEL"),cardText:o(""),nextText:o("SV_PIN_LOCATION_LABEL"),skip:()=>a(),t:o,position:s,onSave:()=>u(s),onChange:(e,t)=>((e,t)=>{const n=null==v?void 0:v.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==e)});c(n?t:{})})(e,t),disabled:!1,isPlaceRequired:!0,handleRemove:d,Webview:m,isPopUp:!0}))))},b=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:d,onSort:u,onNextPage:s,onPrevPage:c,onPageSizeChange:v,pageSizeLimit:m,sortParams:p,totalRecords:f,styles:E,isPaginationRequired:g}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:s,onPrevPage:c,pageSizeLimit:m,disableSort:d,onPageSizeChange:v,onSort:u,sortParams:p,totalRecords:f,styles:E,isPaginationRequired:g})};function D(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function A(e){var i,o,a;let{t:r,document:u,setDocuments:s,setError:c,documents:v,id:m,editdata:p,previousData:f}=e;const E=null==v?void 0:v.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}),g=null==f||null===(i=f.documentDetails)||void 0===i?void 0:i.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}),S=null==p||null===(o=p.documentDetails)||void 0===o?void 0:o.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}),h=Digit.UserService.getUser().info,y=e=>e?d({},e,{active:!0===(null==u?void 0:u.active),code:null==e?void 0:e.documentType,i18nKey:null==e?void 0:e.documentType}):null,_=y(g)||y(S)||y(E)||(1===(null==u||null===(a=u.dropdownData)||void 0===a?void 0:a.length)?null==u?void 0:u.dropdownData[0]:{}),[b,D]=n.useState(_),[A,C]=n.useState(null),[N,T]=n.useState((null==_?void 0:_.fileStoreId)||null),[I,O]=n.useState(!1);n.useEffect(()=>{var e;const t=(null==f?void 0:f.documentDetails)||(null==p?void 0:p.documentDetails)||[];null==t||null===(e=t.documentDetails)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==u?void 0:u.code)&&T(e)})},[null==p?void 0:p.documentDetails,null==f?void 0:f.documentDetails,null==u?void 0:u.code]),n.useEffect(()=>{A&&(A.size>=5242880?c(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")):(T(null),O(!0),Digit.UploadServices.Filestorage("StreetVending",A,Digit.ULBService.getStateId()).then(e=>{var t,n;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(e.data.files[0].fileStoreId):c(r("CS_FILE_UPLOAD_ERROR"))}).catch(()=>c(r("CS_FILE_UPLOAD_ERROR"))).finally(()=>{O(!1)})))},[A,r]),n.useEffect(()=>{var e;null!=b&&b.code&&(null==f||null===(e=f.draftId)||void 0===e?void 0:e.length)>1?s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==b?void 0:b.code));return N?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==N),{documentType:null==b?void 0:b.code,fileStoreId:N,documentUid:N}]:t}):null!=b&&b.code&&null!=p&&p.applicationNo?s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==b?void 0:b.code));return N?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==N),{documentType:null==b?void 0:b.code,fileStoreId:N,documentUid:N}]:t}):null!=b&&b.code&&s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==b?void 0:b.code));return N?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==N),{documentType:null==b?void 0:b.code,fileStoreId:N,documentUid:N}]:t})},[N,b,s]);const{dropdownData:w}=u;let x=w;const R=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement("div",{style:{marginBottom:"24px"}},(null==u?void 0:u.hasDropdown)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},r(null==u?void 0:u.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{D(e)},style:{width:"EMPLOYEE"===(null==h?void 0:h.type)?"50%":"100%"},option:x.map(e=>{var t;return d({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),optionKey:"i18nKey",t:r,placeholder:"Select"})),l.createElement(t.LabelFieldPair,null,l.createElement("div",{className:"field",style:{marginLeft:"EMPLOYEE"===(null==h?void 0:h.type)?"30%":null}},l.createElement(t.UploadFile,{onUpload:e=>{C(e.target.files[0])},onDelete:()=>{T(null)},id:m,message:I?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(R,null),l.createElement("span",null,"Uploading...")):N?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!N}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const C=e=>{let{jumpTo:n}=e;i.useTranslation();const a=o.useHistory();return l.createElement(t.LinkButton,{label:l.createElement(t.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){a.push(n)}})},N={date:t.DatePicker,mobileNumber:t.MobileNumber},T=e=>{var n;let{onSearch:o,type:a,onClose:u,searchFields:s,searchParams:c,isInboxPage:v,clearSearch:m}=e;const{t:p}=i.useTranslation(),{handleSubmit:f,reset:E,watch:g,control:S,formState:h,setValue:y}=r.useForm({defaultValues:v?c:d({locality:null,city:null},c)}),_=g(),b=innerWidth<=640;function D(){const e=s.reduce((e,t)=>d({},e,{[null==t?void 0:t.name]:""}),{});if(E(e),v){const e=d({},c);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(d({},e))}else m()}const A=e=>l.createElement(t.LinkLabel,{style:d({display:"inline",margin:"10px"},e?{margin:0}:{}),onClick:D},p("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:f(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===a&&u()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:v?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===a||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,p("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:u},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(v?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,a;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,p(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(r.Controller,e.type?{render:t=>l.createElement(null==N?void 0:N[e.type],{formValue:_,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:S,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:S,defaultValue:""})),null!=h&&null!==(i=h.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==h||null===(o=h.errors)||void 0===o||null===(a=o[e.name])||void 0===a?void 0:a.message):null)}),v&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,A())),"desktop"===a&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:p("ES_COMMON_SEARCH"),disabled:!!Object.keys(h.errors).length||(()=>{var e;let t=!0;return Object.keys(_).forEach(e=>{!["locality","city"].includes(e)&&_[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=_&&null!==(e=_.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!v&&l.createElement("div",null,A()))))),("mobile"===a||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},A(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(h.errors).length,label:p("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},I=["tableConfig","filterComponent"],O=e=>{let{tableConfig:o,filterComponent:a}=e,r=u(e,I);const{data:d,useNewInboxAPI:s}=r,{t:c}=i.useTranslation(),[v,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r.EmptyResultInboxComp)}),[E,g]=n.useState(!1),S=l.useMemo(()=>r.isSearch?o.searchColumns(r):o.inboxColumns(r)||[],[]);let h;return r.isLoading?h=l.createElement(t.Loader,null):E?h=null:!d||0===(null==d?void 0:d.length)||s&&null!=d&&d[0].dataEmpty?h=p&&l.createElement(p,{data:d})||(0===(null==d?void 0:d.length)||s&&null!=d&&d[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==d?void 0:d.length)>0&&(h=l.createElement(b,{t:c,data:d,columns:S,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:r.onPageSizeChange,currentPage:r.currentPage,onNextPage:r.onNextPage,onPrevPage:r.onPrevPage,pageSizeLimit:r.pageSizeLimit,onSort:r.onSort,disableSort:r.disableSort,sortParams:r.sortParams,totalRecords:r.totalRecords})),l.createElement("div",{className:"inbox-container"},!r.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement("div",null,l.createElement(v,{defaultSearchParams:r.defaultSearchParams,onFilterChange:r.onFilterChange,searchParams:r.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==d?void 0:d[0].statusMap:null,moduleCode:r.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(T,{defaultSearchParams:r.defaultSearchParams,onSearch:e=>{r.onSearch(e),g(!1)},type:"desktop",searchFields:r.searchFields,isInboxPage:!(null!=r&&r.isSearch),searchParams:r.searchParams,clearSearch:()=>g(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=r&&r.isSearch?"":"24px",flex:1}},h)))},w=e=>{const{t:o}=i.useTranslation(),[a,r]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function d(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:d},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:d},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},x=e=>{let{t:i,data:o,onFilterChange:a,onSearch:r,onSort:d,serviceRequestIdKey:u,isFstpOperator:s,isLoading:c,isSearch:v,searchParams:m,searchFields:p,sortParams:f,linkPrefix:E,filterComponent:g}=e;const[S,h]=n.useState(v?"SEARCH":""),[y,_]=n.useState(!!v),[b,D]=n.useState(f),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{S&&_(!0)},[S]);const C=()=>{_(!1),h(""),D(f)};if(c)return l.createElement(t.Loader,null);let N;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(N=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:u,linkPrefix:E||"/digit-ui/employee/sv/"})):N=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},r&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{h("SEARCH"),_(!0)}}),!v&&a&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{h("FILTER"),_(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{h("SORT"),_(!0)}})),N,y&&l.createElement(t.PopUp,null,"FILTER"===S&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{a(e),_(!1)},Close:C,type:"mobile",searchParams:m})),"SORT"===S&&l.createElement("div",{className:"popup-module"},l.createElement(w,{type:"mobile",sortParams:f,onClose:C,onSort:d})),"SEARCH"===S&&l.createElement("div",{className:"popup-module"},l.createElement(T,{type:"mobile",onClose:C,onSearch:r,isFstpOperator:s,searchParams:m,searchFields:p}))))},R=e=>{let{classNameForMobileView:a=""}=e;const{t:r}=i.useTranslation(),d=[{text:r("SV_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/sv/apply"}],[u,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];d.forEach(t=>{var n;t.accessTo?(n=t.accessTo,c.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+a},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},r("ES_TITLE_SV_REGISTRATION"))),l.createElement("div",{className:"body"},u.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},L=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:a,onFilterChange:r,onSearch:d,onSort:u,parentRoute:s,searchParams:c,sortParams:v,linkPrefix:m,tableConfig:p,filterComponent:f}=e;const{t:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(R,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(x,{t:E,data:null==t?void 0:t.map(e=>{const t={};return(o?p.searchColumns():p.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:r,isLoading:n,isSearch:o,onSearch:d,onSort:u,searchParams:c,searchFields:a,linkPrefix:m,sortParams:v,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:f}))))},P=["isFetching","isLoading","searchResponseKey","data","searchFields"],M=e=>{var o,a,r,s,c;let{useNewInboxAPI:v,parentRoute:m,moduleCode:p="SV",initialStates:f={},filterComponent:E,isInbox:g,rawWfHandler:S,rawSearchHandler:h,combineResponse:y,wfConfig:_,searchConfig:b,middlewaresWf:D,middlewareSearch:A,EmptyResultInboxComp:C}=e;const N=Digit.ULBService.getCurrentTenantId(),{t:T}=i.useTranslation(),[I,w]=n.useState(()=>g?{}:{enabled:!1}),[x,R]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("SVInboxTableConfig")}),[M,k]=n.useState(f.pageOffset||0),[B,F]=n.useState(f.pageSize||10),[V,U]=n.useState(f.sortParams||[{id:"createdTime",desc:!0}]),[H,W]=n.useState(f.searchParams||{});let j=window.Digit.Utils.browser.isMobile(),z=j?{limit:100,offset:0,sortBy:null==V||null===(o=V[0])||void 0===o?void 0:o.id,sortOrder:null!=V&&null!==(a=V[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:B,offset:M,sortBy:null==V||null===(r=V[0])||void 0===r?void 0:r.id,sortOrder:null!=V&&null!==(s=V[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const K=v?Digit.Hooks.useNewInboxGeneral({tenantId:N,ModuleCode:p,filters:d({},H,z,{sortParams:V})}):Digit.Hooks.useInboxGeneral({tenantId:N,businessService:p,isInbox:g,filters:d({},H,z,{sortParams:V}),rawWfHandler:S,rawSearchHandler:h,combineResponse:y,wfConfig:_,searchConfig:d({},I,b),middlewaresWf:D,middlewareSearch:A}),{isLoading:G,data:Y,searchFields:q}=K,Z=u(K,P);n.useEffect(()=>{k(0)},[H]);const $=e=>{let t=e.delete,n=d({},H,e);t&&t.forEach(e=>delete n[e]),delete e.delete,W(d({},n)),w({enabled:!0})},X=n.useCallback(e=>{0!==e.length&&U(e)},[]);var J;if(null!==(null==Z||null===(c=Z.data)||void 0===c?void 0:c.length))return j?l.createElement(L,{data:Y,isLoading:G,isSearch:!g,searchFields:q,onFilterChange:$,onSearch:$,onSort:X,parentRoute:m,searchParams:H,sortParams:V,linkPrefix:m+"/application-details/",tableConfig:null!=Z&&Z.tableConfig?null==Z?void 0:Z.tableConfig:x(T).SV,filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:v}):l.createElement("div",null,g&&l.createElement(t.Header,null,T("ES_COMMON_INBOX")),l.createElement(O,{moduleCode:p,data:Y,tableConfig:x(T).SV,isLoading:G,defaultSearchParams:f.searchParams,isSearch:!g,onFilterChange:$,searchFields:q,onSearch:$,onSort:X,onNextPage:()=>{k(e=>e+B)},onPrevPage:()=>{k(e=>e-B)},currentPage:Math.floor(M/B),pageSizeLimit:B,disableSort:!1,onPageSizeChange:e=>{F(Number(e.target.value))},parentRoute:m,searchParams:H,sortParams:V,totalRecords:Number(null==Y||null===(J=Y[0])||void 0===J?void 0:J.totalCount),filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:v}))},k=e=>{var i,a;let{isLoading:d,t:u,onSubmit:s,data:c,count:v,setShowToast:m}=e;const p=window.Digit.Utils.browser.isMobile(),f=(new Date).toISOString().split("T")[0],{register:E,control:g,handleSubmit:S,setValue:h,getValues:y,reset:_,formState:b}=r.useForm({defaultValues:{offset:0,limit:!p&&10,sortBy:"commencementDate",sortOrder:"DESC",isDraftApplication:"false",fromDate:f,toDate:f}});n.useEffect(()=>{E("offset",0),E("limit",10),E("sortBy","commencementDate"),E("sortOrder","DESC"),E("isDraftApplication","false"),h("fromDate",f),h("toDate",f)},[E,h,f]);const{data:D}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingActivityType"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingActivityType}});let A=[];D&&D.map(e=>{A.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:C}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingZones"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingZones}});let N=[];C&&C.map(e=>{N.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Digit.ULBService.getStateId();const T=e=>l.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:u("SV_APPLICATION_NUMBER"),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/sv/applicationsearch/application-details/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:u("SV_VENDOR_NAME"),Cell:e=>{var t,n,l;return T(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(l=n.vendorDetail[0])||void 0===l?void 0:l.name))},disableSortBy:!0},{Header:u("SV_VENDING_TYPE"),Cell:e=>{var t,n;return T(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.vendingActivity))},disableSortBy:!0},{Header:u("SV_VENDING_ZONES"),Cell:e=>{var t,n;return T(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.vendingZone))},disableSortBy:!0},{Header:u("SV_REGISTERED_MOB_NUMBER"),Cell:e=>{var t,n;let{row:l}=e;return T(""+(null==l||null===(t=l.original)||void 0===t||null===(n=t.vendorDetail[0])||void 0===n?void 0:n.mobileNo))},disableSortBy:!0},{Header:u("SV_APPLICATION_STATUS"),Cell:e=>{var t;let{row:n}=e;return T(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.applicationStatus))},disableSortBy:!0}],[]),O=n.useCallback(e=>{0!==e.length&&(h("sortBy",e.id),h("sortOrder",e.desc?"DESC":"ASC"))},[]);function w(){h("offset",y("offset")-y("limit")),S(s)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,u("SV_SEARCH_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},u("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:s,handleSubmit:S},l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:E({})})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_VENDING_TYPE")),l.createElement(r.Controller,{control:g,name:"vendingType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:A,optionKey:"i18nKey",t:u,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_VENDING_ZONES")),l.createElement(r.Controller,{control:g,name:"vendingZone",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:u,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_REGISTERED_MOB_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:E({minLength:{value:10,message:u("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:u("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:u("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==b||null===(i=b.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:f}),name:"fromDate",control:g})),l.createElement(t.SearchField,null,l.createElement("label",null,u("SV_TO_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:f}),name:"toDate",control:g})),l.createElement(t.SearchField,null),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:u("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{_({applicationNumber:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),m(null),w()}},u("ES_COMMON_CLEAR_ALL")))),!d&&null!=c&&c.display?l.createElement(t.Card,{style:{marginTop:20}},u(c.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):d||""===c?""!==c||d&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:u,data:c,totalRecords:v,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===u("SV_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){h("limit",Number(e.target.value)),S(s)()},currentPage:y("offset")/y("limit"),onNextPage:function(){h("offset",y("offset")+y("limit")),S(s)()},onPrevPage:w,pageSizeLimit:y("limit"),onSort:O,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},B=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[c,v]=n.useState(null),m={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:p,isSuccess:f,data:{SVDetail:E,count:g}={}}=Digit.Hooks.sv.useSvSearchApplication({tenantId:r,filters:u},m);return l.createElement(l.Fragment,null,l.createElement(k,{t:a,isLoading:p,tenantId:r,setShowToast:v,onSubmit:function(e){var t=new Date(null==e?void 0:e.fromDate);null==t||t.setSeconds((null==t?void 0:t.getSeconds())-19800);var n=new Date(null==e?void 0:e.toDate);null==n||n.setSeconds((null==n?void 0:n.getSeconds())+86399-19800);const l=d({},e,e.toDate?{toDate:null==n?void 0:n.getTime()}:{},e.fromDate?{fromDate:null==t?void 0:t.getTime()}:{});let i=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>d({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.entries(i).length>0)||i.applicationNumber||i.fromDate||i.mobileNumber||i.vendingType||i.toDate||i.vendingZone?Object.entries(i).length>0&&i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):v({warning:!0,label:"ERR_SV_FILL_VALID_FIELDS"})},data:f&&!p?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:g}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:a(c.label),isDleteBtn:!0,onClose:()=>{v(null)}}))},F=["path","url"],V=()=>{var e,n,a,r;console.log("coming here");const s=o.useRouteMatch(),{path:c}=s,v=(u(s,F),i.useTranslation(),o.useLocation(),{searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["street-vending"],status:null,vendingType:null,vendingZone:null}}),m=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("SVEmpCreate"),p=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("SVApplicationDetails");return l.createElement("span",{className:"sv-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,{style:{marginTop:"15px"}},"Back"),l.createElement(t.PrivateRoute,{path:c+"/apply",component:m}),l.createElement(t.PrivateRoute,{path:c+"/inbox",component:()=>l.createElement(M,{useNewInboxAPI:!0,parentRoute:c,businessService:"sv",filterComponent:"SV_INBOX_FILTER",initialStates:v,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:c+"/application-details/:id",component:()=>l.createElement(p,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/applicationsearch/application-details/:id",component:()=>l.createElement(p,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/my-applications",component:e=>l.createElement(B,d({},e,{parentRoute:c}))}))))},U=e=>l.createElement("span",{className:"cell-text"},e),H=e=>l.createElement("span",{className:"sla-cell"},e),W=e=>{var n;let{status:o,searchParams:a,onAssignmentChange:r,statusMap:u}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>r(d({},e,{state:o.state}),o),checked:null==a?void 0:a.applicationStatus.some(e=>e.uuid===o.uuid),label:o.name+" ("+((null==u||null===(n=u.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-")+")"})},j=e=>{var o,a,r,u,s;let{onAssignmentChange:c,searchParams:v,businessServices:m,statusMap:p}=e;const{t:f}=i.useTranslation(),[E,g]=n.useState(!1),{data:S,isLoading:h}=Digit.Hooks.useApplicationStatusGeneral({businessServices:m},{}),{userRoleStates:y}=S||{},_=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_SV_COMMON_STATUS_"+(e.state||"CREATED"));return h?l.createElement(t.Loader,null):null!=y&&y.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_INBOX_STATUS")),null==y||null===(o=y.filter(e=>!e.isTerminateState))||void 0===o||null===(a=o.slice(0,4))||void 0===a?void 0:a.map((e,t)=>l.createElement(W,{businessServices:m,key:t,onAssignmentChange:c,status:d({name:_(e,f),code:e.applicationStatus},e),searchParams:v,statusMap:p})),(null==y||null===(r=y.filter(e=>!e.isTerminateState))||void 0===r?void 0:r.slice(4).length)>0?l.createElement(l.Fragment,null,E&&(null==y||null===(u=y.filter(e=>!e.isTerminateState))||void 0===u||null===(s=u.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement(W,{businessServices:m,key:e.uuid,onAssignmentChange:c,status:d({name:_(e,f),code:e.applicationStatus},e),searchParams:v,statusMap:p}))),l.createElement("div",{className:"filter-button",onClick:()=>g(!E)}," ",f(E?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function K(e,t){return e(t={exports:{}},t.exports),t.exports}var G=K(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",d="[object Date]",u="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",S="[object Symbol]",h="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",b="[object Float32Array]",D="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",T="[object Uint8Array]",I="[object Uint16Array]",O="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(L.source),k=RegExp(P.source),B=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,V=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,K=RegExp(j.source),G=/^\s+/,Y=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Z=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,de=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",me="["+se+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",De="(?:"+_e+"|"+Ee+")",Ae="(?:"+me+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[Se,he,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",Ne="(?:"+["[\\u2700-\\u27bf]",he,ye].join("|")+")"+Ce,Te="(?:"+[Se+me+"?",me,he,ye,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(me,"g"),we=RegExp(ge+"(?="+ge+")|"+Te+Ce,"g"),xe=RegExp([_e+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,_e,"$"].join("|")+")",De+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,_e+be,"$"].join("|")+")",_e+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?: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,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["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"],Me=-1,ke={};ke[b]=ke[D]=ke[A]=ke[C]=ke[N]=ke[T]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[O]=!0,ke[o]=ke[a]=ke[y]=ke[r]=ke[_]=ke[d]=ke[u]=ke[s]=ke[v]=ke[m]=ke[p]=ke[f]=ke[E]=ke[g]=ke[h]=!1;var Be={};Be[o]=Be[a]=Be[y]=Be[_]=Be[r]=Be[d]=Be[b]=Be[D]=Be[A]=Be[C]=Be[N]=Be[v]=Be[m]=Be[p]=Be[f]=Be[E]=Be[g]=Be[S]=Be[T]=Be["[object Uint8ClampedArray]"]=Be[I]=Be[O]=!0,Be[u]=Be[s]=Be[h]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Ue=parseInt,He="object"==typeof z&&z&&z.Object===Object&&z,We="object"==typeof self&&self&&self.Object===Object&&self,je=He||We||Function("return this")(),ze=t&&!t.nodeType&&t,Ke=ze&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===ze,Ye=Ge&&He.process,qe=function(){try{return Ke&&Ke.require&&Ke.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),Ze=qe&&qe.isArrayBuffer,$e=qe&&qe.isDate,Xe=qe&&qe.isMap,Je=qe&&qe.isRegExp,Qe=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function dt(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function ut(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=_t("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,ht,n)}function St(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function _t(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 Dt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,zt(e)+1).replace(G,""):e}function Tt(e){return function(t){return e(t)}}function It(e,t){return ut(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function wt(e,t){for(var n=-1,l=e.length;++n<l&&gt(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length;n--&&gt(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=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"}),Pt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Fe[e]}function kt(e){return Re.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function Vt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Ut(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 Wt(e){return kt(e)?function(e){for(var t=we.lastIndex=0;we.test(e);)++t;return t}(e):pt(e)}function jt(e){return kt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Kt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var z,Y=(t=null==t?je:Gt.defaults(je.Object(),t,Gt.pick(je,Pe))).Array,se=t.Date,ce=t.Error,ve=t.Function,me=t.Math,pe=t.Object,fe=t.RegExp,Ee=t.String,ge=t.TypeError,Se=Y.prototype,he=pe.prototype,ye=t["__core-js_shared__"],_e=ve.prototype.toString,be=he.hasOwnProperty,De=0,Ae=(z=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Ce=he.toString,Ne=_e.call(pe),Te=je._,we=fe("^"+_e.call(be).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ge?t.Buffer:void 0,Fe=t.Symbol,He=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,ze=Ft(pe.getPrototypeOf,pe),Ke=pe.create,Ye=he.propertyIsEnumerable,qe=Se.splice,pt=Fe?Fe.isConcatSpreadable:void 0,bt=Fe?Fe.iterator:void 0,Yt=Fe?Fe.toStringTag:void 0,qt=function(){try{var e=Ji(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Zt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,$t=se&&se.now!==je.Date.now&&se.now,Xt=t.setTimeout!==je.setTimeout&&t.setTimeout,Jt=me.ceil,Qt=me.floor,en=pe.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=Se.join,on=Ft(pe.keys,pe),an=me.max,rn=me.min,dn=se.now,un=t.parseInt,sn=me.random,cn=Se.reverse,vn=Ji(t,"DataView"),mn=Ji(t,"Map"),pn=Ji(t,"Promise"),fn=Ji(t,"Set"),En=Ji(t,"WeakMap"),gn=Ji(pe,"create"),Sn=En&&new En,hn={},yn=Io(vn),_n=Io(mn),bn=Io(pn),Dn=Io(fn),An=Io(En),Cn=Fe?Fe.prototype:void 0,Nn=Cn?Cn.valueOf:void 0,Tn=Cn?Cn.toString:void 0;function In(e){if(Ka(e)&&!Pa(e)&&!(e instanceof Rn)){if(e instanceof xn)return e;if(be.call(e,"__wrapped__"))return Oo(e)}return new xn(e)}var On=function(){function e(){}return function(t){if(!za(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function wn(){}function xn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(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 Mn(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 kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Fn(e,t){var n=Pa(e),l=!n&&La(e),i=!n&&!l&&Fa(e),o=!n&&!l&&!i&&Qa(e),a=n||l||i||o,r=a?Ct(e.length,Ee):[],d=r.length;for(var u in e)!t&&!be.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||oo(u,d))||r.push(u);return r}function Vn(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function Un(e,t){return Do(Ei(e),Zn(t,0,e.length))}function Hn(e){return Do(Ei(e))}function Wn(e,t,n){(void 0!==n&&!wa(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)&&wa(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(wa(e[n][0],t))return n;return-1}function Kn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&gi(t,_r(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,i=Y(l),o=null==e;++n<l;)i[n]=o?void 0:Er(e,t[n]);return i}function Zn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function $n(e,t,n,l,i,a){var u,h=1&t,w=2&t,x=4&t;if(n&&(u=i?n(e,l,i,a):n(e)),void 0!==u)return u;if(!za(e))return e;var R=Pa(e);if(R){if(u=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),!h)return Ei(e,u)}else{var L=to(e),P=L==s||L==c;if(Fa(e))return si(e,h);if(L==p||L==o||P&&!i){if(u=w||P?{}:lo(e),!h)return w?function(e,t){return gi(e,eo(e),t)}(e,function(e,t){return e&&gi(t,br(t),e)}(u,e)):function(e,t){return gi(e,Qi(e),t)}(e,Gn(u,e))}else{if(!Be[L])return i?e:{};u=function(e,t,n){var l=e.constructor;switch(t){case y:return ci(e);case r:case d:return new l(+e);case _:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case D:case A:case C:case N:case T:case"[object Uint8ClampedArray]":case I:case O:return vi(e,n);case v:return new l;case m: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 S:return Nn?pe(Nn.call(e)):{}}}(e,L,h)}}a||(a=new Bn);var M=a.get(e);if(M)return M;a.set(e,u),$a(e)?e.forEach(function(l){u.add($n(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){u.set(i,$n(l,t,n,i,e,a))});var k=R?void 0:(x?w?Ki:zi:w?br:_r)(e);return lt(k||e,function(l,i){k&&(l=e[i=l]),jn(u,i,$n(l,t,n,i,e,a))}),u}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=pe(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new ge(n);return ho(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,d=[],u=t.length;if(!r)return d;n&&(t=ut(t,Tt(n))),l?(o=dt,a=!1):t.length>=200&&(o=Ot,a=!1,t=new kn(t));e:for(;++i<r;){var s=e[i],c=null==n?s:n(s);if(s=l||0!==s?s:0,a&&c==c){for(var v=u;v--;)if(t[v]===c)continue e;d.push(s)}else o(t,c,l)||d.push(s)}return d}In.templateSettings={escape:B,evaluate:F,interpolate:V,variable:"",imports:{_:In}},(In.prototype=wn.prototype).constructor=In,(xn.prototype=On(wn.prototype)).constructor=xn,(Rn.prototype=On(wn.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&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},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(mn||Pn),string:new Ln}},Mn.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return $i(this,e).get(e)},Mn.prototype.has=function(e){return $i(this,e).has(e)},Mn.prototype.set=function(e,t){var n=$i(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.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 Mn(l)}return n.set(e,t),this.size=n.size,this};var el=yi(dl),tl=yi(ul,!0);function nl(e,t){var n=!0;return el(e,function(e,l,i){return n=!!t(e,l,i)}),n}function ll(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):n(a,r)))var r=a,d=o}return d}function il(e,t){var n=[];return el(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function ol(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=io),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?ol(r,t-1,n,l,i):st(i,r):l||(i[i.length]=r)}return i}var al=_i(),rl=_i(!0);function dl(e,t){return e&&al(e,t,_r)}function ul(e,t){return e&&rl(e,t,_r)}function sl(e,t){return at(t,function(t){return Ha(e[t])})}function cl(e,t){for(var n=0,l=(t=ai(t,e)).length;null!=e&&n<l;)e=e[To(t[n++])];return n&&n==l?e:void 0}function vl(e,t,n){var l=t(e);return Pa(e)?l:st(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Yt&&Yt in pe(e)?function(e){var t=be.call(e,Yt),n=e[Yt];try{e[Yt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Yt]=n:delete e[Yt]),i}(e):function(e){return Ce.call(e)}(e)}function pl(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in pe(e)}function gl(e,t,n){for(var l=n?dt:rt,i=e[0].length,o=e.length,a=o,r=Y(o),d=Infinity,u=[];a--;){var s=e[a];a&&t&&(s=ut(s,Tt(t))),d=rn(s.length,d),r[a]=!n&&(t||i>=120&&s.length>=120)?new kn(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&u.length<d;){var m=s[c],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Ot(v,p):l(u,p,n))){for(a=o;--a;){var f=r[a];if(!(f?Ot(f,p):l(e[a],p,n)))continue e}v&&v.push(p),u.push(m)}}return u}function Sl(e,t,n){var l=null==(e=fo(e,t=ai(t,e)))?e:e[To(Uo(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Ka(e)&&ml(e)==o}function yl(e,t,n,l,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var c=Pa(e),h=Pa(t),b=c?a:to(e),D=h?a:to(t),A=(b=b==o?p:b)==p,C=(D=D==o?p:D)==p,N=b==D;if(N&&Fa(e)){if(!Fa(t))return!1;c=!0,A=!1}if(N&&!A)return s||(s=new Bn),c||Qa(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,o,a){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case r:case d:case m:return wa(+e,+t);case u:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v:var s=Bt;case E:if(s||(s=Ut),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=Wi(s(e),s(t),l,i,o,a);return a.delete(e),p;case S:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,b,n,l,i,s);if(!(1&n)){var T=A&&be.call(e,"__wrapped__"),I=C&&be.call(t,"__wrapped__");if(T||I){var O=T?e.value():e,w=I?t.value():t;return s||(s=new Bn),i(O,w,n,l,s)}}return!!N&&(s||(s=new Bn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),d=r.length;if(d!=zi(t).length&&!a)return!1;for(var u=d;u--;){var s=r[u];if(!(a?s in t:be.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=a;++u<d;){var f=e[s=r[u]],E=t[s];if(l)var g=a?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===g?f===E||i(f,E,n,l,o):g)){m=!1;break}p||(p="constructor"==s)}if(m&&!p){var S=e.constructor,h=t.constructor;S==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof S&&S instanceof S&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,s))}(e,t,n,l,yl,i))}function _l(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=pe(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var d=(r=n[i])[0],u=e[d],s=r[1];if(a&&r[2]){if(void 0===u&&!(d in e))return!1}else{var c=new Bn;if(l)var v=l(u,s,d,e,t,c);if(!(void 0===v?yl(s,u,3,l,c):v))return!1}}return!0}function bl(e){return!(!za(e)||(t=e,Ae&&Ae in t))&&(Ha(e)?we:ie).test(Io(e));var t}function Dl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Il(e[0],e[1]):Tl(e):nd(e)}function Al(e){if(!co(e))return on(e);var t=[];for(var n in pe(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Nl(e,t){var n=-1,l=ka(e)?Y(e.length):[];return el(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Tl(e){var t=Xi(e);return 1==t.length&&t[0][2]?mo(t[0][0],t[0][1]):function(n){return n===e||_l(n,e,t)}}function Il(e,t){return ro(e)&&vo(t)?mo(To(e),t):function(n){var l=Er(n,e);return void 0===l&&l===t?gr(n,e):yl(t,l,3)}}function Ol(e,t,n,l,i){e!==t&&al(t,function(o,a){if(i||(i=new Bn),za(o))!function(e,t,n,l,i,o,a){var r=go(e,n),d=go(t,n),u=a.get(d);if(u)Wn(e,n,u);else{var s=o?o(r,d,n+"",e,t,a):void 0,c=void 0===s;if(c){var v=Pa(d),m=!v&&Fa(d),p=!v&&!m&&Qa(d);s=d,v||m||p?Pa(r)?s=r:Ba(r)?s=Ei(r):m?(c=!1,s=si(d,!0)):p?(c=!1,s=vi(d,!0)):s=[]:qa(d)||La(d)?(s=r,La(r)?s=rr(r):za(r)&&!Ha(r)||(s=lo(d))):c=!1}c&&(a.set(d,s),i(s,d,l,o,a),a.delete(d)),Wn(e,n,s)}}(e,t,a,n,Ol,l,i);else{var r=l?l(go(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Wn(e,a,r)}},br)}function wl(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function xl(e,t,n){t=t.length?ut(t,function(e){return Pa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=ut(t,Tt(Zi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var d=mi(i[l],o[l]);if(d)return l>=r?d:d*("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,i){return{criteria:ut(t,function(t){return t(e)}),index:++l,value:e}}))}function Rl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(o,ai(a,e),r)}return o}function Ll(e,t,n,l){var i=l?St:gt,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),n&&(r=ut(e,Tt(n)));++o<a;)for(var d=0,u=t[o],s=n?n(u):u;(d=i(r,s,d,l))>-1;)r!==e&&qe.call(r,d,1),qe.call(e,d,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;oo(i)?qe.call(e,i,1):Jl(e,i)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function kl(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 yo(po(e,t,Yr),e+"")}function Fl(e){return Vn(wr(e))}function Vl(e,t){var n=wr(e);return Do(n,Zn(t,0,n.length))}function Ul(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=ai(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var d=To(t[i]),u=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(i!=a){var s=r[d];void 0===(u=l?l(s,d,r):void 0)&&(u=za(s)?s:oo(t[i+1])?[]:{})}jn(r,d,u),r=r[d]}return e}var Hl=Sn?function(e,t){return Sn.set(e,t),e}:Yr,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return Do(wr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Y(i);++l<i;)o[l]=e[l+t];return o}function Kl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,d=Ja(t),u=void 0===t;i<o;){var s=Qt((i+o)/2),c=n(e[s]),v=void 0!==c,m=null===c,p=c==c,f=Ja(c);if(a)var E=l||p;else E=u?p&&(l||v):r?p&&v&&(l||!m):d?p&&v&&!m&&(l||!f):!m&&!f&&(l?c<=t:c<t);E?i=s+1:o=s}return rn(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!wa(r,d)){var d=r;o[i++]=0===a?0:a}}return o}function Zl(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function $l(e){if("string"==typeof e)return e;if(Pa(e))return ut(e,$l)+"";if(Ja(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],d=r;if(n)a=!1,i=dt;else if(o>=200){var u=t?null:ki(e);if(u)return Ut(u);a=!1,i=Ot,d=new kn}else d=t?[]:r;e:for(;++l<o;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,a&&c==c){for(var v=d.length;v--;)if(d[v]===c)continue e;t&&d.push(c),r.push(s)}else i(d,c,n)||(d!==r&&d.push(c),r.push(s))}return r}function Jl(e,t){return null==(e=fo(e,t=ai(t,e)))||delete e[To(Uo(t))]}function Ql(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function ei(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ti(e,t){var n=e;return n instanceof Rn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ni(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var i=-1,o=Y(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Qn(o[i]||a,e[r],t,n));return Xl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function ii(e){return Ba(e)?e:[]}function oi(e){return"function"==typeof e?e:Yr}function ai(e,t){return Pa(e)?e:ro(e,t)?[e]:No(dr(e))}var ri=Bl;function di(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Zt||function(e){return je.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=We?We(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function vi(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,d=t==t,u=Ja(t);if(!r&&!u&&!o&&e>t||o&&a&&d&&!r&&!u||l&&a&&d||!n&&d||!i)return 1;if(!l&&!o&&!u&&e<t||u&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!d)return-1}return 0}function pi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,d=t.length,u=an(o-a,0),s=Y(d+u),c=!l;++r<d;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[n[i]]=e[i]);for(;u--;)s[r++]=e[i++];return s}function fi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,d=-1,u=t.length,s=an(o-r,0),c=Y(s+u),v=!l;++i<s;)c[i]=e[i];for(var m=i;++d<u;)c[m+d]=t[d];for(;++a<r;)(v||i<o)&&(c[m+n[a]]=e[i++]);return c}function Ei(e,t){var n=-1,l=e.length;for(t||(t=Y(l));++n<l;)t[n]=e[n];return t}function gi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=l?l(n[r],e[r],r,n,e):void 0;void 0===d&&(d=e[r]),i?Yn(n,r,d):jn(n,r,d)}return n}function Si(e,t){return function(n,l){var i=Pa(n)?nt:Kn,o=t?t():{};return i(n,e,Zi(l,2),o)}}function hi(e){return Bl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=pe(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function yi(e,t){return function(n,l){if(null==n)return n;if(!ka(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=pe(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function _i(e){return function(t,n,l){for(var i=-1,o=pe(t),a=l(t),r=a.length;r--;){var d=a[e?r:++i];if(!1===n(o[d],d,o))break}return t}}function bi(e){return function(t){var n=kt(t=dr(t))?jt(t):void 0,l=n?n[0]:t.charAt(0),i=n?di(n,1).join(""):t.slice(1);return l[e]()+i}}function Di(e){return function(t){return ct(Hr(Lr(t).replace(Ie,"")),e,"")}}function Ai(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=On(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=pe(t);if(!ka(t)){var o=Zi(n,3);t=_r(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Ni(e){return ji(function(t){var l=t.length,i=l,o=xn.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new ge(n);if(o&&!r&&"wrapper"==Yi(a))var r=new xn([],!0)}for(i=r?i:l;++i<l;){var d=Yi(a=t[i]),u="wrapper"==d?Gi(a):void 0;r=u&&uo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?r[Yi(u[0])].apply(r,u[3]):1==a.length&&uo(a)?r[d]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Pa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ti(e,t,n,l,i,o,a,r,d,u){var s=128&t,c=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:Ai(e);return function E(){for(var g=arguments.length,S=Y(g),h=g;h--;)S[h]=arguments[h];if(m)var y=qi(E),_=Rt(S,y);if(l&&(S=pi(S,l,i,m)),o&&(S=fi(S,o,a,m)),g-=_,m&&g<u){var b=Vt(S,y);return Pi(e,t,Ti,E.placeholder,n,S,b,r,d,u-g)}var D=c?n:this,A=v?D[e]:e;return g=S.length,r?S=Eo(S,r):p&&g>1&&S.reverse(),s&&d<g&&(S.length=d),this&&this!==je&&this instanceof E&&(A=f||Ai(A)),A.apply(D,S)}}function Ii(e,t){return function(n,l){return function(e,t,n,l){return dl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Oi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=$l(n),l=$l(l)):(n=Zl(n),l=Zl(l)),i=e(n,l)}return i}}function wi(e){return ji(function(t){return t=ut(t,Tt(Zi())),Bl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function xi(e,t){var n=(t=void 0===t?" ":$l(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Jt(e/Wt(t)));return kt(t)?di(jt(l),0,e).join(""):l.slice(0,e)}function Ri(e){return function(t,n,l){return l&&"number"!=typeof l&&ao(t,n,l)&&(n=l=void 0),t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n,l){for(var i=-1,o=an(Jt((t-e)/(n||1)),0),a=Y(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:lr(l),e)}}function Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ar(t),n=ar(n)),e(t,n)}}function Pi(e,t,n,l,i,o,a,r,d,u){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,d,u],v=n.apply(void 0,c);return uo(e)&&So(v,c),v.placeholder=l,_o(v,e,t)}function Mi(e){var t=me[e];return function(e,n){if(e=ar(e),(n=null==n?0:rn(ir(n),292))&&nn(e)){var l=(dr(e)+"e").split("e");return+((l=(dr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=fn&&1/Ut(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Jr;function Bi(e){return function(t){var n=to(t);return n==v?Bt(t):n==E?Ht(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,d,u){var s=2&t;if(!s&&"function"!=typeof e)throw new ge(n);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),d=void 0===d?d:an(ir(d),0),u=void 0===u?u:ir(u),c-=a?a.length:0,64&t){var v=o,m=a;o=a=void 0}var p=s?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,d,u];if(p&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?pi(r,a,t[4]):a,e[4]=r?Vt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fi(r,a,t[6]):a,e[6]=r?Vt(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:rn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(u=f[9]=void 0===f[9]?s?0:e.length:an(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=Y(o),r=o,d=qi(i);r--;)a[r]=arguments[r];var u=o<3&&a[0]!==d&&a[o-1]!==d?[]:Vt(a,d);if((o-=u.length)<n)return Pi(e,t,Ti,i.placeholder,void 0,a,u,void 0,void 0,n-o);var s=this&&this!==je&&this instanceof i?l:e;return tt(s,this,a)}}(e,t,u):32!=t&&33!=t||a.length?Ti.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,d=-1,u=l.length,s=Y(u+r),c=this&&this!==je&&this instanceof t?o:e;++d<u;)s[d]=l[d];for(;r--;)s[d++]=arguments[++a];return tt(c,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==je&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return _o((p?Hl:So)(E,f),e,t)}function Vi(e,t,n,l){return void 0===e||wa(e,he[n])&&!be.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ol(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return qa(e)?void 0:e}function Wi(e,t,n,l,i,o){var a=1&n,r=e.length,d=t.length;if(r!=d&&!(a&&d>r))return!1;var u=o.get(e),s=o.get(t);if(u&&s)return u==t&&s==e;var c=-1,v=!0,m=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(l)var E=a?l(f,p,c,t,e,o):l(p,f,c,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Ot(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return yo(po(e,void 0,Mo),e+"")}function zi(e){return vl(e,_r,Qi)}function Ki(e){return vl(e,br,eo)}var Gi=Sn?function(e){return Sn.get(e)}:Jr;function Yi(e){for(var t=e.name+"",n=hn[t],l=be.call(hn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(be.call(In,"placeholder")?In:e).placeholder}function Zi(){var e=In.iteratee||qr;return e=e===qr?Dl:e,arguments.length?e(arguments[0],arguments[1]):e}function $i(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 Xi(e){for(var t=_r(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,vo(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=pe(e),at(en(e),function(t){return Ye.call(e,t)}))}:od,eo=en?function(e){for(var t=[];e;)st(t,Qi(e)),e=ze(e);return t}:od,to=ml;function no(e,t,n){for(var l=-1,i=(t=ai(t,e)).length,o=!1;++l<i;){var a=To(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&oo(a,i)&&(Pa(e)||La(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:On(ze(e))}function io(e){return Pa(e)||La(e)||!!(pt&&e&&e[pt])}function oo(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 ao(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?ka(n)&&oo(t,n.length):"string"==l&&t in n)&&wa(n[t],e)}function ro(e,t){if(Pa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||H.test(e)||!U.test(e)||null!=t&&e in pe(t)}function uo(e){var t=Yi(e),n=In[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(vn&&to(new vn(new ArrayBuffer(1)))!=_||mn&&to(new mn)!=v||pn&&"[object Promise]"!=to(pn.resolve())||fn&&to(new fn)!=E||En&&to(new En)!=h)&&(to=function(e){var t=ml(e),n=t==p?e.constructor:void 0,l=n?Io(n):"";if(l)switch(l){case yn:return _;case _n:return v;case bn:return"[object Promise]";case Dn:return E;case An:return h}return t});var so=ye?Ha:ad;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function vo(e){return e==e&&!za(e)}function mo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in pe(n))}}function po(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=an(l.length-t,0),a=Y(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=Y(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function fo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function Eo(e,t){for(var n=e.length,l=rn(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function go(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var So=bo(Hl),ho=Xt||function(e,t){return je.setTimeout(e,t)},yo=bo(Wl);function _o(e,t,n){var l=t+"";return yo(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(Z);return t?t[1].split($):[]}(l),n)))}function bo(e){var t=0,n=0;return function(){var l=dn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Do(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Ml(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao,Co,No=(Ao=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=Ao.cache,Ao);function To(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return _e.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof Rn)return e.clone();var t=new xn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var wo=Bl(function(e,t){return Ba(e)?Qn(e,ol(t,1,Ba,!0)):[]}),xo=Bl(function(e,t){var n=Uo(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ol(t,1,Ba,!0),Zi(n,2)):[]}),Ro=Bl(function(e,t){var n=Uo(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ol(t,1,Ba,!0),void 0,n):[]});function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),Et(e,Zi(t,3),i)}function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ir(n),i=n<0?an(l+i,0):rn(i,l-1)),Et(e,Zi(t,3),i,!0)}function Mo(e){return null!=e&&e.length?ol(e,1):[]}function ko(e){return e&&e.length?e[0]:void 0}var Bo=Bl(function(e){var t=ut(e,ii);return t.length&&t[0]===e[0]?gl(t):[]}),Fo=Bl(function(e){var t=Uo(e),n=ut(e,ii);return t===Uo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gl(n,Zi(t,2)):[]}),Vo=Bl(function(e){var t=Uo(e),n=ut(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gl(n,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Bl(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Pl(e,ut(t,function(e){return oo(e,n)?+e:e}).sort(mi)),l});function zo(e){return null==e?e:cn.call(e)}var Ko=Bl(function(e){return Xl(ol(e,1,Ba,!0))}),Go=Bl(function(e){var t=Uo(e);return Ba(t)&&(t=void 0),Xl(ol(e,1,Ba,!0),Zi(t,2))}),Yo=Bl(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Xl(ol(e,1,Ba,!0),void 0,t)});function qo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=an(e.length,t),!0}),Ct(t,function(t){return ut(e,_t(t))})}function Zo(e,t){if(!e||!e.length)return[];var n=qo(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var $o=Bl(function(e,t){return Ba(e)?Qn(e,t):[]}),Xo=Bl(function(e){return ni(at(e,Ba))}),Jo=Bl(function(e){var t=Uo(e);return Ba(t)&&(t=void 0),ni(at(e,Ba),Zi(t,2))}),Qo=Bl(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ni(at(e,Ba),void 0,t)}),ea=Bl(qo),ta=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,Zo(e,n)});function na(e){var t=In(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var ia=ji(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new xn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),oa=Si(function(e,t,n){be.call(e,n)?++e[n]:Yn(e,n,1)}),aa=Ci(Lo),ra=Ci(Po);function da(e,t){return(Pa(e)?lt:el)(e,Zi(t,3))}function ua(e,t){return(Pa(e)?it:tl)(e,Zi(t,3))}var sa=Si(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,i="function"==typeof t,o=ka(e)?Y(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):Sl(e,t,n)}),o}),va=Si(function(e,t,n){Yn(e,n,t)});function ma(e,t){return(Pa(e)?ut:Nl)(e,Zi(t,3))}var pa=Si(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fa=Bl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),xl(e,ol(t,1),[])}),Ea=$t||function(){return je.Date.now()};function ga(e,t,n){return t=n?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Sa(e,t){var l;if("function"!=typeof t)throw new ge(n);return e=ir(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 i=Vt(n,qi(ha));l|=32}return Fi(e,l,t,n,i)}),ya=Bl(function(e,t,n){var l=3;if(n.length){var i=Vt(n,qi(ya));l|=32}return Fi(t,l,e,n,i)});function _a(e,t,l){var i,o,a,r,d,u,s=0,c=!1,v=!1,m=!0;if("function"!=typeof e)throw new ge(n);function p(t){var n=i,l=o;return i=o=void 0,s=t,r=e.apply(l,n)}function f(e){return s=e,d=ho(g,t),c?p(e):r}function E(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-s>=a}function g(){var e=Ea();if(E(e))return S(e);d=ho(g,function(e){var n=t-(e-u);return v?rn(n,a-(e-s)):n}(e))}function S(e){return d=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=Ea(),n=E(e);if(i=arguments,o=this,u=e,n){if(void 0===d)return f(u);if(v)return ui(d),d=ho(g,t),p(u)}return void 0===d&&(d=ho(g,t)),r}return t=ar(t)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?an(ar(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==d&&ui(d),s=0,i=u=o=d=void 0},h.flush=function(){return void 0===d?r:S(Ea())},h}var ba=Bl(function(e,t){return Jn(e,1,t)}),Da=Bl(function(e,t,n){return Jn(e,ar(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(Aa.Cache||Mn),l}function Ca(e){if("function"!=typeof e)throw new ge(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)}}Aa.Cache=Mn;var Na=ri(function(e,t){var n=(t=1==t.length&&Pa(t[0])?ut(t[0],Tt(Zi())):ut(ol(t,1),Tt(Zi()))).length;return Bl(function(l){for(var i=-1,o=rn(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ta=Bl(function(e,t){return Fi(e,32,void 0,t,Vt(t,qi(Ta)))}),Ia=Bl(function(e,t){return Fi(e,64,void 0,t,Vt(t,qi(Ia)))}),Oa=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function wa(e,t){return e===t||e!=e&&t!=t}var xa=Li(pl),Ra=Li(function(e,t){return e>=t}),La=hl(function(){return arguments}())?hl:function(e){return Ka(e)&&be.call(e,"callee")&&!Ye.call(e,"callee")},Pa=Y.isArray,Ma=Ze?Tt(Ze):function(e){return Ka(e)&&ml(e)==y};function ka(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ba(e){return Ka(e)&&ka(e)}var Fa=tn||ad,Va=$e?Tt($e):function(e){return Ka(e)&&ml(e)==d};function Ua(e){if(!Ka(e))return!1;var t=ml(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function Ha(e){if(!za(e))return!1;var t=ml(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==ir(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 Ka(e){return null!=e&&"object"==typeof e}var Ga=Xe?Tt(Xe):function(e){return Ka(e)&&to(e)==v};function Ya(e){return"number"==typeof e||Ka(e)&&ml(e)==m}function qa(e){if(!Ka(e)||ml(e)!=p)return!1;var t=ze(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_e.call(n)==Ne}var Za=Je?Tt(Je):function(e){return Ka(e)&&ml(e)==f},$a=Qe?Tt(Qe):function(e){return Ka(e)&&to(e)==E};function Xa(e){return"string"==typeof e||!Pa(e)&&Ka(e)&&ml(e)==g}function Ja(e){return"symbol"==typeof e||Ka(e)&&ml(e)==S}var Qa=et?Tt(et):function(e){return Ka(e)&&ja(e.length)&&!!ke[ml(e)]},er=Li(Cl),tr=Li(function(e,t){return e<=t});function nr(e){if(!e)return[];if(ka(e))return Xa(e)?jt(e):Ei(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=to(e);return(t==v?Bt:t==E?Ut:wr)(e)}function lr(e){return e?(e=ar(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ir(e){var t=lr(e),n=t%1;return t==t?n?t-n:t:0}function or(e){return e?Zn(ir(e),0,4294967295):0}function ar(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=Nt(e);var n=le.test(e);return n||oe.test(e)?Ue(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function rr(e){return gi(e,br(e))}function dr(e){return null==e?"":$l(e)}var ur=hi(function(e,t){if(co(t)||ka(t))gi(t,_r(t),e);else for(var n in t)be.call(t,n)&&jn(e,n,t[n])}),sr=hi(function(e,t){gi(t,br(t),e)}),cr=hi(function(e,t,n,l){gi(t,br(t),e,l)}),vr=hi(function(e,t,n,l){gi(t,_r(t),e,l)}),mr=ji(qn),pr=Bl(function(e,t){e=pe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=br(o),r=-1,d=a.length;++r<d;){var u=a[r],s=e[u];(void 0===s||wa(s,he[u])&&!be.call(e,u))&&(e[u]=o[u])}return e}),fr=Bl(function(e){return e.push(void 0,Ui),tt(Ar,void 0,e)});function Er(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function gr(e,t){return null!=e&&no(e,t,El)}var Sr=Ii(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),hr=Ii(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]},Zi),yr=Bl(Sl);function _r(e){return ka(e)?Fn(e):Al(e)}function br(e){return ka(e)?Fn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Dr=hi(function(e,t,n){Ol(e,t,n)}),Ar=hi(function(e,t,n,l){Ol(e,t,n,l)}),Cr=ji(function(e,t){var n={};if(null==e)return n;var l=!1;t=ut(t,function(t){return t=ai(t,e),l||(l=t.length>1),t}),gi(e,Ki(e),n),l&&(n=$n(n,7,Hi));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Nr=ji(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return gr(e,n)})}(e,t)});function Tr(e,t){if(null==e)return{};var n=ut(Ki(e),function(e){return[e]});return t=Zi(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Ir=Bi(_r),Or=Bi(br);function wr(e){return null==e?[]:It(e,_r(e))}var xr=Di(function(e,t,n){return t=t.toLowerCase(),e+(n?Rr(t):t)});function Rr(e){return Ur(dr(e).toLowerCase())}function Lr(e){return(e=dr(e))&&e.replace(re,Lt).replace(Oe,"")}var Pr=Di(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Mr=Di(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),kr=bi("toLowerCase"),Br=Di(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fr=Di(function(e,t,n){return e+(n?" ":"")+Ur(t)}),Vr=Di(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ur=bi("toUpperCase");function Hr(e,t,n){return e=dr(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wr=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new ce(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=To(t),Yn(e,t,ha(e[t],e))}),e});function zr(e){return function(){return e}}var Kr=Ni(),Gr=Ni(!0);function Yr(e){return e}function qr(e){return Dl("function"==typeof e?e:$n(e,1))}var Zr=Bl(function(e,t){return function(n){return Sl(n,e,t)}}),$r=Bl(function(e,t){return function(n){return Sl(e,n,t)}});function Xr(e,t,n){var l=_r(t),i=sl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,_r(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Ha(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ei(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Qr=wi(ut),ed=wi(ot),td=wi(mt);function nd(e){return ro(e)?_t(To(e)):function(e){return function(t){return cl(t,e)}}(e)}var ld=Ri(),id=Ri(!0);function od(){return[]}function ad(){return!1}var rd,dd=Oi(function(e,t){return e+t},0),ud=Mi("ceil"),sd=Oi(function(e,t){return e/t},1),cd=Mi("floor"),vd=Oi(function(e,t){return e*t},1),md=Mi("round"),pd=Oi(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new ge(n);return e=ir(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=ga,In.assign=ur,In.assignIn=sr,In.assignInWith=cr,In.assignWith=vr,In.at=mr,In.before=Sa,In.bind=ha,In.bindAll=jr,In.bindKey=ya,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},In.chain=na,In.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:an(ir(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=Y(Jt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},In.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},In.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 st(Pa(n)?Ei(n):[n],ol(t,1))},In.cond=function(e){var t=null==e?0:e.length,l=Zi();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new ge(n);return[l(e[0]),e[1]]}):[],Bl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},In.conforms=function(e){return function(e){var t=_r(e);return function(n){return Xn(n,e,t)}}($n(e,1))},In.constant=zr,In.countBy=oa,In.create=function(e,t){var n=On(e);return null==t?n:Gn(n,t)},In.curry=function e(t,n,l){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},In.curryRight=function e(t,n,l){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},In.debounce=_a,In.defaults=pr,In.defaultsDeep=fr,In.defer=ba,In.delay=Da,In.difference=wo,In.differenceBy=xo,In.differenceWith=Ro,In.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:ir(t))<0?0:t,l):[]},In.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:ir(t)))<0?0:t):[]},In.dropRightWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3),!0,!0):[]},In.dropWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3),!0):[]},In.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ao(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ir(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ir(l))<0&&(l+=i),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},In.filter=function(e,t){return(Pa(e)?at:il)(e,Zi(t,3))},In.flatMap=function(e,t){return ol(ma(e,t),1)},In.flatMapDeep=function(e,t){return ol(ma(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:ir(n),ol(ma(e,t),n)},In.flatten=Mo,In.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},In.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:ir(t)):[]},In.flip=function(e){return Fi(e,512)},In.flow=Kr,In.flowRight=Gr,In.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},In.functions=function(e){return null==e?[]:sl(e,_r(e))},In.functionsIn=function(e){return null==e?[]:sl(e,br(e))},In.groupBy=sa,In.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},In.intersection=Bo,In.intersectionBy=Fo,In.intersectionWith=Vo,In.invert=Sr,In.invertBy=hr,In.invokeMap=ca,In.iteratee=qr,In.keyBy=va,In.keys=_r,In.keysIn=br,In.map=ma,In.mapKeys=function(e,t){var n={};return t=Zi(t,3),dl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},In.mapValues=function(e,t){var n={};return t=Zi(t,3),dl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},In.matches=function(e){return Tl($n(e,1))},In.matchesProperty=function(e,t){return Il(e,$n(t,1))},In.memoize=Aa,In.merge=Dr,In.mergeWith=Ar,In.method=Zr,In.methodOf=$r,In.mixin=Xr,In.negate=Ca,In.nthArg=function(e){return e=ir(e),Bl(function(t){return wl(t,e)})},In.omit=Cr,In.omitBy=function(e,t){return Tr(e,Ca(Zi(t)))},In.once=function(e){return Sa(2,e)},In.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]),xl(e,t,n))},In.over=Qr,In.overArgs=Na,In.overEvery=ed,In.overSome=td,In.partial=Ta,In.partialRight=Ia,In.partition=pa,In.pick=Nr,In.pickBy=Tr,In.property=nd,In.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},In.pull=Ho,In.pullAll=Wo,In.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Zi(n,2)):e},In.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},In.pullAt=jo,In.range=ld,In.rangeRight=id,In.rearg=Oa,In.reject=function(e,t){return(Pa(e)?at:il)(e,Ca(Zi(t,3)))},In.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Zi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},In.rest=function(e,t){if("function"!=typeof e)throw new ge(n);return Bl(e,t=void 0===t?t:ir(t))},In.reverse=zo,In.sampleSize=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),(Pa(e)?Un:Vl)(e,t)},In.set=function(e,t,n){return null==e?e:Ul(e,t,n)},In.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},In.shuffle=function(e){return(Pa(e)?Hn:jl)(e)},In.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ao(e,t,n)?(t=0,n=l):(t=null==t?0:ir(t),n=void 0===n?l:ir(n)),zl(e,t,n)):[]},In.sortBy=fa,In.sortedUniq=function(e){return e&&e.length?ql(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Zi(t,2)):[]},In.split=function(e,t,n){return n&&"number"!=typeof n&&ao(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=dr(e))&&("string"==typeof t||null!=t&&!Za(t))&&!(t=$l(t))&&kt(e)?di(jt(e),0,n):e.split(t,n):[]},In.spread=function(e,t){if("function"!=typeof e)throw new ge(n);return t=null==t?0:an(ir(t),0),Bl(function(n){var l=n[t],i=di(n,0,t);return l&&st(i,l),tt(e,this,i)})},In.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ir(t))<0?0:t):[]},In.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:ir(t)))<0?0:t,l):[]},In.takeRightWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?ei(e,Zi(t,3)):[]},In.tap=function(e,t){return t(e),e},In.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new ge(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),_a(e,t,{leading:i,maxWait:t,trailing:o})},In.thru=la,In.toArray=nr,In.toPairs=Ir,In.toPairsIn=Or,In.toPath=function(e){return Pa(e)?ut(e,To):Ja(e)?[e]:Ei(No(dr(e)))},In.toPlainObject=rr,In.transform=function(e,t,n){var l=Pa(e),i=l||Fa(e)||Qa(e);if(t=Zi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Ha(o)?On(ze(e)):{}}return(i?lt:dl)(e,function(e,l,i){return t(n,e,l,i)}),n},In.unary=function(e){return ga(e,1)},In.union=Ko,In.unionBy=Go,In.unionWith=Yo,In.uniq=function(e){return e&&e.length?Xl(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xl(e,Zi(t,2)):[]},In.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},In.unset=function(e,t){return null==e||Jl(e,t)},In.unzip=qo,In.unzipWith=Zo,In.update=function(e,t,n){return null==e?e:Ql(e,t,oi(n))},In.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,oi(n),l)},In.values=wr,In.valuesIn=function(e){return null==e?[]:It(e,br(e))},In.without=$o,In.words=Hr,In.wrap=function(e,t){return Ta(oi(t),e)},In.xor=Xo,In.xorBy=Jo,In.xorWith=Qo,In.zip=ea,In.zipObject=function(e,t){return li(e||[],t||[],jn)},In.zipObjectDeep=function(e,t){return li(e||[],t||[],Ul)},In.zipWith=ta,In.entries=Ir,In.entriesIn=Or,In.extend=sr,In.extendWith=cr,Xr(In,In),In.add=dd,In.attempt=Wr,In.camelCase=xr,In.capitalize=Rr,In.ceil=ud,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ar(n))==n?n:0),void 0!==t&&(t=(t=ar(t))==t?t:0),Zn(ar(e),t,n)},In.clone=function(e){return $n(e,4)},In.cloneDeep=function(e){return $n(e,5)},In.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,_r(t))},In.deburr=Lr,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=sd,In.endsWith=function(e,t,n){e=dr(e),t=$l(t);var l=e.length,i=n=void 0===n?l:Zn(ir(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},In.eq=wa,In.escape=function(e){return(e=dr(e))&&k.test(e)?e.replace(P,Pt):e},In.escapeRegExp=function(e){return(e=dr(e))&&K.test(e)?e.replace(j,"\\$&"):e},In.every=function(e,t,n){var l=Pa(e)?ot:nl;return n&&ao(e,t,n)&&(t=void 0),l(e,Zi(t,3))},In.find=aa,In.findIndex=Lo,In.findKey=function(e,t){return ft(e,Zi(t,3),dl)},In.findLast=ra,In.findLastIndex=Po,In.findLastKey=function(e,t){return ft(e,Zi(t,3),ul)},In.floor=cd,In.forEach=da,In.forEachRight=ua,In.forIn=function(e,t){return null==e?e:al(e,Zi(t,3),br)},In.forInRight=function(e,t){return null==e?e:rl(e,Zi(t,3),br)},In.forOwn=function(e,t){return e&&dl(e,Zi(t,3))},In.forOwnRight=function(e,t){return e&&ul(e,Zi(t,3))},In.get=Er,In.gt=xa,In.gte=Ra,In.has=function(e,t){return null!=e&&no(e,t,fl)},In.hasIn=gr,In.head=ko,In.identity=Yr,In.includes=function(e,t,n,l){e=ka(e)?e:wr(e),n=n&&!l?ir(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Xa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&gt(e,t,n)>-1},In.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),gt(e,t,i)},In.inRange=function(e,t,n){return t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n){return e>=rn(t,n)&&e<an(t,n)}(e=ar(e),t,n)},In.invoke=yr,In.isArguments=La,In.isArray=Pa,In.isArrayBuffer=Ma,In.isArrayLike=ka,In.isArrayLikeObject=Ba,In.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&ml(e)==r},In.isBuffer=Fa,In.isDate=Va,In.isElement=function(e){return Ka(e)&&1===e.nodeType&&!qa(e)},In.isEmpty=function(e){if(null==e)return!0;if(ka(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Qa(e)||La(e)))return!e.length;var t=to(e);if(t==v||t==E)return!e.size;if(co(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},In.isEqual=function(e,t){return yl(e,t)},In.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?yl(e,t,void 0,n):!!l},In.isError=Ua,In.isFinite=function(e){return"number"==typeof e&&nn(e)},In.isFunction=Ha,In.isInteger=Wa,In.isLength=ja,In.isMap=Ga,In.isMatch=function(e,t){return e===t||_l(e,t,Xi(t))},In.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,_l(e,t,Xi(t),n)},In.isNaN=function(e){return Ya(e)&&e!=+e},In.isNative=function(e){if(so(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},In.isNil=function(e){return null==e},In.isNull=function(e){return null===e},In.isNumber=Ya,In.isObject=za,In.isObjectLike=Ka,In.isPlainObject=qa,In.isRegExp=Za,In.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},In.isSet=$a,In.isString=Xa,In.isSymbol=Ja,In.isTypedArray=Qa,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return Ka(e)&&to(e)==h},In.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==ml(e)},In.join=function(e,t){return null==e?"":ln.call(e,t)},In.kebabCase=Pr,In.last=Uo,In.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=ir(n))<0?an(l+i,0):rn(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,ht,i,!0)},In.lowerCase=Mr,In.lowerFirst=kr,In.lt=er,In.lte=tr,In.max=function(e){return e&&e.length?ll(e,Yr,pl):void 0},In.maxBy=function(e,t){return e&&e.length?ll(e,Zi(t,2),pl):void 0},In.mean=function(e){return yt(e,Yr)},In.meanBy=function(e,t){return yt(e,Zi(t,2))},In.min=function(e){return e&&e.length?ll(e,Yr,Cl):void 0},In.minBy=function(e,t){return e&&e.length?ll(e,Zi(t,2),Cl):void 0},In.stubArray=od,In.stubFalse=ad,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=vd,In.nth=function(e,t){return e&&e.length?wl(e,ir(t)):void 0},In.noConflict=function(){return je._===this&&(je._=Te),this},In.noop=Jr,In.now=Ea,In.pad=function(e,t,n){e=dr(e);var l=(t=ir(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return xi(Qt(i),n)+e+xi(Jt(i),n)},In.padEnd=function(e,t,n){e=dr(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?e+xi(t-l,n):e},In.padStart=function(e,t,n){e=dr(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?xi(t-l,n)+e:e},In.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(dr(e).replace(G,""),t||0)},In.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ao(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=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return rn(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Ml(e,t)},In.reduce=function(e,t,n){var l=Pa(e)?ct:Dt,i=arguments.length<3;return l(e,Zi(t,4),n,i,el)},In.reduceRight=function(e,t,n){var l=Pa(e)?vt:Dt,i=arguments.length<3;return l(e,Zi(t,4),n,i,tl)},In.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),kl(dr(e),t)},In.replace=function(){var e=arguments,t=dr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var l=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[To(t[l])];void 0===o&&(l=i,o=n),e=Ha(o)?o.call(e):o}return e},In.round=md,In.runInContext=e,In.sample=function(e){return(Pa(e)?Vn:Fl)(e)},In.size=function(e){if(null==e)return 0;if(ka(e))return Xa(e)?Wt(e):e.length;var t=to(e);return t==v||t==E?e.size:Al(e).length},In.snakeCase=Br,In.some=function(e,t,n){var l=Pa(e)?mt:Kl;return n&&ao(e,t,n)&&(t=void 0),l(e,Zi(t,3))},In.sortedIndex=function(e,t){return Gl(e,t)},In.sortedIndexBy=function(e,t,n){return Yl(e,t,Zi(n,2))},In.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&wa(e[l],t))return l}return-1},In.sortedLastIndex=function(e,t){return Gl(e,t,!0)},In.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Zi(n,2),!0)},In.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(wa(e[n],t))return n}return-1},In.startCase=Fr,In.startsWith=function(e,t,n){return e=dr(e),n=null==n?0:Zn(ir(n),0,e.length),t=$l(t),e.slice(n,n+t.length)==t},In.subtract=pd,In.sum=function(e){return e&&e.length?At(e,Yr):0},In.sumBy=function(e,t){return e&&e.length?At(e,Zi(t,2)):0},In.template=function(e,t,n){var l=In.templateSettings;n&&ao(e,t,n)&&(t=void 0),e=dr(e),t=cr({},t,l,Vi);var i,o,a=cr({},t.imports,l.imports,Vi),r=_r(a),d=It(a,r),u=0,s=t.interpolate||de,c="__p += '",v=fe((t.escape||de).source+"|"+s.source+"|"+(s===V?ee:de).source+"|"+(t.evaluate||de).source+"|$","g"),m="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,function(t,n,l,a,r,d){return l||(l=a),c+=e.slice(u,d).replace(ue,Mt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),u=d+t.length,t}),c+="';\n";var p=be.call(t,"variable")&&t.variable;if(p){if(J.test(p))throw new ce("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(x,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Wr(function(){return ve(r,m+"return "+c).apply(void 0,d)});if(f.source=c,Ua(f))throw f;return f},In.times=function(e,t){if((e=ir(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Zi(t));++n<e;)t(n);return i},In.toFinite=lr,In.toInteger=ir,In.toLength=or,In.toLower=function(e){return dr(e).toLowerCase()},In.toNumber=ar,In.toSafeInteger=function(e){return e?Zn(ir(e),-9007199254740991,9007199254740991):0===e?e:0},In.toString=dr,In.toUpper=function(e){return dr(e).toUpperCase()},In.trim=function(e,t,n){if((e=dr(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=$l(t)))return e;var l=jt(e),i=jt(t);return di(l,wt(l,i),xt(l,i)+1).join("")},In.trimEnd=function(e,t,n){if((e=dr(e))&&(n||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=$l(t)))return e;var l=jt(e);return di(l,0,xt(l,jt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=dr(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=$l(t)))return e;var l=jt(e);return di(l,wt(l,jt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?ir(t.length):n,l="omission"in t?$l(t.omission):l}var o=(e=dr(e)).length;if(kt(e)){var a=jt(e);o=a.length}if(n>=o)return e;var r=n-Wt(l);if(r<1)return l;var d=a?di(a,0,r).join(""):e.slice(0,r);if(void 0===i)return d+l;if(a&&(r+=d.length-r),Za(i)){if(e.slice(r).search(i)){var u,s=d;for(i.global||(i=fe(i.source,dr(te.exec(i))+"g")),i.lastIndex=0;u=i.exec(s);)var c=u.index;d=d.slice(0,void 0===c?r:c)}}else if(e.indexOf($l(i),r)!=r){var v=d.lastIndexOf(i);v>-1&&(d=d.slice(0,v))}return d+l},In.unescape=function(e){return(e=dr(e))&&M.test(e)?e.replace(L,Kt):e},In.uniqueId=function(e){var t=++De;return dr(e)+t},In.upperCase=Vr,In.upperFirst=Ur,In.each=da,In.eachRight=ua,In.first=ko,Xr(In,(rd={},dl(In,function(e,t){be.call(In.prototype,t)||(rd[t]=e)}),rd),{chain:!1}),In.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){In[e].placeholder=In}),lt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:an(ir(n),0);var l=this.__filtered__&&!t?new Rn(this):this.clone();return l.__filtered__?l.__takeCount__=rn(n,l.__takeCount__):l.__views__.push({size:rn(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},Rn.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;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Yr)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=Bl(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return Sl(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ca(Zi(e)))},Rn.prototype.slice=function(e,t){e=ir(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ir(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},dl(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=In[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(In.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof Rn,d=a[0],u=r||Pa(t),s=function(e){var t=i.apply(In,st([e],a));return l&&c?t[0]:t};u&&n&&"function"==typeof d&&1!=d.length&&(r=u=!1);var c=this.__chain__,v=!!this.__actions__.length,m=o&&!c,p=r&&!v;if(!o&&u){t=p?t:new Rn(this);var f=e.apply(t,a);return f.__actions__.push({func:la,args:[s],thisArg:void 0}),new xn(f,c)}return m&&p?e.apply(this,a):(f=this.thru(s),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Se[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);In.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Pa(i)?i:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),dl(Rn.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";be.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=rn(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,d=r-a,u=l?r:a-1,s=this.__iteratees__,c=s.length,v=0,m=rn(d,this.__takeCount__);if(!n||!l&&i==d&&m==d)return ti(e,this.__actions__);var p=[];e:for(;d--&&v<m;){for(var f=-1,E=e[u+=t];++f<c;){var g=s[f],S=g.type,h=(0,g.iteratee)(E);if(2==S)E=h;else if(!h){if(1==S)continue e;break e}}p[v++]=E}return p},In.prototype.at=ia,In.prototype.chain=function(){return na(this)},In.prototype.commit=function(){return new xn(this.value(),this.__chain__)},In.prototype.next=function(){void 0===this.__values__&&(this.__values__=nr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(e){for(var t,n=this;n instanceof wn;){var l=Oo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},In.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:la,args:[zo],thisArg:void 0}),new xn(t,this.__chain__)}return this.thru(zo)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,bt&&(In.prototype[bt]=function(){return this}),In}();Ke?((Ke.exports=Gt)._=Gt,ze._=Gt):je._=Gt}).call(z)});const Y=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],q=e=>{let{searchParams:o,onFilterChange:r,defaultSearchParams:s,statusMap:c,moduleCode:v}=e,m=u(e,Y);const{t:p}=i.useTranslation(),f=a.useQueryClient(),[E,g]=n.useState(()=>d({},o,{services:[]})),[S,h]=n.useState(),[y,_]=n.useState(),[b,D]=n.useState(),A=[{label:"SV_NEW_REGISTRATION",value:"street-vending"}],{data:C}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingActivityType"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingActivityType}});let N=[];C&&C.map(e=>{N.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:T}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingZones"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingZones}});let I=[];T&&T.map(e=>{I.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const O=e=>{let t=e.delete,n=d({},E,e);t&&t.forEach(e=>delete n[e]),delete e.delete,g(d({},n))},w=()=>{g(d({},s,{services:[]})),r(d({},s)),h(null),_(null),D(null)};return n.useEffect(()=>{y&&O({vendingZone:(null==y?void 0:y.code)||""}),S&&O({vendingType:(null==S?void 0:S.code)||""}),b&&O({status:(null==b?void 0:b.i18nKey)||""})},[y,S,b]),l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},p("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:w},p("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&l.createElement("span",{className:"clear-search",onClick:w,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&l.createElement("span",{onClick:m.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("SV_VENDING_ZONES"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:y,select:_,option:I,optionKey:"i18nKey",t:p,placeholder:"Select"})),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("SV_VENDING_TYPE"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:S,select:h,option:N,optionKey:"i18nKey",t:p,placeholder:"Select"})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("SV_APPLICATION_STATUS"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:b,select:D,option:[{i18nKey:"APPLIED"},{i18nKey:"APPROVED"},{i18nKey:"REGISTRATIONCOMPLETED"},{i18nKey:"INSPECTIONPENDING"},{i18nKey:"REJECTED"}],optionKey:"i18nKey",t:p,placeholder:"Select"}))),l.createElement("div",null,l.createElement(j,{searchParams:E,businessServices:E.services,statusMap:c||f.getQueryData("INBOX_STATUS_MAP_"+v),moduleCode:v,onAssignmentChange:(e,t)=>{if(e.target.checked)O({applicationStatus:[...null==E?void 0:E.applicationStatus,t]});else{let e=null==E?void 0:E.applicationStatus.filter(e=>e.state!==t.state);O({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{r(0===E.services.length?d({},E,{services:A.map(e=>e.value)}):E)},label:p("ES_COMMON_APPLY")}))))))},Z=e=>e.substr(0,1).toUpperCase()+e.substr(1),$=function(e,t,n){try{var l;function i(l){var i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T;const I=e=>e.filter(e=>e.value);let O,w;var x,R,L;return null!=e&&null!==(i=e.vendorDetail[0])&&void 0!==i&&i.gender&&(O="M"==(null==e||null===(x=e.vendorDetail[0])||void 0===x?void 0:x.gender)?"Male":"Female"),null!=e&&null!==(o=e.vendorDetail[0])&&void 0!==o&&o.dependentGender&&(w="M"==(null==e||null===(R=e.vendorDetail[0])||void 0===R?void 0:R.dependentGender)?"Male":"Female"),{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(L=n("ULBGRADE_"+(null==t||null===(a=t.city)||void 0===a?void 0:a.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),L.toLowerCase().split(" ").map(Z).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.applicationNo,isTOCRequired:!1,heading:n("SV_ACKNOWLEDGEMENT"),details:[{title:n("SV_VENDOR_PERSONAL_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_VENDOR_NAME"),value:null==e||null===(r=e.vendorDetail[0])||void 0===r?void 0:r.name},{title:n("SV_FATHER_NAME"),value:null==e||null===(d=e.vendorDetail[0])||void 0===d?void 0:d.fatherName},{title:n("SV_REGISTERED_MOB_NUMBER"),value:null==e||null===(u=e.vendorDetail[0])||void 0===u?void 0:u.mobileNo},{title:n("SV_EMAIL"),value:null==e||null===(s=e.vendorDetail[0])||void 0===s?void 0:s.emailId},{title:n("SV_DATE_OF_BIRTH"),value:null==e||null===(c=e.vendorDetail[0])||void 0===c?void 0:c.dob},{title:n("SV_GENDER"),value:O},{title:n("SV_SPOUSE_NAME"),value:null==e||null===(v=e.vendorDetail[0])||void 0===v?void 0:v.spouseName},{title:n("SV_SPOUSE_DATE_OF_BIRTH"),value:null==e||null===(m=e.vendorDetail[0])||void 0===m?void 0:m.spouseDob},{title:n("SV_DEPENDENT_NAME"),value:null==e||null===(p=e.vendorDetail[0])||void 0===p?void 0:p.dependentName},{title:n("SV_DEPENDENT_DATE_OF_BIRTH"),value:null==e||null===(f=e.vendorDetail[0])||void 0===f?void 0:f.dependentDob},{title:n("SV_DEPENDENT_GENDER"),value:w},{title:n("SV_TRADE_NUMBER"),value:null==e||null===(E=e.vendorDetail[0])||void 0===E?void 0:E.tradeNumber}])},{title:n("SV_VENDOR_BUSINESS_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_VENDING_TYPE"),value:null==e?void 0:e.vendingActivity},{title:n("SV_VENDING_ZONES"),value:null==e?void 0:e.vendingZone},{title:n("SV_AREA_REQUIRED"),value:null==e?void 0:e.vendingArea},{title:n("SV_LOCAL_AUTHORITY_NAME"),value:null==e?void 0:e.localAuthorityName},{title:n("SV_VENDING_LISCENCE"),value:null==e?void 0:e.vendingLicenseCertificateId}])},{title:n("SV_BANK_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_ACCOUNT_NUMBER"),value:null==e||null===(g=e.bankDetail)||void 0===g?void 0:g.accountNumber},{title:n("SV_IFSC_CODE"),value:null==e||null===(S=e.bankDetail)||void 0===S?void 0:S.ifscCode},{title:n("SV_BANK_NAME"),value:null==e||null===(h=e.bankDetail)||void 0===h?void 0:h.bankName},{title:n("SV_BANK_BRANCH_NAME"),value:null==e||null===(y=e.bankDetail)||void 0===y?void 0:y.bankBranchName},{title:n("SV_ACCOUNT_HOLDER_NAME"),value:null==e||null===(_=e.bankDetail)||void 0===_?void 0:_.accountHolderName}])},{title:n("SV_ADDRESS_DETAILS"),asSectionHeader:!0,values:I([{title:n("SV_ADDRESS_LINE1"),value:null==e||null===(b=e.addressDetails[0])||void 0===b?void 0:b.addressLine1},{title:n("SV_ADDRESS_LINE2"),value:null==e||null===(D=e.addressDetails[0])||void 0===D?void 0:D.addressLine1},{title:n("SV_CITY"),value:null==e||null===(A=e.addressDetails[0])||void 0===A?void 0:A.city},{title:n("SV_LOCALITY"),value:null==e||null===(C=e.addressDetails[0])||void 0===C?void 0:C.locality},{title:n("SV_ADDRESS_PINCODE"),value:null==e||null===(N=e.addressDetails[0])||void 0===N?void 0:N.pincode},{title:n("SV_LANDMARK"),value:null==e||null===(T=e.addressDetails[0])||void 0===T?void 0:T.landmark}])}]}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.fileStoreId);return Promise.resolve((null==o?void 0:o.length)>0?Promise.resolve(Digit.UploadServices.Filefetch(o,Digit.ULBService.getStateId())).then(i):i())}catch(e){return Promise.reject(e)}},X=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("edit")?t("SV_UPDATE_SUCCESSFULL"):t("SV_SUBMIT_SUCCESSFULL"):e.isLoading?t("SV_APPLICATION_PENDING"):e.isSuccess?void 0:t("SV_APPLICATION_FAILED")},J={padding:"4px 0px",justifyContent:"space-between"},Q=e=>{var n,i;return l.createElement(t.Banner,{message:X(e),applicationNumber:null===(n=e.data)||void 0===n||null===(i=n.SVDetail)||void 0===i?void 0:i.applicationNo,info:e.isSuccess?e.t("SV_APPLICATION_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},ee=e=>l.createElement("h1",{className:"heading-m"},e.label),te=()=>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"})),ne=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(te,null)),le=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:S}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,y]=n.useState({}),[_,b]=n.useState({}),[A,C]=n.useState([]),[N,T]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(null),[R,L]=n.useState(null),[P,M]=n.useState([]),[k,B]=n.useState(null),[F,V]=n.useState(!1);function U(e){O(e.target.files[0])}return n.useEffect(()=>{var e;S&&S["egf-master"]&&M(null===(e=S["egf-master"])||void 0===e?void 0:e.FinancialYear)},[S]),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{L(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",I,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?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.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)}}()},[I]),n.useEffect(()=>{r&&y(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:k,setSelectedFinancialYear:B}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:T,selectFile:U,uploadedFile:w,setUploadedFile:x,businessService:m}))},[r,A,P,k,w]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ee,{label:a(h.label.heading)}),headerBarEnd:l.createElement(ne,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:E||(null==r?void 0:r.docUploadRequired)&&!w,formId:"modal-action"},g?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",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:d({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==k?void 0:k.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],w&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:w}]),c({Property:d({},v,{workflow:t})})}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},ie=e=>l.createElement("h1",{className:"heading-m"},e.label),oe=()=>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"})),ae=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(oe,null)),re=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,S]=n.useState({}),[h,y]=n.useState({}),[_,b]=n.useState([]),[A,C]=n.useState({}),[N,T]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(null),[R,L]=n.useState([]),[P,M]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:k}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){T(e.target.files[0])}return n.useEffect(()=>{if(p&&k){var e;const t=k["common-masters"].Department;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):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((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:d,uploadedFile:u,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:_,selectedApprover:A,setSelectedApprover:C,selectFile:B,uploadedFile:I,setUploadedFile:O,businessService:m}))},[r,_,R,P,I]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ie,{label:a(g.label.heading)}),headerBarEnd:l.createElement(ae,{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){v=d({},v,{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:I?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:I}]:null}),c({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},de=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ue=()=>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"})),se=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ue,null)),ce=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState({}),[C,N]=n.useState(null),[T,I]=n.useState(null),[O,w]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function R(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{w(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))w(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(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:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:d,uploadedFile:u,setUploadedFile:s,businessService:c,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{s(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:T,setUploadedFile:I,businessService:m,error:O}))},[r,y,T,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(de,{label:a(E.label.heading)}),headerBarEnd:l.createElement(se,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.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"}:{}},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=d({},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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null}),c({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},ve=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),me=()=>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"})),pe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(me,null)),fe=e=>{var i,o,r,u,s,c,v,m,p,f,E,g;let{t:S,action:h,tenantId:y,closeModal:_,submitAction:b,applicationDetails:A,applicationData:C,businessService:N,workflowDetails:T,blockReason:I}=e;console.log("applicationData_BPAACTIONMODAL",C),console.log("workflowDetails_BPAACTIONMODAL",T),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:y,!1);const{data:O,isLoading:w}=Digit.Hooks.useEmployeeSearch(y,{roles:null==T||null===(v=T.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===(g=E.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=h&&h.isTerminateState)}),[x,R]=(a.useQueryClient(),n.useState({})),[L,P]=n.useState({}),[M,k]=n.useState([]),[B,F]=n.useState([]),[V,U]=n.useState({}),[H,W]=n.useState({}),[j,z]=n.useState(null),[K,G]=n.useState(null),[Y,q]=n.useState(null),[Z,$]=n.useState(null),X=!!Digit.Utils.browser.isMobile();function J(e){z(e.target.files[0])}n.useEffect(()=>{var e;k(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(S("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))q(S("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==y?void 0:y.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):q(S("CS_FILE_UPLOAD_ERROR"))})},function(){q(S("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},ee=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},te=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Q(e.Documents),date:e.InspectionDate,questions:ee(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},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(()=>{F(null==I?void 0:I.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),h&&R((e=>{var n,i,o,a,r,d,u;let{t:s,action:c,approvers:v,selectedApprover:m,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:g,uploadedFile:S,setUploadedFile:h,assigneeLabel:y,businessService:_,error:b,blockReasonFiltered:D}=e,A=!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)||(A=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+_+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||A||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(i=c.state)||void 0===i?void 0:i.state)?null:s(y||"WF_ROLE_"+(null===(o=c.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:c.isTerminateState||A||"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===(d=c.state)||void 0===d?void 0:d.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?l.createElement(t.Dropdown,{option:D,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{h(null)},message:S?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:S,action:h,approvers:M,selectedApprover:V,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:K,setUploadedFile:G,businessService:N,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:B}))},[h,M,Z,K,Y]),h&&x.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ve,{label:S(x.label.heading)}),headerBarEnd:l.createElement(pe,{onClick:_}),actionCancelLabel:S(x.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:S(x.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},w?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:x.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,u,s,c,v,m,p,f,E,g,y,D,N,I,O,w,x,R,L,P,M,k,B,F,U,W,z,G,Y,q,Z,$,X,J,Q,ee;if(C=d({},C,{documents:null===(t=C)||void 0===t?void 0:t.documents,additionalDetails:d({},null===(n=C)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:te(C),pendingapproval:ne(),blockingReason:null==H?void 0:H.name}),workflow:{action:null==h?void 0:h.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(o=T.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==T||null===(s=T.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=V&&V.uuid?[null==V?void 0:V.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(p=T.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.state)||void 0===g?void 0:g.applicationStatus)?[null==T||null===(y=T.data)||void 0===y||null===(D=y.processInstances)||void 0===D||null===(N=D[0])||void 0===N||null===(I=N.assigner)||void 0===I?void 0:I.uuid]:null!=V&&V.uuid?[null==V?void 0:V.uuid]:null,varificationDocuments:K?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:K}]:null},action:null==h?void 0:h.action,riskType:null===(O=C)||void 0===O||null===(w=O.additionalDetails)||void 0===w?void 0:w.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(x=T.data)||void 0===x||null===(R=x.processInstances)||void 0===R||null===(L=R[0])||void 0===L||null===(P=L.state)||void 0===P?void 0:P.applicationStatus)?[null==T||null===(M=T.data)||void 0===M||null===(k=M.processInstances)||void 0===k||null===(B=k[0])||void 0===B||null===(F=B.assigner)||void 0===F?void 0:F.uuid]:null!=V&&V.uuid?[null==V?void 0:V.uuid]:null,wfDocuments:K?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:K}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(U=C)||void 0===U||null===(W=U.additionalDetails)||void 0===W||null===(z=W.selfCertificationCharges)||void 0===z?void 0:z.BPA_MALBA_CHARGES)+parseInt(null===(G=C)||void 0===G||null===(Y=G.additionalDetails)||void 0===Y||null===(q=Y.selfCertificationCharges)||void 0===q?void 0:q.BPA_LABOUR_CESS)+parseInt(null===(Z=C)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(X=$.selfCertificationCharges)||void 0===X?void 0:X.BPA_WATER_CHARGES)+parseInt(null===(J=C)||void 0===J||null===(Q=J.additionalDetails)||void 0===Q||null===(ee=Q.selfCertificationCharges)||void 0===ee?void 0:ee.BPA_GAUSHALA_CHARGES_CESS))_(),alert(S("Enterd Less Adjustment amount is invalid"));else{var le,ie;const e=null==A||null===(le=A.nocData)||void 0===le?void 0:le.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||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];if(e&&e.map(e=>{var t,o,a,r,d,u,s,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(d=e.Noc)||void 0===d||null===(u=d.applicationStatus)||void 0===u?void 0:u.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(_(),alert(S("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},Ee=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ge=()=>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"})),Se=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ge,null)),he=e=>{var i,r,u,s,c,v,m;let{t:p,action:f,tenantId:E,closeModal:g,submitAction:S,applicationData:h,businessService:y}=e;const{data:_,isLoading:b}=Digit.Hooks.useEmployeeSearch(E,{roles:null===(i=workflowDetails)||void 0===i||null===(r=i.data)||void 0===r||null===(u=r.initialActionState)||void 0===u||null===(s=u.nextActions)||void 0===s||null===(c=s.filter(e=>(null==e?void 0:e.action)==(null==f?void 0:f.action)))||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.assigneeRoles)||void 0===m?void 0:m.map(e=>({code:e})),isActive:!0},{enabled:!(null!=f&&f.isTerminateState)}),[A,C]=(a.useQueryClient(),n.useState({})),[N,T]=n.useState({}),[I,O]=n.useState([]),[w,x]=n.useState({}),[R,L]=n.useState(null),[P,M]=n.useState(null),[k,B]=n.useState(null),F=!!Digit.Utils.browser.isMobile();function V(e){L(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;O(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(()=>{!function(){try{B(null);const e=function(){if(R){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(R.size>=5242880)B(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=R&&R.type&&!e.test(null==R?void 0:R.type))B(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",R,Digit.ULBService.getStateId()||(null==E?void 0:E.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?M(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):B(p("CS_FILE_UPLOAD_ERROR"))})},function(){B(p("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)}}()},[R]),n.useEffect(()=>{f&&C((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:f,approvers:I,selectedApprover:w,setSelectedApprover:x,selectFile:V,uploadedFile:P,setUploadedFile:M,businessService:y,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:k}))},[f,I,P,k]),f&&A.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ee,{label:p(A.label.heading)}),headerBarEnd:l.createElement(Se,{onClick:g}),actionCancelLabel:p(A.label.cancel),actionCancelOnSubmit:g,actionSaveLabel:p(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:F?{width:"720px"}:{},style:F?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:F?{paddingLeft:"5px"}:{}},b?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:A.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=h)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=h)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),h=d({},h,{workflow:{action:null==f?void 0:f.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=w&&w.uuid?[null==w?void 0:w.uuid]:null,documents:P?[{documentType:(null==f?void 0:f.action)+" DOC",fileName:null==R?void 0:R.name,fileStoreId:P}]:null},documents:o}),S({Noc:h},!1,{isNoc:!0})},defaultValues:N,formId:"modal-action"})):l.createElement(t.Loader,null)};var ye=function(e,t){return e===t||e!=e&&t!=t},_e=function(e,t){for(var n=e.length;n--;)if(ye(e[n][0],t))return n;return-1},be=Array.prototype.splice;function De(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])}}De.prototype.clear=function(){this.__data__=[],this.size=0},De.prototype.delete=function(e){var t=this.__data__,n=_e(t,e);return!(n<0||(n==t.length-1?t.pop():be.call(t,n,1),--this.size,0))},De.prototype.get=function(e){var t=this.__data__,n=_e(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return _e(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,l=_e(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ae,Ce=De,Ne="object"==typeof z&&z&&z.Object===Object&&z,Te="object"==typeof self&&self&&self.Object===Object&&self,Ie=Ne||Te||Function("return this")(),Oe=Ie.Symbol,we=Object.prototype,xe=we.hasOwnProperty,Re=we.toString,Le=Oe?Oe.toStringTag:void 0,Pe=Object.prototype.toString,Me=Oe?Oe.toStringTag:void 0,ke=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Me&&Me in Object(e)?function(e){var t=xe.call(e,Le),n=e[Le];try{e[Le]=void 0;var l=!0}catch(e){}var i=Re.call(e);return l&&(t?e[Le]=n:delete e[Le]),i}(e):function(e){return Pe.call(e)}(e)},Be=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Fe=function(e){if(!Be(e))return!1;var t=ke(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ve=Ie["__core-js_shared__"],Ue=(Ae=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||""))?"Symbol(src)_1."+Ae:"",He=Function.prototype.toString,We=function(e){if(null!=e){try{return He.call(e)}catch(e){}try{return e+""}catch(e){}}return""},je=/^\[object .+?Constructor\]$/,ze=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Be(e)||(t=e,Ue&&Ue in t))&&(Fe(e)?ze:je).test(We(e));var t}(n)?n:void 0},Ge=Ke(Ie,"Map"),Ye=Ke(Object,"create"),qe=Object.prototype.hasOwnProperty,Ze=Object.prototype.hasOwnProperty;function $e(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])}}$e.prototype.clear=function(){this.__data__=Ye?Ye(null):{},this.size=0},$e.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$e.prototype.get=function(e){var t=this.__data__;if(Ye){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(t,e)?t[e]:void 0},$e.prototype.has=function(e){var t=this.__data__;return Ye?void 0!==t[e]:Ze.call(t,e)},$e.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ye&&void 0===t?"__lodash_hash_undefined__":t,this};var Xe=$e,Je=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 Qe(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])}}Qe.prototype.clear=function(){this.size=0,this.__data__={hash:new Xe,map:new(Ge||Ce),string:new Xe}},Qe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Je(this,e).get(e)},Qe.prototype.has=function(e){return Je(this,e).has(e)},Qe.prototype.set=function(e,t){var n=Je(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var et=Qe;function tt(e){var t=this.__data__=new Ce(e);this.size=t.size}tt.prototype.clear=function(){this.__data__=new Ce,this.size=0},tt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},tt.prototype.get=function(e){return this.__data__.get(e)},tt.prototype.has=function(e){return this.__data__.has(e)},tt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ce){var l=n.__data__;if(!Ge||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new et(l)}return n.set(e,t),this.size=n.size,this};var nt=tt,lt=function(){try{var e=Ke(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),it=function(e,t,n){"__proto__"==t&&lt?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ot=Object.prototype.hasOwnProperty,at=function(e,t,n){var l=e[t];ot.call(e,t)&&ye(l,n)&&(void 0!==n||t in e)||it(e,t,n)},rt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],d=l?l(n[r],e[r],r,n,e):void 0;void 0===d&&(d=e[r]),i?it(n,r,d):at(n,r,d)}return n},dt=function(e){return null!=e&&"object"==typeof e},ut=function(e){return dt(e)&&"[object Arguments]"==ke(e)},st=Object.prototype,ct=st.hasOwnProperty,vt=st.propertyIsEnumerable,mt=ut(function(){return arguments}())?ut:function(e){return dt(e)&&ct.call(e,"callee")&&!vt.call(e,"callee")},pt=Array.isArray,ft=function(){return!1},Et=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Ie.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ft}),gt=/^(?:0|[1-9]\d*)$/,St=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&gt.test(e))&&e>-1&&e%1==0&&e<t},ht=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},yt={};yt["[object Float32Array]"]=yt["[object Float64Array]"]=yt["[object Int8Array]"]=yt["[object Int16Array]"]=yt["[object Int32Array]"]=yt["[object Uint8Array]"]=yt["[object Uint8ClampedArray]"]=yt["[object Uint16Array]"]=yt["[object Uint32Array]"]=!0,yt["[object Arguments]"]=yt["[object Array]"]=yt["[object ArrayBuffer]"]=yt["[object Boolean]"]=yt["[object DataView]"]=yt["[object Date]"]=yt["[object Error]"]=yt["[object Function]"]=yt["[object Map]"]=yt["[object Number]"]=yt["[object Object]"]=yt["[object RegExp]"]=yt["[object Set]"]=yt["[object String]"]=yt["[object WeakMap]"]=!1;var _t=function(e){return function(t){return e(t)}},bt=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&Ne.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Dt=bt&&bt.isTypedArray,At=Dt?_t(Dt):function(e){return dt(e)&&ht(e.length)&&!!yt[ke(e)]},Ct=Object.prototype.hasOwnProperty,Nt=function(e,t){var n=pt(e),l=!n&&mt(e),i=!n&&!l&&Et(e),o=!n&&!l&&!i&&At(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],d=r.length;for(var u in e)!t&&!Ct.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||St(u,d))||r.push(u);return r},Tt=Object.prototype,It=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Tt)},Ot=function(e,t){return function(n){return e(t(n))}},wt=Ot(Object.keys,Object),xt=Object.prototype.hasOwnProperty,Rt=function(e){return null!=e&&ht(e.length)&&!Fe(e)},Lt=function(e){return Rt(e)?Nt(e):function(e){if(!It(e))return wt(e);var t=[];for(var n in Object(e))xt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Pt=Object.prototype.hasOwnProperty,Mt=function(e){return Rt(e)?Nt(e,!0):function(e){if(!Be(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=It(e),n=[];for(var l in e)("constructor"!=l||!t&&Pt.call(e,l))&&n.push(l);return n}(e)},kt=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Ie.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Bt=function(){return[]},Ft=Object.prototype.propertyIsEnumerable,Vt=Object.getOwnPropertySymbols,Ut=Vt?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];Ft.call(e,r)&&(a[o++]=r)}return a}(Vt(e)))}:Bt,Ht=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Wt=Ot(Object.getPrototypeOf,Object),jt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ht(t,Ut(e)),e=Wt(e);return t}:Bt,zt=function(e,t,n){var l=t(e);return pt(e)?l:Ht(l,n(e))},Kt=function(e){return zt(e,Lt,Ut)},Gt=function(e){return zt(e,Mt,jt)},Yt=Ke(Ie,"DataView"),qt=Ke(Ie,"Promise"),Zt=Ke(Ie,"Set"),$t=Ke(Ie,"WeakMap"),Xt=We(Yt),Jt=We(Ge),Qt=We(qt),en=We(Zt),tn=We($t),nn=ke;(Yt&&"[object DataView]"!=nn(new Yt(new ArrayBuffer(1)))||Ge&&"[object Map]"!=nn(new Ge)||qt&&"[object Promise]"!=nn(qt.resolve())||Zt&&"[object Set]"!=nn(new Zt)||$t&&"[object WeakMap]"!=nn(new $t))&&(nn=function(e){var t=ke(e),n="[object Object]"==t?e.constructor:void 0,l=n?We(n):"";if(l)switch(l){case Xt:return"[object DataView]";case Jt:return"[object Map]";case Qt:return"[object Promise]";case en:return"[object Set]";case tn:return"[object WeakMap]"}return t});var ln=nn,on=Object.prototype.hasOwnProperty,an=Ie.Uint8Array,rn=function(e){var t=new e.constructor(e.byteLength);return new an(t).set(new an(e)),t},dn=/\w*$/,un=Oe?Oe.prototype:void 0,sn=un?un.valueOf:void 0,cn=Object.create,vn=function(){function e(){}return function(t){if(!Be(t))return{};if(cn)return cn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mn=bt&&bt.isMap,pn=mn?_t(mn):function(e){return dt(e)&&"[object Map]"==ln(e)},fn=bt&&bt.isSet,En=fn?_t(fn):function(e){return dt(e)&&"[object Set]"==ln(e)},gn={};gn["[object Arguments]"]=gn["[object Array]"]=gn["[object ArrayBuffer]"]=gn["[object DataView]"]=gn["[object Boolean]"]=gn["[object Date]"]=gn["[object Float32Array]"]=gn["[object Float64Array]"]=gn["[object Int8Array]"]=gn["[object Int16Array]"]=gn["[object Int32Array]"]=gn["[object Map]"]=gn["[object Number]"]=gn["[object Object]"]=gn["[object RegExp]"]=gn["[object Set]"]=gn["[object String]"]=gn["[object Symbol]"]=gn["[object Uint8Array]"]=gn["[object Uint8ClampedArray]"]=gn["[object Uint16Array]"]=gn["[object Uint32Array]"]=!0,gn["[object Error]"]=gn["[object Function]"]=gn["[object WeakMap]"]=!1;var Sn=function e(t,n,l,i,o,a){var r,d=1&n,u=2&n,s=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!Be(t))return t;var c=pt(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&on.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!d)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=ln(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(Et(t))return kt(t,d);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=u||m?{}:function(e){return"function"!=typeof e.constructor||It(e)?{}:vn(Wt(e))}(t),!d)return u?function(e,t){return rt(e,jt(e),t)}(t,function(e,t){return e&&rt(t,Mt(t),e)}(r,t)):function(e,t){return rt(e,Ut(e),t)}(t,function(e,t){return e&&rt(t,Lt(t),e)}(r,t))}else{if(!gn[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rn(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rn(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?rn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,dn.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return sn?Object(sn.call(e)):{}}}(t,v,d)}}a||(a=new nt);var p=a.get(t);if(p)return p;a.set(t,r),En(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(s?u?Gt:Kt:u?Mt:Lt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),at(r,o,e(i,n,l,o,t,a))}),r},hn=function(e){return Sn(e,5)};const yn=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"})),bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_n,null)),Dn=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}},An=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState({}),[C,N]=n.useState(null),[T,I]=n.useState(null),[O,w]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),R=window.location.href.includes("/employee");function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{w(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))w(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,d({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{v(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m,error:O})):r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m,error:O}))},[r,y,T,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(bn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&R?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,g,S,h,y,_,D,A,N;const t=d({},null===(E=v)||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===(S=v)||void 0===S?void 0:S.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(y=h.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(_=v)&&void 0!==_&&null!==(D=_.applicationType)&&void 0!==D&&D.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=v)&&void 0!==A&&null!==(N=A.applicationType)&&void 0!==N&&N.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.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!=b&&b.uuid?[{uuid:null==b?void 0:b.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(v=d({},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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null,processInstance:d({},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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=hn(null==e?void 0:e.date);v.disconnectionExecutionDate=Dn(t)}else if(null!=e&&e.date){const t=hn(null==e?void 0:e.date);v.connectionExecutionDate=Dn(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(m=s.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=v)||void 0===I?void 0:I.serviceType)?c({WaterConnection:v,disconnectRequest:!0}):c({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var O,w,x,R,L,P,M,k,B,F,V,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenalty)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(V=t.value)&&void 0!==V&&V.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Cn=e=>l.createElement("h1",{className:"heading-m"},e.label),Nn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Nn,null)),In=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState(null),[C,N]=n.useState(null),[T,I]=n.useState(null),[O,w]=n.useState(null),[x,R]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{w(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(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:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,y,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Cn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Tn,{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",c({PetRegistrationApplications:[d({},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],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),c({PetRegistrationApplications:[d({},v,{workflow:t})]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},On=e=>l.createElement("h1",{className:"heading-m"},e.label),wn=()=>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(wn,null)),Rn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[g,S]=n.useState({}),[h,y]=n.useState({}),[_,b]=n.useState([]),[D,A]=n.useState(""),[C,N]=n.useState([]),[T,I]=n.useState(null),O=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",O);const w=n.useMemo(()=>{var e;if(E||!f||!O.length)return[];const t=new Set(O.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,O]);return console.log("years",w),n.useEffect(()=>{u&&S((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:d}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:w,selectedApprover:D,setSelectedApprover:A,businessService:m}))},[u,w,C,T]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(On,{label:r(g.label.heading)}),headerBarEnd:l.createElement(xn,{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=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=d({},v,{financialYear:i,action:"INITIATE",additionalDetail:d({},v.additionalDetail,{validityYears:D.length>0?parseInt(D):""})}),c({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),Pn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Mn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pn,null)),kn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState(null),[C,N]=n.useState(null),[T,I]=n.useState(null),[O,w]=n.useState(null),[x,R]=n.useState(!1);function L(e){R(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{w(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(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(R(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:d,selectedApprover:u,setSelectedApprover:s,isUploading:c}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:d,t:n,optionKey:"name",select:s,selected:u})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m,isUploading:x}))},[r,y,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ln,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Mn,{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};T&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),c({streetVendingDetail:d({},v,{workflow:n})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Fn=()=>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(Fn,null)),Un=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[b,A]=n.useState(null),[C,N]=n.useState(null),[T,I]=n.useState(null),[O,w]=n.useState(null),[x,R]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_(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{w(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(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:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:d}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+d+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,y,T]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Vn,{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};T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:T}]),c({hallsBookingApplication:[d({},v,{workflow:t})]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Hn=e=>l.createElement("h1",{className:"heading-m"},e.label),Wn=()=>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"})),jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Wn,null)),zn=e=>{var i,a,r;let{t:u,action:s,tenantId:c,closeModal:v,submitAction:m,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)}),S=o.useHistory(),[h,y]=n.useState({}),[_,b]=n.useState({}),[D,A]=n.useState([]),[C,N]=n.useState(null),[T,I]=n.useState(null);return n.useEffect(()=>{var e;A(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)?S.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):y((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:D,selectedApprover:C,setSelectedApprover:N,uploadedFile:T,setUploadedFile:I,businessService:f}))},[s,D,T]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Hn,{label:u(h.label.heading)}),headerBarEnd:l.createElement(jn,{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};T&&(t.documents=[]),m({Asset:d({},p,{workflow:t})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Kn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(le,e):null!=e&&e.businessService.includes("ptr")?l.createElement(In,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(re,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Rn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ce,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(fe,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(he,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(An,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(kn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Un,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(zn,e):void 0;function Gn(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:d}=e;const{t:u}=i.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==n?void 0:n.map((e,i)=>{var o,s,c;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:d||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},u(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:d||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==n?void 0:n.map((e,n)=>{var 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"}},u(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"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(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"}},""+u(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Yn=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:d,bpaActionsDetails:u}=e;const s=(null==r?void 0:r.status)||"",c=(null==u||null===(t=u.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,S]=n.useState([]),[h,y]=n.useState(!0),[_,b]=n.useState(!1),[D,A]=n.useState(!1),{isLoading:C,data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:T,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==N||null===(o=N.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let u=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==d||null===(l=d[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),u.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(u)),S(u)},[!C,!T]),n.useEffect(()=>{let e=0;g.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)}),y("0"!=e&&0!=e||!(m.length>0))},[m,_]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,u]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(qn,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:D}))))};function qn(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:c,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,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===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[S,h]=n.useState(null),[y,_]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[b,D]=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==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==E?void 0:E.code,fileStoreId:y,documentUid:y,fileName:(null==S?void 0:S.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}]})},[y,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[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[S]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Gn,{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=>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 i;0!==Object.keys(n).length&&D(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Zn(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,i)=>{var o,r,d,u,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(d=e.date)||void 0===d?void 0:d.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===(u=e.questions)||void 0===u?void 0:u.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Gn,{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 $n(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:d}=e;const u=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(),[m,p]=n.useState(null),[f,E]=n.useState(()=>(null==u?void 0:u.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=D(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Xn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:d,applicationData:u,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),m=(null==u?void 0:u.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:d}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!d}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[S,h]=n.useState([]),[y,_]=n.useState([]),[b,D]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[N,T]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,s,c;l=d?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==u?void 0:u.status)&&e.RiskType==(null==u?void 0:u.riskType)&&e.ServiceType==(null==u||null===(t=u.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==u||null===(n=u.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==S||S.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)}),_(v))},[f,S]),n.useEffect(()=>{D("NOC_VERIFICATION_INPROGRESS"===m&&(null==p?void 0:p.length)>0)},[u,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:I?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:I?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:I?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Gn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==y?void 0:y.map((e,t)=>l.createElement($n,{key:t,document:e,t:o,error:N,setError:T,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:b}))))},Jn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,c,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?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 i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Qn(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 el(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 tl(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 i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const nl=e=>{var o,a;let{scrutinyDetails:r,paymentsList:d=[],additionalDetails:u,applicationData:s}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==s?void 0:s.status))&&window.location.href.includes("bpa");const[c,v]=n.useState(),[m,p]=n.useState(),[f,E]=n.useState(),g=Digit.ULBService.getStateId(),[S,h]=n.useState(),[y,_]=n.useState(),[b,A]=n.useState([]),[C,N]=n.useState(),[T,I]=n.useState(""),[O,w]=n.useState(null),[x,R]=n.useState({}),[L,P]=n.useState(!1),[M,k]=n.useState(!1);n.useEffect(()=>{!function(){try{w(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(C.size>=2e6)w(B("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=D(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?A([...b,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):w(B("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else w(B("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(b))},[b]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=u&&null!==(e=u.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==u?void 0:u.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==u||null===(n=u.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==u||null===(l=u.lessAdjustmentFeeFiles[(null==u||null===(i=u.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,g).then(e=>R(null==e?void 0:e.data))}v(null==u||null===(t=u.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==u||null===(n=u.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),p(null==u||null===(l=u.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==u||null===(i=u.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==u||null===(o=u.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==u||null===(a=u.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==u?void 0:u.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==u?void 0:u.otherFeesDiscription),A(null==u?void 0:u.lessAdjustmentFeeFiles)},[u]);const{t:B}=i.useTranslation(),F=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},B(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?B(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void B("NA");return l.createElement(n.Fragment,null,!(null!=r&&r.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==r||null===(o=r.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:""+B(""+e.title),text:null!=e&&e.value?F(e)+" "+B(null==e?void 0:e.isUnit):B("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:""+B(""+e.title),text:F(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},B(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},B(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},ll=e=>{var o,a,r,d,u;let{edcrDetails:s,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 g(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:Number(null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea).toFixed(2),FloorArea:Number(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function S(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==s||null===(o=s.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==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(d=r.value)||void 0===d||null===(u=d.planDetail)||void 0===u?void 0:u.blocks.map((e,n)=>{var i,o,a,r,d;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(d=r.blocks)||void 0===d?void 0:d.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:S(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:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},il=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))},ol=e=>{var o,a,r;let{data:d,OpenImage:u,privacy:s={}}=e;const[c,v]=n.useState(!1),{t:m}=i.useTranslation();return l.createElement("div",null,d.date&&l.createElement("p",null,d.date),l.createElement("p",null,d.name),d.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:d.mobileNumber,privacy:s}),l.createElement("p",null,"    ")),d.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+d.source.toUpperCase())),d.comment&&l.createElement(il,{otherComment:null==d?void 0:d.otherComment,headComment:null==d?void 0:d.comment}),null!=d&&d.wfComment?l.createElement("div",null,null==d||null===(o=d.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==d||null===(a=d.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==d?void 0:d.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==d?void 0:d.thumbnailsToShow)}})):null)};function al(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 rl(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 dl=e=>{var o,a,r,d,u;let{wsAdditionalDetails:s}=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:g,roadCuttingAddlDetails:S,activationDetails:h}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(o=s.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==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==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:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==S?void 0:S.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.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:""})))))))},ul=[{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"}],sl=[{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"}],cl=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),S=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[h,y]=n.useState(!1),[b,D]=n.useState(v||{}),[A,C]=n.useState(null),[N,T]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[I,O]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),w=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(w,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=d({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,c,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(c=v.billDetails)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.taxAmount)}];O(e),T(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),D(i)},[]);let x={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>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"})),P=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=d({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}D(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},I&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==I?void 0:I.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==N?void 0:N.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(S?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:S?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{y(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,h&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{D(v),y(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{D(v),y(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,S,h;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n=d({},null==s||null===(v=s.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(S=s.additionalDetails)||void 0===S||null===(h=S.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,d,u,s,c,v,p,f,g,S;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(S=g.taxHeadEstimates)||void 0===S||S.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const h=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(u=e.Calculation)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(hn(e.Calculation[0])),T(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),O(h),b.billDetails=null==e?void 0:e.Calculation,m(b),y(!1)}).catch(e=>{var t,n,l,i,o,a;C({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===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({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:ul,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"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,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==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},x={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==b?void 0:b.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},x={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:sl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"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,c("PT_REASON")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},x={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==b?void 0:b.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},x={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:c(null==A?void 0:A.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},vl=e=>{var o,a,r,d,u,s,c;let{wsAdditionalDetails:v}=e;const{t:m}=i.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),S=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"})),y=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),g(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(S,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(y,{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===(d=E.billSlabData)||void 0===d||null===(u=d.CHARGES)||void 0===u?void 0:u.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ml={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:{}},pl=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:ml.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ml.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:d({},ml.cell,ml.cellLeft,ml.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:d({},ml.cell,n.length==t+1?ml.cellRight:{},ml.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({},ml.cell,ml.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:d({},ml.cell,{textAlign:"left"},n.length==i+1?ml.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:d({},ml.cell,ml.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:d({},ml.cell,ml.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:d({},ml.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ml.cell,key:t,numeric:!0})))))))},fl={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))"}},El=e=>{var t,o,a;let{bill:r={}}=e;const{t:d}=i.useTranslation();let u={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||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));s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);u[((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={};!u||Object.keys(u).map((e,t)=>{Object.keys(u[e]).map(t=>{m[t]=u[e]&&u[e][t]&&u[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:fl.headerStyle},d("CS_ARREARS_DETAILS")),f&&l.createElement(pl,{headers:[...p],values:u,arrears:v}),!f&&l.createElement("div",{style:fl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},d("CS_SHOW_CARD"))),f&&l.createElement("div",{style:fl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},d("CS_HIDE_CARD"))))},gl=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}},"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),n!==t.length-1&&l.createElement("hr",null)))))},Sl=e=>{var t;let{applicationData:i}=e;const[a,r]=n.useState(!1);return o.useHistory(),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:()=>{r(!a)}},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"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{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"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},i.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(d=null===(t=i.auditDetails)||void 0===t?void 0:t.createdTime,new Date(d).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.status)),l.createElement("div",null,l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var d},hl=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payments found"),(null==t?void 0:t.length)>0&&l.createElement("div",null,l.createElement("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"10px"}},l.createElement("thead",null,l.createElement("tr",{style:{backgroundColor:"#f5f5f5"}},l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Receipt Number"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction Date"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Amount Paid"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Payment Mode"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction ID"),l.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Status"))),l.createElement("tbody",null,t.map((e,t)=>{var n,i;return l.createElement("tr",{key:e.id||t},l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},(null===(n=e.paymentDetails)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.receiptNumber)||e.receiptNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionDate?new Date(e.transactionDate).toLocaleDateString():"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},"₹",e.totalAmountPaid||e.amount||"0"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.paymentMode||e.instrumentType||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionNumber||e.instrumentNumber||"N/A"),l.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},l.createElement("span",{style:{color:"NEW"===e.paymentStatus||"SUCCESSFUL"===e.paymentStatus?"green":"FAILED"===e.paymentStatus?"red":"orange",fontWeight:"bold"}},e.paymentStatus||"N/A")))}))),l.createElement("div",{style:{marginTop:"10px",fontSize:"14px",color:"#666"}},"Total Payments: ",t.length))))};function yl(e){var a,r,u,s,c,v,m,p,f,E,g,S,h,y,b,A;let{applicationDetails:C,demandData:N,workflowDetails:T,isDataLoading:I,applicationData:O,timelineStatusPrefix:w,showTimeLine:x=!0,statusAttribute:R="status",paymentsList:L,oldValue:P,isInfoLabel:M=!1,propertyId:k,moduleCode:B}=e;const{t:F}=i.useTranslation(),V=o.useHistory(),U=Digit.ULBService.getCurrentTenantId(),[H,W]=n.useState(null),[j,z]=n.useState([]);let K=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function G(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}n.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=O&&O.connectionNo){const e=D(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==O?void 0:O.tenantId)||U,filters:{consumerCodes:null==O?void 0:O.connectionNo,consumerCode:null==O?void 0:O.connectionNo},BusinessService:"SEWERAGE"===(null==O?void 0:O.serviceType)?"SW":"WS"})).then(function(e){Array.isArray(e)&&e.length>0?z(e):null!=e&&e.Payments&&e.Payments.length>0&&z(e.Payments)})},function(e){console.error("Payment fetch error:",e)});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[null==O?void 0:O.connectionNo,null==O?void 0:O.tenantId,null==O?void 0:O.serviceType,U]);const[Y,q]=n.useState({}),[Z,$]=n.useState(),[X,J]=n.useState([]),[Q,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.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(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)});const o=Array.from(l.values());return J(o),$(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||U,null==O?void 0:O.propertyId,q,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ne=function(e,t,n){if(void 0===t&&(t=0),!e)return null;if("OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==O||null===(i=O.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(ol,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,b,D;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},A=n&&Array.isArray(n)&&t>0&&t-1<n.length?n[t-1]:null,N={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:(null==e||null===(d=e.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.name)||"N/A",mobileNumber:(null==O||null===(s=O.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(p=m[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===(S=O.processInstance)||void 0===S||null===(h=S.assignes)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber:(null==e||null===(b=e.assignes)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.mobileNumber)||"N/A",comment:null!=e&&e.comment?F(e.comment):"N/A",wfComment:A&&A.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return l.createElement(ol,{data:N,OpenImage:G,privacy:i})}{var A,N,T,I,w;const t={date:te(null==O||null===(A=O.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:(null==e||null===(N=e.assignes)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.name)||"N/A",wfComment:(null==e?void 0:e.wfComment)||[],mobileNumber:(null==e||null===(I=e.assignes)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.mobileNumber)||"N/A"};return l.createElement(ol,{data:t})}},le=(e,t)=>e?t?e:F(e):F("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),de=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)+" "+F(null==e?void 0:e.isUnit):F("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):F("N/A"),[ue,se]=n.useState(!1),ce=(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),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)},U,n)).then(function(){})}catch(e){return Promise.reject(e)}}),ve=null==C?void 0:C.applicationData,me=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return n.useEffect(()=>{try{if("WS"===B)return;let e={consumerCodes:k};const t=!0;"BPREG"===B?Digit.OBPSService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):Digit.PTService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)})}catch(e){}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,N,I,O,w,x,R,M,k,B,V,U,H,W,j,z,G,q,Z,$;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"}:ie?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+F(e.title):F(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},F(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"}},F(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},F(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},F(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,i)=>{var a,r,d;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:F(n.title),label:F(n.title),text:l.createElement("img",{src:F(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:F(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"}},F(null==n?void 0:n.title)))):oe||ae?""+F(n.title):F(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===(d=e.values)||void 0===d?void 0:d.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:""+F(""+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:F(n.title),label:F(n.title),text:de(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(El,{bill:null===(r=Y.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(nl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:L,additionalDetails:null==C||null===(d=C.applicationData)||void 0===d?void 0:d.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(u=C.applicationData)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(Zn,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(el,{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(tl,{owners:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(rl,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories)&&l.createElement(al,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!K&&(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions)&&(null==T||null===(A=T.data)||void 0===A||null===(N=A.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(Jn,{applicationData:null==C?void 0:C.applicationData,t:F,permissions:null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.permissions}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Yn,{t:F,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&l.createElement(Xn,{t:F,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(x=e.additionalDetails)||void 0===x?void 0:x.data,bpaActionsDetails:T}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(nl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.buildingExtractionDetails)&&l.createElement(nl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.subOccupancyTableDetails)&&l.createElement(ll,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(Gn,{documents:null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documentsWithUrl}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.taxHeadEstimatesCalculation)&&l.createElement(Qn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(dl,{wsAdditionalDetails:e,oldValue:P}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(j=e.additionalDetails)||void 0===j||null===(z=j.redirectUrl)||void 0===z?void 0:z.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(G=e.additionalDetails)||void 0===G||null===(q=G.redirectUrl)||void 0===q?void 0:q.title))),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.estimationDetails)&&l.createElement(cl,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.estimationDetails)&&l.createElement(vl,{wsAdditionalDetails:e,workflowDetails:T}))}),(null==Z?void 0:Z.length)>0&&l.createElement(gl,{assessmentData:X}),l.createElement(hl,{payments:j}),"WS"!==B&&l.createElement(Sl,{applicationData:null==C?void 0:C.applicationData}),x&&(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)||I)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!I&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},F("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(v=T.data)&&void 0!==v&&v.timeline&&1===(null==T||null===(m=T.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:F(""+w+(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===(S=T.data)||void 0===S?void 0:S.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(h=T.data)||void 0===h?void 0:h.timeline)&&(null==T||null===(y=T.data)||void 0===y?void 0:y.timeline.slice(0,ue?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,d,u,s,c,v;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.data)&&void 0!==r&&null!==(d=r.timeline[n-1])&&void 0!==d&&null!==(u=d.state)&&void 0!==u&&u.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:F(""+w+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[R])+a),customChild:ne(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(b=T.data)||void 0===b||null===(A=b.timeline)||void 0===A?void 0:A.length)>2&&l.createElement(t.LinkButton,{label:F(ue?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{se(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(ve,"ACTIVE",me):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(ve,"INACTIVE",me):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&V.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&V.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:F(H.label),onClose:()=>{W(null)},isDleteBtn:"false"}))}function _l(e){var n,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y;let{t:_,showToast:b,closeToast:D,businessService:A}=e;if(null!=A&&A.includes("NewTL")||null!=A&&A.includes("TL")||null!=A&&A.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:_("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:_("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:_("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:_("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:_("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:_("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:_("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:_("ES_"+A+"_"+(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:D}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.includes("BPA_OC")){var N;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!=A&&A.includes("BPA_OC")?_(e[1]):_(e[0]),n};let n="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.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===(g=b.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==b?void 0:b.key)?null==b||null===(S=b.error)||void 0===S?void 0:S.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:_("ES_"+A+"_"+(null==b||null===(y=b.action)||void 0===y?void 0:y.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:D}))}{var T,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(T=b.error)||void 0===T?void 0:T.message:"ES_"+A+"_"+(null==b||null===(I=b.action)||void 0===I?void 0:I.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:_(e),onClose:D}))}}function bl(e){var o,a,r,u,s,c,v,m,p,f,E,g,S,h,y,_;let{workflowDetails:b,displayMenu:D,onActionSelect:A,setDisplayMenu:C,businessService:N,forcedActionPrefix:T,ActionBarStyle:I={},MenuStyle:O={}}=e;const{t:w}=i.useTranslation();let x=Digit.UserService.getUser();const R=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};x=null==t?void 0:t.value}const L=null===(o=x)||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 P=!1,M=!1,k=(null==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==L?void 0:L.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==L?void 0:L.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",b),Digit.Hooks.useClickOutside(R,()=>{C(!1)},D),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(p=k[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(M=!1,P=!0):(null==k?void 0:k.length)>0&&(M=!0,P=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&M&&!P&&l.createElement(t.ActionBar,{style:d({},I)},D&&(null!=b&&null!==(E=b.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=b&&null!==(S=b.data)&&void 0!==S&&S.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:T||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()),options:k,optionKey:"action",t:w,onSelect:A,style:O}):null,l.createElement(t.SubmitBar,{ref:R,label:w("WF_TAKE_ACTION"),onSubmit:()=>C(!D)})),!(null!=b&&b.isLoading)&&!M&&P&&l.createElement(t.ActionBar,{style:d({},I)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==k||null===(h=k[0])||void 0===h?void 0:h.action,value:null==k||null===(y=k[0])||void 0===y?void 0:y.action,onClick:e=>{A((null==k?void 0:k[0])||{})}},w((T||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()))+"_"+(null==k||null===(_=k[0])||void 0===_?void 0:_.action)))))}const Dl=()=>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"})),Al=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Dl,null));function Cl(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(Al,{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 Nl=e=>{var r,u;let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=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,S]=n.useState(!1),[h,y]=n.useState(null),[_,b]=n.useState(!1),[A,C]=n.useState(!1),[N,T]=n.useState(!1),{data:I}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:w,totalDemandTax:x,totalBalanceTax:R,showToast:L,setShowToast:P,isLoading:M,isDataLoading:k,applicationData:B,mutate:F,nocMutation:V,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:z,timelineStatusPrefix:K,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:Z,paymentsList:$,showTimeLine:X=!0,oldValue:J,isInfoLabel:Q=!1,clearDataDetails:ee,propertyId:te}=e;n.useEffect(()=>{L&&U&&U.revalidate&&U.revalidate()},[L]);const ne=a.useQueryClient(),le=()=>{y(null),b(!1)};return console.log("ActionsInPayment2",U),M||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,M?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(yl,{applicationDetails:O,demandData:w,id:H,workflowDetails:U,isDataLoading:k,applicationData:B,totalDemandTax:x,totalBalanceTax:R,businessService:W,timelineStatusPrefix:K,statusAttribute:Y,paymentsList:$,showTimeLine:X,oldValue:J,isInfoLabel:Q,propertyId:te,moduleCode:z}),_?l.createElement(Kn,{t:p,action:h,tenantId:c,state:v,id:E,applicationDetails:O,applicationData:null==O?void 0:O.applicationData,closeModal:le,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,s,c,v,m,E,g,S,y,_,b,A,N,T){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.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===(g=E[0])||void 0===g||null===(S=g.comment)||void 0===S?void 0:S.length))||0==(null==e||null===(y=e.WaterConnection)||void 0===y||null===(_=y.comment)||void 0===_?void 0:_.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(A=b.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(N=e.BPA)||void 0===N||null===(T=N.comment)||void 0===T?void 0:T.length)){var I,O;"INITIATE"===(null==e||null===(I=e.Licenses)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;F&&(C(!0),F(e,{onError:(e,t)=>{C(!1),P({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,d;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var u,s,c,v,m,E,g,S;null!=t&&null!==(u=t.AmendmentUpdate)&&void 0!==u&&null!==(s=u.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(S=g.workflow)&&void 0!==S&&S.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var y,_,b;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(d=e.Licenses[0])&&void 0!==d&&d.applicationNumber)return null!=e&&null!==(y=e.Licenses[0])&&void 0!==y&&null!==(_=y.businessService)&&void 0!==_&&_.includes("BPAREG")?(P({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(b=e.Licenses[0])||void 0===b?void 0:b.applicationNumber)));P({key:"success",action:h}),ee&&setTimeout(ee,3e3),setTimeout(j,5e3);try{const e=(W||"").toUpperCase(),t=((null==h?void 0:h.action)||"").toUpperCase();e.includes("DISCONNECT")&&(t.includes("APPROVE")||t.includes("EXECUTE")||t.includes("APPROVE_CONNECTION"))&&setTimeout(()=>{var e;null!==(e=window)&&void 0!==e&&e.location&&(window.location.href="https://mseva.lgpunjab.gov.in/employee/inbox")},3e3)}catch(e){}ne.clear(),ne.refetchQueries("APPLICATION_SEARCH")}}})),le()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(d({},e)));const i=function(){if(!1!==t&&V){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==V?void 0:V.mutateAsync(e)),i=D(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,d,u,s,c,v,m;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(d=r.Errors)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;le(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:W,workflowDetails:U,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,N?l.createElement(Cl,{action:h,workflowDetails:U,businessService:W,isWarningPop:N,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(_l,{t:p,showToast:L,closeToast:j,businessService:W}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==I||null===(t=I.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==O||null===(n=O.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==O||null===(o=O.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),d={BPA:e.BPA[0]};d.BPA.riskType=r,d.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const u=function(e,t,n,l,i,o,a,r,u,s,v,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==d||null===(e=d.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==d||null===(l=d.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==d||null===(a=d.BPA)||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==d||null===(s=d.BPA)||void 0===s||null===(v=s.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(d,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(u&&u.then)return u.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(bl,{workflowDetails:U,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 i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,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 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))b(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:d({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else b(!0);y(e),S(!1)},setDisplayMenu:S,businessService:W,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:Z}))))},Tl=["tenantId","payments"];var Il=l.memo(()=>{var e,a,r,s,c,v,m,p,f,E,g,S;const{t:h}=i.useTranslation(),{data:y}=Digit.Hooks.useStore.getInitData(),_=Digit.ULBService.getCurrentTenantId(),{tenants:b}=y||{},{id:D}=o.useParams(),[A,C]=n.useState(null),[N,T]=n.useState({}),[I,O]=n.useState(!1);let w=!1;window.location.href.includes("applicationsearch")&&(w=!0);const{isLoading:x,data:R}=Digit.Hooks.sv.useSVApplicationDetail(h,_,D,!1),{mutate:L}=Digit.Hooks.sv.useSVApplicationAction(_);let P=Digit.Hooks.useWorkflowDetails({tenantId:(null==R||null===(e=R.applicationData)||void 0===e?void 0:e.tenantId)||_,id:null==R||null===(a=R.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.applicationNo,moduleCode:"street-vending",role:"SV_CEMP"});var M,k;n.useEffect(()=>{R&&T(G.cloneDeep(R))},[R]),!Digit.UserService.hasAccess(["SVCEMP"])||"street-vending"!==(null==P||null===(s=P.data)||void 0===s?void 0:s.applicationBusinessService)||null==P||null===(c=P.data)||void 0===c||null===(v=c.actionState)||void 0===v||null===(m=v.nextActions)||void 0===m||!m.find(e=>"PAY"===e.action)||(P.data.actionState.nextActions=null==P||null===(M=P.data)||void 0===M||null===(k=M.actionState)||void 0===k?void 0:k.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"SV_PAY",redirectionUrl:{pathname:"/digit-ui/employee/payment/collect/sv-services/"+(null==N||null===(t=N.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNo)}}:e}));let B=[{order:1,label:h("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=null==N?void 0:N.applicationData,t=b.find(t=>t.code===e.tenantId);return Promise.resolve($(e.applicationData,t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:F,isLoading:V}=Digit.Hooks.useRecieptSearch({tenantId:_,businessService:"sv-services",consumerCodes:null==N||null===(p=N.applicationData)||void 0===p||null===(f=p.applicationData)||void 0===f?void 0:f.applicationNo,isEmployee:!1},{enabled:!(null==N||null===(E=N.applicationData)||void 0===E||null===(g=E.applicationData)||void 0===g||!g.applicationNo)});return F&&(null==F?void 0:F.Payments.length)>0&&0==V&&B.push({label:h("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;u(e,Tl);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[d({},n)]},"svservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==F||null===(e=F.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==F?void 0:F.Payments[0]})}}),F&&(null==F?void 0:F.Payments.length)>0&&0==V&&B.push({label:h("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(_,{SVDetail:[null==R||null===(e=R.applicationData)||void 0===e?void 0:e.applicationData]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(_,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),F&&(null==F?void 0:F.Payments.length)>0&&0==V&&B.push({label:h("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(_,{SVDetail:[null==R||null===(e=R.applicationData)||void 0===e?void 0:e.applicationData]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(_,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},h("SV_APPLICATION_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},B&&B.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>O(!I),displayOptions:I,options:B,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(Nl,{isAction:w,applicationDetails:null==N?void 0:N.applicationData,isLoading:x,isDataLoading:x,applicationData:null==N||null===(S=N.applicationData)||void 0===S?void 0:S.applicationData,mutate:L,workflowDetails:P,businessService:"street-vending",moduleCode:"sv-services",showToast:A,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"SV_",forcedActionPrefix:"SV",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const Ol=e=>{var a,r,d;let{application:u,buttonLabel:s,previousDraftId:c,onDiscard:v}=e;const{t:m}=i.useTranslation(),p=o.useHistory(),[f,E]=n.useState(null);n.useEffect(()=>{if(f){const e=setTimeout(()=>{E(null)},2e3);return()=>clearTimeout(e)}},[f]);const g=!(null!=u&&null!==(a=u.applicationNo)&&void 0!==a&&a.length);return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:m("SV_APPLICATION_NUMBER"),note:null==u?void 0:u.applicationNo}),l.createElement(t.KeyNote,{keyValue:m("SV_VENDOR_NAME"),note:null==u||null===(r=u.vendorDetail)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.name}),l.createElement(t.KeyNote,{keyValue:m("SV_VENDING_TYPE"),note:null==u?void 0:u.vendingActivity}),l.createElement(t.KeyNote,{keyValue:m("SV_VENDING_ZONES"),note:null==u?void 0:u.vendingZone}),"STATIONARY"===(null==u?void 0:u.vendingActivity)&&l.createElement(t.KeyNote,{keyValue:m("SV_AREA_REQUIRED"),note:null==u?void 0:u.vendingArea}),"CITIZENACTIONREQUIRED"==(null==u?void 0:u.applicationStatus)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:m("SV_EDIT"),onSubmit:()=>{var e,t,n,l,i,o,a,r,d;sessionStorage.setItem("vendingApplicationID",null==u?void 0:u.applicationNo),sessionStorage.setItem("ApplicationId",null==u?void 0:u.applicationId),sessionStorage.setItem("applicationStatus",null==u?void 0:u.applicationStatus),sessionStorage.setItem("addressIdOne",null==u||null===(e=u.addressDetails)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.addressId),sessionStorage.setItem("addressIdTwo",null==u||null===(n=u.addressDetails)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.addressId),sessionStorage.setItem("vendorIds",null==u||null===(i=u.addressDetails)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.vendorId),sessionStorage.setItem("bankIds",null==u||null===(a=u.bankDetail)||void 0===a?void 0:a.id),sessionStorage.setItem("venId",null==u||null===(r=u.vendorDetail)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.id),p.push("/digit-ui/citizen/sv/edit")}}),l.createElement("div",{style:{display:"flex",gap:"5px"}},l.createElement(o.Link,{to:g?"/digit-ui/citizen/sv/apply/info":"/digit-ui/citizen/sv/application/"+(null==u?void 0:u.applicationNo)+"/"+(null==u?void 0:u.tenantId)},l.createElement(t.SubmitBar,{label:g?m("SV_CONTINUE"):s})),g&&l.createElement(t.SubmitBar,{label:m("SV_DISCARD"),onSubmit:function(){try{const e=D(function(){return Promise.resolve(Digit.SVService.deleteDraft({filters:{draftId:c}})).then(function(){E({error:!1,label:m("SV_DISCARD_MESSAGE")}),v&&v(u)})},function(e){console.error("Error discarding application:",e),E({error:!0,label:m("SV_DISCARD_ERROR")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),l.createElement("div",null,f&&l.createElement(t.Toast,{error:f.error,warning:f.warning,label:m(f.label),onClose:()=>{E(null)}})))},wl=e=>{var n,o,a;let{data:r,OpenImage:d}=e;const{t:u}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Reason,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,u("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)},xl=e=>{var a,r,d,u,s,c;const{t:v}=i.useTranslation(),m=null==e||null===(a=e.application)||void 0===a||null===(r=a.workflow)||void 0===r?void 0:r.businessService,{isLoading:p,data:f}=Digit.Hooks.useWorkflowDetails({tenantId:null===(d=e.application)||void 0===d?void 0:d.tenantId,id:e.id,moduleCode:m});function E(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const g=t=>{if("OPEN"===t.state){var n,i;const o={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return l.createElement(wl,{data:o})}if(t.state){var o,a,r,d,u;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name,mobileNumber:null==t||null===(d=t.assignes)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(wl,{data:e,OpenImage:E})}{var s,c;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(c=t.assigner)||void 0===c?void 0:c.name,comment:v(null==t?void 0:t.comment)};return l.createElement(wl,{data:n})}};return p?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!p&&l.createElement(n.Fragment,null,(null==f||null===(u=f.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=f&&f.timeline&&1===(null==f||null===(s=f.timeline)||void 0===s?void 0:s.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:v((null==f||null===(c=f.timeline[0])||void 0===c?void 0:c.state)&&"WF_"+m+"_"+f.timeline[0].state||"NA"),customChild:g(null==f?void 0:f.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==f?void 0:f.timeline)&&(null==f?void 0:f.timeline.map((e,n,i)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:v("SV_"+(null==f||null===(o=f.processInstances[n].state)||void 0===o?void 0:o.state)),customChild:g(e)}))})))),f&&(n=>{var i,a,r;let d=n[0];const u=n.map(e=>e.action);if(u.includes("PAY")||u.includes("EDIT")){let e=u.indexOf("EDIT")||u.indexOf("PAY");e=-1!=e?e:u.indexOf("PAY"),d=n[e]}switch(null===(i=d)||void 0===i?void 0:i.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/sv-services/"+(null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNo),state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(r=e.application)||void 0===r?void 0:r.applicationNo}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==f?void 0:f.nextActions))};var Rl=function(e){return"symbol"==typeof e||dt(e)&&"[object Symbol]"==ke(e)},Ll=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pl=/^\w*$/;function Ml(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ml.Cache||et),n}Ml.Cache=et;var kl,Bl,Fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vl=/\\(\\)?/g,Ul=(kl=Ml(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Fl,function(e,n,l,i){t.push(l?i.replace(Vl,"$1"):n||e)}),t},function(e){return 500===Bl.size&&Bl.clear(),e}),Bl=kl.cache,kl),Hl=Oe?Oe.prototype:void 0,Wl=Hl?Hl.toString:void 0,jl=function(e){if("string"==typeof e||Rl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const zl=["tenantId","payments"],Kl={Create:e=>{var t,n,r,u,c,v;const m=a.useQueryClient(),p=o.useRouteMatch(),{t:f}=i.useTranslation(),{pathname:E}=o.useLocation(),g=o.useHistory();Digit.ULBService.getStateId();let S=[];const[h,y,_]=Digit.Hooks.useSessionStorage("SV_CREATES",{}),b=sessionStorage.getItem("vendingApplicationID")?sessionStorage.getItem("vendingApplicationID"):null,{data:D}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{applicationNumber:b,isDraftApplication:!1},enabled:!!b}),A=null==D||null===(t=D.SVDetail)||void 0===t?void 0:t[0],{data:C}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{isDraftApplication:!0}}),N=null==C||null===(n=C.SVDetail)||void 0===n?void 0:n[0];function T(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=h.owners||[];n[l]=t,y(d({},h,{[e]:[...n]}))}else if("units"===e){let e=h.units||[];e=t,y(d({},h,{units:e}))}else y(d({},h,{[e]:d({},h[e],t)}));((e,t,n,l)=>{let i,o=E.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=E.slice(0,-3),o=o.split("/").pop(),r=!0):(o=E.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:d={}}=S.find(e=>e.route===o),u=g.push;if(e&&(u=g.replace),n&&(d=l),null===d)return u(p.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?p.path+"/"+d+"/"+t:p.path+"/"+d,u(i)})(n,l,i,e)}h&&Object.keys(h).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(_(),m.invalidateQueries("SV_CREATES"));const I=()=>{},O=()=>{};s.forEach(e=>{S=S.concat(e.body.filter(e=>!e.hideInCitizen))}),S.indexRoute="info";const w=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("CheckPage"),x=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,S.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,d="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n,u=Digit.UserService.getUser().info.type;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(d,{config:{texts:i,inputs:a,key:r},onSelect:T,onSkip:I,t:f,formData:h,onAdd:O,userType:u,editdata:E.includes("apply")?{}:A,previousData:N}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(w,{onSubmit:function(){try{return g.replace(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:h,editdata:E.includes("apply")?{}:A})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(x,{data:h,onSuccess:()=>{_(),m.invalidateQueries("SV_CREATES"),sessionStorage.removeItem("CategoryDocument"),sessionStorage.removeItem("vendingApplicationID"),sessionStorage.removeItem("ApplicationId"),sessionStorage.removeItem("applicationStatus"),sessionStorage.removeItem("Response"),sessionStorage.removeItem("addressIdOne"),sessionStorage.removeItem("addressIdTwo"),sessionStorage.removeItem("vendorIds"),sessionStorage.removeItem("bankIds"),sessionStorage.removeItem("venId")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+S.indexRoute})))},SVApplicantDetails:e=>{var i,o,a,u,s,c,v,m,f,E,g,S,h,y,_,b,D,A,C,N,T,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he,ye,_e,be,De,Ae,Ce,Ne,Te,Ie,Oe,we,xe,Re,Le,Pe,Me,ke,Be,Fe,Ve,Ue,He,We,je,ze,Ke,Ge,Ye,qe;let{t:Ze,config:$e,onSelect:Xe,formData:Je,editdata:Qe,previousData:et}=e,tt={};const nt=Digit.UserService.getUser().info,lt=e=>{if(!e)return null;switch(e.toUpperCase()){case"M":return{i18nKey:"MALE",code:"MALE",value:"Male"};case"F":return{i18nKey:"FEMALE",code:"FEMALE",value:"Female"};case"O":return{i18nKey:"OTHERS",code:"OTHERS",value:"Others"};default:return null}},[it,ot]=n.useState((null==Je||null===(i=Je.owner)||void 0===i||null===(o=i.units)||void 0===o?void 0:o.vendorName)||(null==Je||null===(a=Je.owner)||void 0===a?void 0:a.vendorName)||""),[at,rt]=n.useState((null==Je||null===(u=Je.owner)||void 0===u||null===(s=u.units)||void 0===s?void 0:s.userCategory)||(null==Je||null===(c=Je.owner)||void 0===c?void 0:c.userCategory)||""),[dt,ut]=n.useState((null==Je||null===(v=Je.owner)||void 0===v||null===(m=v.units)||void 0===m?void 0:m.vendorDateOfBirth)||(null==Je||null===(f=Je.owner)||void 0===f?void 0:f.vendorDateOfBirth)||""),[st,ct]=n.useState((null==Je||null===(E=Je.owner)||void 0===E||null===(g=E.units)||void 0===g?void 0:g.gender)||(null==Je||null===(S=Je.owner)||void 0===S?void 0:S.gender)||""),[vt,mt]=n.useState((null==Qe||null===(h=Qe.vendorDetail)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.fatherName)||(null==Je||null===(_=Je.owner)||void 0===_||null===(b=_.units)||void 0===b?void 0:b.fatherName)||(null==Je||null===(D=Je.owner)||void 0===D?void 0:D.fatherName)||""),[pt,ft]=n.useState((null==Je||null===(A=Je.owner)||void 0===A||null===(C=A.units)||void 0===C?void 0:C.spouseName)||(null==Je||null===(N=Je.owner)||void 0===N?void 0:N.spouseName)||""),[Et,gt]=n.useState(!1),[St,ht]=n.useState((null==Je||null===(T=Je.owner)||void 0===T||null===(I=T.units)||void 0===I?void 0:I.mobileNumber)||(null==Je||null===(O=Je.owner)||void 0===O?void 0:O.mobileNumber)||""),[yt,_t]=n.useState((null==Je||null===(w=Je.owner)||void 0===w||null===(x=w.units)||void 0===x?void 0:x.spouseDateBirth)||(null==Je||null===(R=Je.owner)||void 0===R?void 0:R.spouseDateBirth)||""),[bt,Dt]=n.useState((null==Je||null===(L=Je.owner)||void 0===L||null===(P=L.units)||void 0===P?void 0:P.dependentName)||(null==Je||null===(M=Je.owner)||void 0===M?void 0:M.dependentName)||""),[At,Ct]=n.useState((null==Je||null===(k=Je.owner)||void 0===k||null===(B=k.units)||void 0===B?void 0:B.dependentDateBirth)||(null==Je||null===(F=Je.owner)||void 0===F?void 0:F.dependentDateBirth)||""),[Nt,Tt]=n.useState((null==Je||null===(V=Je.owner)||void 0===V||null===(U=V.units)||void 0===U?void 0:U.dependentGender)||(null==Je||null===(H=Je.owner)||void 0===H?void 0:H.dependentGender)||""),[It,Ot]=n.useState((null==Je||null===(W=Je.owner)||void 0===W||null===(j=W.units)||void 0===j?void 0:j.email)||(null==Je||null===(z=Je.owner)||void 0===z?void 0:z.email)||""),[wt,xt]=n.useState((null==Je||null===(K=Je.owner)||void 0===K||null===(G=K.units)||void 0===G?void 0:G.tradeNumber)||(null==Je||null===(Y=Je.owner)||void 0===Y?void 0:Y.tradeNumber)||""),[Rt,Lt]=n.useState(null),[Pt,Mt]=n.useState((null==Je||null===(q=Je.owner)||void 0===q?void 0:q.spouseDependentChecked)||!1),[kt,Bt]=n.useState((null==Je||null===(Z=Je.owner)||void 0===Z?void 0:Z.dependentNameChecked)||!1),Ft="EMPLOYEE"===nt.type?"50%":"86%",[Vt,Ut]=n.useState(null),{control:Ht}=r.useForm(),[Wt,jt]=n.useState((null==Je?void 0:Je.owner)&&(null==Je||null===($=Je.owner)||void 0===$?void 0:$.units)||[{vendorName:(null==et||null===(X=et.vendorDetail)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.name)||(null==Qe||null===(Q=Qe.vendorDetail)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.name)||("CITIZEN"===(null==nt?void 0:nt.type)?null==nt?void 0:nt.name:"")||"",userCategory:(e=>e?{i18nKey:e,code:e,value:e}:null)((null==et||null===(te=et.vendorDetail)||void 0===te||null===(ne=te[0])||void 0===ne?void 0:ne.userCategory)||(null==Qe||null===(le=Qe.vendorDetail)||void 0===le||null===(ie=le[0])||void 0===ie?void 0:ie.userCategory))||"",vendorDateOfBirth:(null==et||null===(oe=et.vendorDetail)||void 0===oe||null===(ae=oe[0])||void 0===ae?void 0:ae.dob)||(null==Qe||null===(re=Qe.vendorDetail)||void 0===re||null===(de=re[0])||void 0===de?void 0:de.dob)||"",gender:lt((null==et||null===(ue=et.vendorDetail)||void 0===ue||null===(se=ue[0])||void 0===se?void 0:se.gender)||(null==Qe||null===(ce=Qe.vendorDetail)||void 0===ce||null===(ve=ce[0])||void 0===ve?void 0:ve.gender))||"",fatherName:(null==et||null===(me=et.vendorDetail)||void 0===me||null===(pe=me[0])||void 0===pe?void 0:pe.fatherName)||(null==Qe||null===(fe=Qe.vendorDetail)||void 0===fe||null===(Ee=fe[0])||void 0===Ee?void 0:Ee.fatherName)||"",spouseName:(null==et||null===(ge=et.vendorDetail)||void 0===ge||null===(Se=ge[1])||void 0===Se?void 0:Se.name)||(null==Qe||null===(he=Qe.vendorDetail)||void 0===he||null===(ye=he[1])||void 0===ye?void 0:ye.name)||"",mobileNumber:(null==et||null===(_e=et.vendorDetail)||void 0===_e||null===(be=_e[0])||void 0===be?void 0:be.mobileNo)||(null==Qe||null===(De=Qe.vendorDetail)||void 0===De||null===(Ae=De[0])||void 0===Ae?void 0:Ae.mobileNo)||("CITIZEN"===(null==nt?void 0:nt.type)?null==nt?void 0:nt.mobileNumber:"")||"",spouseDateBirth:(null==et||null===(Ce=et.vendorDetail)||void 0===Ce||null===(Ne=Ce[1])||void 0===Ne?void 0:Ne.dob)||(null==Qe||null===(Te=Qe.vendorDetail)||void 0===Te||null===(Ie=Te[1])||void 0===Ie?void 0:Ie.dob)||"",dependentName:(null==et||null===(Oe=et.vendorDetail)||void 0===Oe||null===(we=Oe[2])||void 0===we?void 0:we.name)||(null==Qe||null===(xe=Qe.vendorDetail)||void 0===xe||null===(Re=xe[2])||void 0===Re?void 0:Re.name)||"",dependentDateBirth:(null==et||null===(Le=et.vendorDetail)||void 0===Le||null===(Pe=Le[2])||void 0===Pe?void 0:Pe.dob)||(null==Qe||null===(Me=Qe.vendorDetail)||void 0===Me||null===(ke=Me[2])||void 0===ke?void 0:ke.dob)||"",dependentGender:lt((null==et||null===(Be=et.vendorDetail)||void 0===Be||null===(Fe=Be[2])||void 0===Fe?void 0:Fe.gender)||(null==Qe||null===(Ve=Qe.vendorDetail)||void 0===Ve||null===(Ue=Ve[2])||void 0===Ue?void 0:Ue.gender))||"",email:(null==et||null===(He=et.vendorDetail)||void 0===He||null===(We=He[0])||void 0===We?void 0:We.emailId)||(null==Qe||null===(je=Qe.vendorDetail)||void 0===je||null===(ze=je[0])||void 0===ze?void 0:ze.emailId)||("CITIZEN"===(null==nt?void 0:nt.type)?null==nt?void 0:nt.emailId:"")||"",tradeNumber:(null==et||null===(Ke=et.vendorDetail)||void 0===Ke||null===(Ge=Ke[0])||void 0===Ge?void 0:Ge.tradeNumber)||(null==Qe||null===(Ye=Qe.vendorDetail)||void 0===Ye||null===(qe=Ye[0])||void 0===qe?void 0:qe.tradeNumber)||""}]),zt=e=>{""===e||/^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/.test(e)?Lt(""):Lt(Ze("CORE_INVALID_EMAIL_ID_PATTERN"))},{data:Kt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"Category"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.Category}});let Gt=[];Kt&&Kt.map(e=>{Gt.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Yt=(e,t)=>!(e&&(e=>{const t=new Date,n=new Date(e);let l=t.getFullYear()-n.getFullYear();const i=t.getMonth()-n.getMonth();return(i<0||0===i&&t.getDate()<n.getDate())&&l--,l})(e)<18&&(Ut({error:!0,label:Ze({vendor:"VENDOR_AGE_ERROR",spouse:"SPOUSE_AGE_ERROR",dependent:"DEPENDENT_AGE_ERROR"}[t])}),1));n.useEffect(()=>{if(Vt){const e=setTimeout(()=>{Ut(null)},2e3);return()=>clearTimeout(e)}},[Vt]);const qt=[{code:"MALE",i18nKey:"MALE",value:"Male"},{code:"FEMALE",i18nKey:"FEMALE",value:"Female"},{code:"OTHERS",i18nKey:"OTHERS",value:"Others"}],Zt=()=>{Mt(!Pt)},$t=()=>{Bt(!kt)};return n.useEffect(()=>{It&&zt(It)},[It]),l.createElement(l.Fragment,null,l.createElement(p,{currentStep:1}),l.createElement(t.FormStep,{config:$e,onSelect:()=>{const e=Yt(Wt[0].vendorDateOfBirth,"vendor"),t=!Pt||Yt(Wt[0].spouseDateBirth,"spouse"),n=!kt||Yt(Wt[0].dependentDateBirth,"dependent");if(!e||!t||!n)return;let l=d({},Je.owner||{},{units:Wt,spouseDependentChecked:Pt,dependentNameChecked:kt});Xe($e.key,d({},Je[$e.key],l),!1),!window.location.href.includes("edit")&&(()=>{var e,t,n;let l=[],i=Digit.ULBService.getCitizenCurrentTenant(!0);const o=e=>{var t,n,l,i,o,a,r,d,u;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e[0])||void 0===t?void 0:t.vendorDateOfBirth,userCategory:null==e||null===(n=e[0])||void 0===n||null===(l=n.userCategory)||void 0===l?void 0:l.code,emailId:null==e||null===(i=e[0])||void 0===i?void 0:i.email,fatherName:null==e||null===(o=e[0])||void 0===o?void 0:o.fatherName,gender:null==e||null===(a=e[0])||void 0===a||null===(r=a.gender)||void 0===r?void 0:r.code.charAt(0),id:"",mobileNo:null==e||null===(d=e[0])||void 0===d?void 0:d.mobileNumber,name:null==e||null===(u=e[0])||void 0===u?void 0:u.vendorName,relationshipType:"VENDOR",vendorId:null}},a=e=>{var t,n,l,i;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e[1])||void 0===t?void 0:t.spouseDateBirth,userCategory:null==e||null===(n=e[1])||void 0===n||null===(l=n.userCategory)||void 0===l?void 0:l.code,emailId:"",isInvolved:null==e?void 0:e.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(i=e[1])||void 0===i?void 0:i.spouseName,relationshipType:"SPOUSE",vendorId:null}},r=e=>{var t,n,l,i,o,a;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e[2])||void 0===t?void 0:t.dependentDateBirth,userCategory:null==e||null===(n=e[2])||void 0===n||null===(l=n.userCategory)||void 0===l?void 0:l.code,emailId:"",isInvolved:null==e?void 0:e.dependentNameChecked,fatherName:"",gender:null==e||null===(i=e[2])||void 0===i||null===(o=i.dependentGender)||void 0===o?void 0:o.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(a=e[2])||void 0===a?void 0:a.dependentName,relationshipType:"DEPENDENT",vendorId:null}},d=e=>!e||""===e.trim();if(!d(null==Wt||null===(e=Wt[0])||void 0===e?void 0:e.vendorName)){var u,s;const e=null==Wt||null===(u=Wt[0])||void 0===u?void 0:u.spouseName,t=null==Wt||null===(s=Wt[0])||void 0===s?void 0:s.dependentName;d(e)&&d(t)?l=[o(Wt)]:!d(e)&&d(t)?l=[o(Wt),a(Wt)]:d(e)||d(t)||(l=[o(Wt),a(Wt),r(Wt)])}const c=sessionStorage.getItem("Response"),v=c?JSON.parse(c):null;let m={addressDetails:[{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:""},{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:"",isAddressSame:""}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:"",accountNumber:"",applicationId:"",bankBranchName:"",bankName:"",id:"",ifscCode:"",refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==et?void 0:et.draftId)||(null==v||null===(t=v.SVDetail)||void 0===t?void 0:t.draftId)||"",documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:"",tenantId:i,termsAndCondition:"Y",tradeLicenseNo:null==Wt||null===(n=Wt[0])||void 0===n?void 0:n.tradeNumber,vendingActivity:"",vendingArea:"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:"MONDAY",fromTime:"09:00",id:"",toTime:"09:00"}],vendingZone:"",vendorDetail:[...l],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:m,draftApplication:!0},i).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()},onSkip:()=>Xe(),t:Ze,isDisabled:!Wt[0].vendorName||!Wt[0].userCategory||!Wt[0].vendorDateOfBirth||!Wt[0].gender||!Wt[0].fatherName||Pt&&!Wt[0].spouseName||kt&&!Wt[0].dependentName},Wt.map((e,n)=>l.createElement("div",{key:e+"-"+n},l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement(t.CardLabel,null,""+Ze("SV_VENDOR_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:{float:"right",position:"relative",bottom:"32px"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z",fill:1!=Wt.length?"#494848":"#FAFAFA"})))),style:{width:"100px",display:"inline"},onClick:e=>function(e){const t=[...Wt];1!=t.length&&(t.splice(e,1),jt(t))}(n)}),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vendorName",value:null==e?void 0:e.vendorName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].vendorName=t.target.value,ot(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:!0},tt={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")})),l.createElement(t.CardLabel,null,""+Ze("SV_OWNER_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:Ht,name:"userCategory-"+n,defaultValue:at,rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG")},render:i=>l.createElement(t.Dropdown,{className:"form-field",style:{width:"100%"},selected:null==e?void 0:e.userCategory,select:e=>function(e,t){let n=[...Wt];n[e].userCategory=t,rt(t),jt(n)}(n,e),option:Gt,optionKey:"i18nKey",t:Ze,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Ze("SV_REGISTERED_MOB_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.MobileNumber,{style:{background:"#FAFAFA"},value:null==e?void 0:e.mobileNumber,name:"mobileNumber",onChange:e=>function(e,t){let n=[...Wt];n[e].mobileNumber=t,ht(t),jt(n)}(n,e),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:Ze("SV_INVALID_NUMBER")}),l.createElement(t.CardLabel,null,""+Ze("SV_EMAIL")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:null==e?void 0:e.email,onChange:e=>function(e,t){let n=[...Wt];n[e].email=t.target.value;const l=t.target.value;Ot(t.target.value),zt(l),jt(n)}(n,e),disable:!1}),l.createElement(t.CardLabel,null,""+Ze("SV_DATE_OF_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"vendorDateOfBirth",value:null==e?void 0:e.vendorDateOfBirth,onChange:e=>function(e,t){let n=[...Wt];n[e].vendorDateOfBirth=t.target.value,ut(t.target.value),jt(n),Yt(t.target.value,"vendor")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||Ze("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+Ze("SV_GENDER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:Ze,options:qt,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"gender-"+n,value:null==e?void 0:e.gender,selectedOption:null==e?void 0:e.gender,onSelect:e=>function(e,t){let n=[...Wt];n[e].gender=t,ct(t),jt(n)}(n,e),labelKey:"i18nKey",isPTFlow:!0}),l.createElement(t.CardLabel,null,""+Ze("SV_FATHER_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",value:null==e?void 0:e.fatherName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].fatherName=t.target.value,mt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:!0},tt={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")}))),l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement("div",null,l.createElement("div",{style:{display:"flex",gap:"22px"}},l.createElement(t.CardLabel,null,""+Ze("SV_SPOUSE_NAME")," ",Pt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.CheckBox,{label:Ze("SV_INVOLVED_IN_VENDING"),onChange:Zt,checked:Pt})),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"spouseName",value:null==e?void 0:e.spouseName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].spouseName=t.target.value,ft(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:Pt},tt={isRequired:Pt,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")}))),l.createElement(t.CardLabel,null,""+Ze("SV_SPOUSE_DATE_OF_BIRTH")," ",Pt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"spouseDateBirth",value:null==e?void 0:e.spouseDateBirth,onChange:e=>function(e,t){let n=[...Wt];n[e].spouseDateBirth=t.target.value,_t(t.target.value),jt(n),Yt(t.target.value,"spouse")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||Ze("ERR_DEFAULT_INPUT_FIELD_MSG")}})),l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement("div",null,l.createElement("div",{style:{display:"flex",gap:"22px"}},l.createElement(t.CardLabel,null,""+Ze("SV_DEPENDENT_NAME")," ",kt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.CheckBox,{label:Ze("SV_INVOLVED_IN_VENDING"),onChange:$t,checked:kt})),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"dependentName",value:null==e?void 0:e.dependentName,onChange:e=>function(e,t){/\d/.test(t.target.value)&&Ut({error:!0,label:Ze("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].dependentName=t.target.value,Dt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:kt},tt={isRequired:kt,pattern:"^[a-zA-Z ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")}))),l.createElement(t.CardLabel,null,""+Ze("SV_DEPENDENT_DATE_OF_BIRTH")," ",kt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:Ze,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"dependentDateBirth",value:null==e?void 0:e.dependentDateBirth,onChange:e=>function(e,t){let n=[...Wt];n[e].dependentDateBirth=t.target.value,Ct(t.target.value),jt(n),Yt(t.target.value,"dependent")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:Ze("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||Ze("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+Ze("SV_DEPENDENT_GENDER")," ",kt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:Ze,options:qt,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"dependentGender-"+n,value:null==e?void 0:e.dependentGender,selectedOption:null==e?void 0:e.dependentGender,onSelect:e=>function(e,t){let n=[...Wt];n[e].dependentGender=t,Tt(t),jt(n)}(n,e),labelKey:"i18nKey",isPTFlow:!0})),l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",width:Ft}},l.createElement(t.CardLabel,null,""+Ze("SV_TRADE_NUMBER")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:Ze,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"tradeNumber",value:null==e?void 0:e.tradeNumber,onChange:e=>function(e,t){let n=[...Wt];n[e].tradeNumber=t.target.value,xt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:!0},tt={isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]+$",type:"text",title:Ze("SV_ENTER_CORRECT_NAME")})),l.createElement("div",{className:"astericColor",style:{display:"flex",paddingBottom:"15px",color:"#FF8C00",marginTop:"10px"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>function(){const e=[...Wt];e.push({vendorName:"",userCategory:"",vendorDateOfBirth:"",gender:"",fatherName:"",spouseName:"",mobileNumber:"",spouseDateBirth:"",dependentName:"",dependentDateBirth:"",dependentGender:"",email:"",tradeNumber:""}),jt(e)}()},""+Ze("SV_ADD_DEPENDENT")))),l.createElement("br",null)))),Vt&&l.createElement(t.Toast,{error:Vt.error,warning:Vt.warning,label:Ze(Vt.label),onClose:()=>{Ut(null)}}))},SVBusinessDetails:e=>{var i,o,a,u,s,c,v,m,f,E,g,S,h,_,D,A,C,N,T,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he,ye,_e,be;let{t:De,config:Ae,onSelect:Ce,userType:Ne,formData:Te,editdata:Ie,previousData:Oe}=e,we={};const xe=Digit.UserService.getUser().info,Re=e=>e?{i18nKey:e,code:e,value:e}:null,[Le,Pe]=n.useState((null==Te||null===(i=Te.businessDetails)||void 0===i?void 0:i.vendingType)||Re((null==Oe?void 0:Oe.vendingActivity)||(null==Ie?void 0:Ie.vendingActivity))||(null==Te||null===(o=Te.businessDetails)||void 0===o?void 0:o.vendingType)||""),[Me,ke]=n.useState((null==Te||null===(a=Te.businessDetails)||void 0===a?void 0:a.vendingZones)||Re((null==Oe?void 0:Oe.vendingZone)||(null==Ie?void 0:Ie.vendingZone))||""),[Be,Fe]=n.useState((null==Te||null===(u=Te.businessDetails)||void 0===u?void 0:u.location)||""),[Ve,Ue]=n.useState((null==Te||null===(s=Te.businessDetails)||void 0===s?void 0:s.areaRequired)||(null==Oe?void 0:Oe.vendingArea)||(null==Ie?void 0:Ie.vendingArea)||""),[He,We]=n.useState((null==Te||null===(c=Te.businessDetails)||void 0===c?void 0:c.nameOfAuthority)||(null==Oe?void 0:Oe.localAuthorityName)||(null==Ie?void 0:Ie.localAuthorityName)||""),[je,ze]=n.useState((null==Te||null===(v=Te.businessDetails)||void 0===v?void 0:v.vendingLiscence)||(null==Oe?void 0:Oe.vendingLiscence)||(null==Ie?void 0:Ie.vendingLiscence)||""),Ke={width:"EMPLOYEE"===xe.type?"50%":"86%"},[Ge,Ye]=n.useState(null),[qe,Ze]=n.useState(7===(null==Oe||null===(m=Oe.vendingOperationTimeDetails)||void 0===m?void 0:m.length)||7===(null==Ie||null===(f=Ie.vendingOperationTimeDetails)||void 0===f?void 0:f.length)||(null==Te||null===(E=Te.businessDetails)||void 0===E?void 0:E.isSameForAll)),[$e,Xe]=n.useState((null==Te||null===(g=Te.businessDetails)||void 0===g?void 0:g.daysOfOperation)||[{name:"Monday",isSelected:!1,startTime:(null==Oe||null===(S=Oe.vendingOperationTimeDetails)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.fromTime)||(null==Ie||null===(_=Ie.vendingOperationTimeDetails)||void 0===_||null===(D=_[0])||void 0===D?void 0:D.fromTime)||"",endTime:(null==Oe||null===(A=Oe.vendingOperationTimeDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.toTime)||(null==Ie||null===(N=Ie.vendingOperationTimeDetails)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.toTime)||""},{name:"Tuesday",isSelected:!1,startTime:(null==Oe||null===(I=Oe.vendingOperationTimeDetails)||void 0===I||null===(O=I[1])||void 0===O?void 0:O.fromTime)||(null==Ie||null===(w=Ie.vendingOperationTimeDetails)||void 0===w||null===(x=w[1])||void 0===x?void 0:x.fromTime)||"",endTime:(null==Oe||null===(R=Oe.vendingOperationTimeDetails)||void 0===R||null===(L=R[1])||void 0===L?void 0:L.toTime)||(null==Ie||null===(P=Ie.vendingOperationTimeDetails)||void 0===P||null===(M=P[1])||void 0===M?void 0:M.toTime)||""},{name:"Wednesday",isSelected:!1,startTime:(null==Oe||null===(k=Oe.vendingOperationTimeDetails)||void 0===k||null===(B=k[2])||void 0===B?void 0:B.fromTime)||(null==Ie||null===(F=Ie.vendingOperationTimeDetails)||void 0===F||null===(V=F[2])||void 0===V?void 0:V.fromTime)||"",endTime:(null==Oe||null===(U=Oe.vendingOperationTimeDetails)||void 0===U||null===(H=U[2])||void 0===H?void 0:H.toTime)||(null==Ie||null===(W=Ie.vendingOperationTimeDetails)||void 0===W||null===(j=W[2])||void 0===j?void 0:j.toTime)||""},{name:"Thursday",isSelected:!1,startTime:(null==Oe||null===(z=Oe.vendingOperationTimeDetails)||void 0===z||null===(K=z[3])||void 0===K?void 0:K.fromTime)||(null==Ie||null===(G=Ie.vendingOperationTimeDetails)||void 0===G||null===(Y=G[3])||void 0===Y?void 0:Y.fromTime)||"",endTime:(null==Oe||null===(q=Oe.vendingOperationTimeDetails)||void 0===q||null===(Z=q[3])||void 0===Z?void 0:Z.toTime)||(null==Ie||null===($=Ie.vendingOperationTimeDetails)||void 0===$||null===(X=$[3])||void 0===X?void 0:X.toTime)||""},{name:"Friday",isSelected:!1,startTime:(null==Oe||null===(J=Oe.vendingOperationTimeDetails)||void 0===J||null===(Q=J[4])||void 0===Q?void 0:Q.fromTime)||(null==Ie||null===(ee=Ie.vendingOperationTimeDetails)||void 0===ee||null===(te=ee[4])||void 0===te?void 0:te.fromTime)||"",endTime:(null==Oe||null===(ne=Oe.vendingOperationTimeDetails)||void 0===ne||null===(le=ne[4])||void 0===le?void 0:le.toTime)||(null==Ie||null===(ie=Ie.vendingOperationTimeDetails)||void 0===ie||null===(oe=ie[4])||void 0===oe?void 0:oe.toTime)||""},{name:"Saturday",isSelected:!1,startTime:(null==Oe||null===(ae=Oe.vendingOperationTimeDetails)||void 0===ae||null===(re=ae[5])||void 0===re?void 0:re.fromTime)||(null==Ie||null===(de=Ie.vendingOperationTimeDetails)||void 0===de||null===(ue=de[5])||void 0===ue?void 0:ue.fromTime)||"",endTime:(null==Oe||null===(se=Oe.vendingOperationTimeDetails)||void 0===se||null===(ce=se[5])||void 0===ce?void 0:ce.toTime)||(null==Ie||null===(ve=Ie.vendingOperationTimeDetails)||void 0===ve||null===(me=ve[5])||void 0===me?void 0:me.toTime)||""},{name:"Sunday",isSelected:!1,startTime:(null==Oe||null===(pe=Oe.vendingOperationTimeDetails)||void 0===pe||null===(fe=pe[6])||void 0===fe?void 0:fe.fromTime)||(null==Ie||null===(Ee=Ie.vendingOperationTimeDetails)||void 0===Ee||null===(ge=Ee[6])||void 0===ge?void 0:ge.fromTime)||"",endTime:(null==Oe||null===(Se=Oe.vendingOperationTimeDetails)||void 0===Se||null===(he=Se[6])||void 0===he?void 0:he.toTime)||(null==Ie||null===(ye=Ie.vendingOperationTimeDetails)||void 0===ye||null===(_e=ye[6])||void 0===_e?void 0:_e.toTime)||""}]),[Je,Qe]=n.useState((null==Te||null===(be=Te.businessDetails)||void 0===be?void 0:be.backupDays)||[...$e]),et=()=>$e.some(e=>e.startTime,e=>e.endTime),tt=(e,t,n)=>{let l=[...$e];if(l[e][t]=n,l[e].isSelected=!(!l[e].startTime&&!l[e].endTime),qe){const{startTime:t,endTime:n}=l[e];l=l.map(e=>d({},e,{startTime:t,endTime:n}))}Xe(l)},nt=()=>{if(qe)Xe([...Je]);else{Qe([...$e]);const{startTime:e,endTime:t,isSelected:n}=$e.find(e=>e.startTime||e.endTime)||$e[0];Xe($e.map(l=>d({},l,{startTime:e,endTime:t,isSelected:n})))}Ze(!qe)},lt=[{id:"selection",Header:()=>l.createElement("div",{className:"SVTableHeader"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:qe,disabled:!et(),onChange:nt}),l.createElement("h4",{style:{marginLeft:"8px"}},De("SV_SELECT_ALL"))),Cell:()=>l.createElement("div",{className:"SVTableCells"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:qe,disabled:!0}))},{Header:De("SV_DAY"),accessor:"name"},{Header:De("SV_FROM_TIME"),accessor:"startTime",Cell:e=>{var n;let{row:i}=e;return l.createElement(t.TextInput,{style:{width:"126px"},type:"time",name:"startTime",value:(null===(n=$e[i.index])||void 0===n?void 0:n.startTime)||"",onChange:e=>tt(i.index,"startTime",e.target.value),placeholder:"Start Time"})}},{Header:De("SV_TO_TIME"),accessor:"endTime",Cell:e=>{var n;let{row:i}=e;return l.createElement(t.TextInput,{style:{width:"128px"},type:"time",name:"endTime",value:(null===(n=$e[i.index])||void 0===n?void 0:n.endTime)||"",onChange:e=>tt(i.index,"endTime",e.target.value),placeholder:"End Time"})}}],{control:it}=r.useForm(),[ot,at]=n.useState(!1),{data:rt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingActivityType"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingActivityType}});let dt=[];rt&&rt.map(e=>{dt.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:ut}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"VendingZones"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.VendingZones}});let st=[];ut&&ut.map(e=>{st.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const ct=()=>{if(!et())return void Ye({error:!0,label:De("SV_TIME_OPERATIONS_VALIDATION")});let e;e=d({},Te.businessDetails,{vendingType:Le,vendingZones:Me,location:Be,areaRequired:Ve,nameOfAuthority:He,vendingLiscence:je,daysOfOperation:$e,isSameForAll:qe,backupDays:Je}),Ce(Ae.key,e,!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a;let r=[],d=Digit.ULBService.getCitizenCurrentTenant(!0);const u=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},s=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},c=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},v=e=>!e||""===e.trim();if(!v(null==Te||null===(e=Te.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var m,p,f,E,g,S;const e=null==Te||null===(m=Te.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.spouseName,t=null==Te||null===(E=Te.owner)||void 0===E||null===(g=E.units)||void 0===g||null===(S=g[0])||void 0===S?void 0:S.dependentName;v(e)&&v(t)?r=[u(Te)]:!v(e)&&v(t)?r=[u(Te),s(Te)]:v(e)||v(t)||(r=[u(Te),s(Te),c(Te)])}const h=$e.filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),y=sessionStorage.getItem("Response"),_=JSON.parse(y);let b={addressDetails:[{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:""},{addressId:"",addressLine1:"",addressLine2:"",addressType:"",city:"",cityCode:"",doorNo:"",houseNo:"",landmark:"",locality:"",localityCode:"",pincode:"",streetName:"",vendorId:"",isAddressSame:""}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:"",accountNumber:"",applicationId:"",bankBranchName:"",bankName:"",id:"",ifscCode:"",refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==Oe?void 0:Oe.draftId)||(null==_||null===(l=_.SVDetail)||void 0===l?void 0:l.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:He,tenantId:d,termsAndCondition:"Y",tradeLicenseNo:null==Te||null===(i=Te.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tradeNumber,vendingActivity:null==Le?void 0:Le.code,vendingArea:Ve||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:h,vendingZone:null==Me?void 0:Me.code,vendorDetail:[...r],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:b,draftApplication:!0},d).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()};return n.useEffect(()=>{if(Ge){const e=setTimeout(()=>{Ye(null)},2e3);return()=>clearTimeout(e)}},[Ge]),n.useEffect(()=>{"citizen"===Ne&&ct()},[Le,Me,Be,Ve,He,je,$e]),l.createElement(l.Fragment,null,l.createElement(p,{currentStep:2}),l.createElement("div",null,ot&&l.createElement(y,{t:De,onSelect:Ce,formData:Te,handleRemove:()=>{at(!ot)},onSave:function(e){Fe(e),at(!1)}}),!ot&&l.createElement(t.FormStep,{config:Ae,onSelect:ct,onSkip:()=>Ce(),t:De,isDisabled:!Le||!Me||("STATIONARY"===(null==Le?void 0:Le.code)?!Ve:null)||!He||!$e},l.createElement("div",null,l.createElement(t.CardLabel,null,""+De("SV_VENDING_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:it,name:"vendingType",defaultValue:Le,rules:{required:De("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Le,select:Pe,option:dt,optionKey:"i18nKey",t:De,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+De("SV_VENDING_ZONES")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:it,name:"vendingZones",defaultValue:Me,rules:{required:De("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Me,select:ke,option:st,optionKey:"i18nKey",t:De,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+De("SV_LOCATION")),l.createElement("div",null,l.createElement(t.TextInput,{isMandatory:!1,optionKey:"i18nKey",t:De,style:Ke,name:"location",value:Be,onChange:function(e){Te.businessDetails.location="object"==typeof e&&null!==e?e.target.value:e,Fe(e.target.value)}}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:{float:"right",position:"relative",bottom:"25px",marginTop:"-17px",marginRight:"51%"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 7C8.79 7 7 8.79 7 11C7 13.21 8.79 15 11 15C13.21 15 15 13.21 15 11C15 8.79 13.21 7 11 7ZM19.94 10C19.48 5.83 16.17 2.52 12 2.06V0H10V2.06C5.83 2.52 2.52 5.83 2.06 10H0V12H2.06C2.52 16.17 5.83 19.48 10 19.94V22H12V19.94C16.17 19.48 19.48 16.17 19.94 12H22V10H19.94ZM11 18C7.13 18 4 14.87 4 11C4 7.13 7.13 4 11 4C14.87 4 18 7.13 18 11C18 14.87 14.87 18 11 18Z",fill:"#a82227"})))),onClick:e=>{at(!ot)}})),l.createElement(t.CardLabel,null,De("SV_DAY_HOUR_OPERATION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(b,{t:De,data:$e,columns:lt,getCellProps:e=>({style:{padding:"4px 0px 0px 18px",height:"18px"}}),isPaginationRequired:!1}),"STATIONARY"===(null==Le?void 0:Le.code)&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+De("SV_AREA_REQUIRED")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:De,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"areaRequired",value:Ve,onChange:function(e){/[a-zA-Z]/.test(e.target.value)&&Ye({error:!0,label:De("SV_CITIZEN_AREA_VALIDATION")}),Ue(e.target.value)},style:Ke,ValidationRequired:!1},we={isRequired:!0,pattern:"^[0-9. ]{1,3}$",type:"tel",title:De("SV_INVALID_AREA")}))),l.createElement(t.CardLabel,null,""+De("SV_LOCAL_AUTHORITY_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:De,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"nameOfAuthority",value:He,onChange:function(e){We(e.target.value)},style:Ke,ValidationRequired:!1},we={isRequired:!0,pattern:"^[a-zA-Z-/ ]*$",type:"text",title:De("SV_INPUT_DID_NOT_MATCH")})),l.createElement(t.CardLabel,null,""+De("SV_VENDING_LISCENCE")),l.createElement(t.TextInput,d({t:De,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vendingLiscence",value:je,onChange:function(e){ze(e.target.value)},style:Ke,ValidationRequired:!1},we={isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]+$",type:"text",title:De("PT_NAME_ERROR_MESSAGE")})))),Ge&&l.createElement(t.Toast,{error:Ge.error,warning:Ge.warning,label:De(Ge.label),onClose:()=>{Ye(null)}})))},GIS:y,SVRequiredDoc:e=>{var n;let{t:i,onSelect:o}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:r,data:d={}}=Digit.Hooks.sv.useSVDoc(a,"StreetVending","Documents");let u=null==d||null===(n=d.StreetVending)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,i("MODULE_SV")),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,i("SV_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},i("SV_DOCUMENT_ACCEPTED_PDF_JPG_PNG")),l.createElement("div",null,r&&l.createElement(t.Loader,null),Array.isArray(u)?u.map((e,n)=>{let{code:o,dropdownData:a}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(f(o,".","_"))),a.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(f(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("CS_COMMON_NEXT"),onSubmit:o}))))},SVDayAndTimeSlot:e=>{let{day:n,onDayToggle:i,onSameForAllChange:o,isSameForAll:a,onTimeChange:r}=e,u={};return l.createElement("div",{style:{marginBottom:"10px",display:"flex"}},l.createElement("div",{style:{display:"flex",width:"65px"}},l.createElement(t.CheckBox,{checked:n.isSelected,onChange:i,label:n.name})),n.isSelected&&l.createElement("div",null,l.createElement("div",{style:{display:"flex",gap:"120%",width:"111px",marginLeft:"30px",alignItems:"center"}},l.createElement(t.TextInput,d({style:{width:"100%",marginLeft:"80px"},type:"time",name:"startTime",value:(null==n?void 0:n.startTime)||"",onChange:e=>r("startTime",e.target.value),placeholder:"Start Time"},u={isRequired:!!n.isSelecte})),l.createElement(t.TextInput,d({style:{width:"100%",marginLeft:"15px"},type:"time",name:"endTime",value:(null==n?void 0:n.endTime)||"",onChange:e=>r("endTime",e.target.value),placeholder:"End Time"},u={isRequired:!!n.isSelecte})),(null==n?void 0:n.startTime)&&(null==n?void 0:n.endTime)&&l.createElement(t.CheckBox,{style:{width:"100%"},checked:!a,onChange:()=>o(null==n?void 0:n.startTime,null==n?void 0:n.endTime),label:"Same for All Fields"}))))},SVAdrressDetails:e=>{var i,a,u,s,c,v,m,f,E,g,S,h,y,_,b,D,A,C,N,T,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he,ye,_e,be,De,Ae,Ce,Ne,Te,Ie;let{t:Oe,config:we,onSelect:xe,userType:Re,formData:Le,editdata:Pe,previousData:Me}=e;const ke=Digit.Hooks.sv.useTenants(),Be=e=>e?{i18nKey:e,code:e,value:e}:null,{pathname:Fe}=o.useLocation();let Ve={};const Ue=Digit.UserService.getUser().info,[He,We]=n.useState((null==Le||null===(i=Le.address)||void 0===i?void 0:i.pincode)||(null==Me||null===(a=Me.addressDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.pincode)||(null==Pe||null===(s=Pe.addressDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.pincode)||""),[je,ze]=n.useState((null==Le||null===(v=Le.address)||void 0===v?void 0:v.city)||Be((null==Me||null===(m=Me.addressDetails)||void 0===m||null===(f=m[0])||void 0===f?void 0:f.city)||(null==Pe||null===(E=Pe.addressDetails)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.city))||""),[Ke,Ge]=n.useState((null==Le||null===(S=Le.address)||void 0===S?void 0:S.locality)||Be((null==Me||null===(h=Me.addressDetails)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.locality)||(null==Pe||null===(_=Pe.addressDetails)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.locality))||""),[Ye,qe]=n.useState((null==Le||null===(D=Le.address)||void 0===D?void 0:D.houseNo)||(null==Me||null===(A=Me.addressDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.houseNo)||(null==Pe||null===(N=Pe.addressDetails)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.houseNo)||""),[Ze,$e]=n.useState((null==Le||null===(I=Le.address)||void 0===I?void 0:I.landmark)||(null==Me||null===(O=Me.addressDetails)||void 0===O||null===(w=O[0])||void 0===w?void 0:w.landmark)||(null==Pe||null===(x=Pe.addressDetails)||void 0===x||null===(R=x[0])||void 0===R?void 0:R.landmark)||""),[Xe,Je]=n.useState((null==Le||null===(L=Le.address)||void 0===L?void 0:L.addressline1)||(null==Me||null===(P=Me.addressDetails)||void 0===P||null===(M=P[0])||void 0===M?void 0:M.addressLine1)||(null==Pe||null===(k=Pe.addressDetails)||void 0===k||null===(B=k[0])||void 0===B?void 0:B.addressLine1)||""),[Qe,et]=n.useState((null==Le||null===(F=Le.address)||void 0===F?void 0:F.addressline2)||(null==Me||null===(V=Me.addressDetails)||void 0===V||null===(U=V[0])||void 0===U?void 0:U.addressLine2)||(null==Pe||null===(H=Pe.addressDetails)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.addressLine2)||""),[tt,nt]=n.useState((null==Le||null===(j=Le.correspondenceAddress)||void 0===j?void 0:j.cpincode)||(null==Me||null===(z=Me.addressDetails)||void 0===z||null===(K=z[1])||void 0===K?void 0:K.pincode)||(null==Pe||null===(G=Pe.addressDetails)||void 0===G||null===(Y=G[1])||void 0===Y?void 0:Y.pincode)||""),[lt,it]=n.useState((null==Le||null===(q=Le.correspondenceAddress)||void 0===q?void 0:q.ccity)||Be((null==Me||null===(Z=Me.addressDetails)||void 0===Z||null===($=Z[1])||void 0===$?void 0:$.city)||(null==Pe||null===(X=Pe.addressDetails)||void 0===X||null===(J=X[1])||void 0===J?void 0:J.city))||""),[ot,at]=n.useState((null==Le||null===(Q=Le.correspondenceAddress)||void 0===Q?void 0:Q.clocality)||Be((null==Me||null===(ee=Me.addressDetails)||void 0===ee||null===(te=ee[1])||void 0===te?void 0:te.locality)||(null==Pe||null===(ne=Pe.addressDetails)||void 0===ne||null===(le=ne[1])||void 0===le?void 0:le.locality))||""),[rt,dt]=n.useState((null==Le||null===(ie=Le.correspondenceAddress)||void 0===ie?void 0:ie.chouseNo)||(null==Me||null===(oe=Me.addressDetails)||void 0===oe||null===(ae=oe[1])||void 0===ae?void 0:ae.houseNo)||(null==Pe||null===(re=Pe.addressDetails)||void 0===re||null===(de=re[1])||void 0===de?void 0:de.houseNo)||""),[ut,st]=n.useState((null==Le||null===(ue=Le.correspondenceAddress)||void 0===ue?void 0:ue.clandmark)||(null==Me||null===(se=Me.addressDetails)||void 0===se||null===(ce=se[1])||void 0===ce?void 0:ce.landmark)||(null==Pe||null===(ve=Pe.addressDetails)||void 0===ve||null===(me=ve[1])||void 0===me?void 0:me.landmark)||""),[ct,vt]=n.useState((null==Le||null===(pe=Le.correspondenceAddress)||void 0===pe?void 0:pe.caddressline1)||(null==Me||null===(fe=Me.addressDetails)||void 0===fe||null===(Ee=fe[1])||void 0===Ee?void 0:Ee.addressLine1)||(null==Pe||null===(ge=Pe.addressDetails)||void 0===ge||null===(Se=ge[1])||void 0===Se?void 0:Se.addressLine1)||""),[mt,pt]=n.useState((null==Le||null===(he=Le.correspondenceAddress)||void 0===he?void 0:he.caddressline2)||(null==Me||null===(ye=Me.addressDetails)||void 0===ye||null===(_e=ye[1])||void 0===_e?void 0:_e.addressLine2)||(null==Pe||null===(be=Pe.addressDetails)||void 0===be||null===(De=be[1])||void 0===De?void 0:De.addressLine2)||""),[ft,Et]=n.useState((null==Le||null===(Ae=Le.correspondenceAddress)||void 0===Ae?void 0:Ae.isAddressSame)||(null==Me||null===(Ce=Me.addressDetails)||void 0===Ce||null===(Ne=Ce[1])||void 0===Ne?void 0:Ne.isAddressSame)||(null==Pe||null===(Te=Pe.addressDetails)||void 0===Te||null===(Ie=Te[1])||void 0===Ie?void 0:Ie.isAddressSame)||!1),{control:gt}=r.useForm(),St={width:"EMPLOYEE"===Ue.type?"50%":"86%"},{data:ht}=Digit.Hooks.useBoundaryLocalities(null==je?void 0:je.code,"revenue",{enabled:!!je},Oe);let yt=[];ht&&ht.map((e,t)=>{yt.push({i18nKey:null==e?void 0:e.i18nkey,code:null==e?void 0:e.code,label:null==e?void 0:e.label,area:null==e?void 0:e.area,boundaryNum:null==e?void 0:e.boundaryNum})});const _t=()=>{var e,t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T,I,O,w,x,R,L,P;let M=[],k=Digit.ULBService.getCitizenCurrentTenant(!0);const B=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},F=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},V=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},U=e=>!e||""===e.trim();if(!U(null==Le||null===(e=Le.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var H,W,j,z,K,G;const e=null==Le||null===(H=Le.owner)||void 0===H||null===(W=H.units)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.spouseName,t=null==Le||null===(z=Le.owner)||void 0===z||null===(K=z.units)||void 0===K||null===(G=K[0])||void 0===G?void 0:G.dependentName;U(e)&&U(t)?M=[B(Le)]:!U(e)&&U(t)?M=[B(Le),F(Le)]:U(e)||U(t)||(M=[B(Le),F(Le),V(Le)])}const Y=(null==Le||null===(l=Le.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),q=sessionStorage.getItem("Response"),Z=JSON.parse(q);let $={addressDetails:[{addressId:"",addressLine1:(null==Le||null===(i=Le.address)||void 0===i?void 0:i.addressline1)||Xe,addressLine2:(null==Le||null===(o=Le.address)||void 0===o?void 0:o.addressline2)||Xe,addressType:"",city:(null==Me||null===(a=Me.addressDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.city)||(null==Le||null===(d=Le.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.name)||(null==je?void 0:je.name),cityCode:(null==Me||null===(s=Me.addressDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.cityCode)||(null==Le||null===(v=Le.address)||void 0===v||null===(m=v.city)||void 0===m?void 0:m.code)||(null==je?void 0:je.code),doorNo:"",houseNo:(null==Le||null===(p=Le.address)||void 0===p?void 0:p.houseNo)||Ye,landmark:(null==Le||null===(f=Le.address)||void 0===f?void 0:f.landmark)||Ze,locality:(null==Le||null===(E=Le.address)||void 0===E||null===(g=E.locality)||void 0===g?void 0:g.i18nKey)||(null==Ke?void 0:Ke.i18nKey),localityCode:(null==Le||null===(S=Le.address)||void 0===S||null===(h=S.locality)||void 0===h?void 0:h.code)||(null==Ke?void 0:Ke.code),pincode:(null==Le||null===(y=Le.address)||void 0===y?void 0:y.pincode)||He,streetName:"",vendorId:""},{addressId:"",addressLine1:ct,addressLine2:mt,addressType:"",city:(null==Me||null===(_=Me.addressDetails)||void 0===_||null===(b=_[1])||void 0===b?void 0:b.city)||(null==lt?void 0:lt.name),cityCode:(null==Me||null===(D=Me.addressDetails)||void 0===D||null===(A=D[1])||void 0===A?void 0:A.cityCode)||(null==lt?void 0:lt.code),doorNo:"",houseNo:rt,landmark:ut,locality:null==ot?void 0:ot.i18nKey,localityCode:null==ot?void 0:ot.code,pincode:tt,streetName:"",vendorId:"",isAddressSame:ft}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:"",accountNumber:"",applicationId:"",bankBranchName:"",bankName:"",id:"",ifscCode:"",refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==Me?void 0:Me.draftId)||(null==Z||null===(C=Z.SVDetail)||void 0===C?void 0:C.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:null==Le||null===(N=Le.businessDetails)||void 0===N?void 0:N.nameOfAuthority,tenantId:k,termsAndCondition:"Y",tradeLicenseNo:null==Le||null===(T=Le.owner)||void 0===T||null===(I=T.units)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.tradeNumber,vendingActivity:null==Le||null===(w=Le.businessDetails)||void 0===w||null===(x=w.vendingType)||void 0===x?void 0:x.code,vendingArea:(null==Le||null===(R=Le.businessDetails)||void 0===R?void 0:R.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:Y,vendingZone:null==Le||null===(L=Le.businessDetails)||void 0===L||null===(P=L.vendingZones)||void 0===P?void 0:P.code,vendorDetail:[...M],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:$,draftApplication:!0},k).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})},bt=()=>{let e=Le.address;if(Fe.includes("correspondence")){e=null==Le?void 0:Le.correspondenceAddress;let t=d({},e,{cpincode:tt,ccity:lt,clocality:ot,chouseNo:rt,clandmark:ut,caddressline1:ct,caddressline2:mt,isAddressSame:ft});xe(we.key,d({},Le[we.key],t),!1),!window.location.href.includes("edit")&&_t()}else{let t=d({},e,{pincode:He,city:je,locality:Ke,houseNo:Ye,landmark:Ze,addressline1:Xe,addressline2:Qe});xe(we.key,d({},Le[we.key],t),!1),!window.location.href.includes("edit")&&_t()}},Dt=()=>xe();return n.useEffect(()=>{"citizen"===Re&&bt()},[He,je,Ke,Ye,Ze,Xe,Qe,lt,rt,ot,ct,mt]),Fe.includes("correspondence")?l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(p,{currentStep:3}):null,l.createElement(t.FormStep,{config:we,onSelect:bt,onSkip:Dt,t:Oe,isDisabled:!(lt&&rt&&ot&&ct&&mt&&tt)},l.createElement("div",null,l.createElement(t.CheckBox,{label:Oe("SV_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{0==ft?(Et(!0),nt(He),it(je),at(Ke),dt(Ye),st(Ze),vt(Xe),pt(Qe)):(Et(!1),nt(""),it(""),at(""),dt(""),st(""),vt(""),pt(""))},checked:ft,style:{paddingBottom:"10px",paddingTop:"10px"}}),l.createElement(t.CardLabel,null,""+Oe("SV_HOUSE_NO")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"chouseNo",value:rt,placeholder:"Enter House No",onChange:e=>{dt(e.target.value)},style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!1},Ve={isRequired:!0,pattern:"^[a-zA-z0-9- ]*$",type:"text",title:Oe("SV_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_ADDRESS_LINE1")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"caddressline1",value:ct,placeholder:"Enter Address",onChange:e=>{vt(e.target.value)},style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:Oe("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_ADDRESS_LINE2")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"caddressline2",value:mt,placeholder:"Enter Address",onChange:e=>{pt(e.target.value)},style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:Oe("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_LANDMARK")),l.createElement(t.TextArea,d({t:Oe,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"clandmark",value:ut,placeholder:"Enter Landmark",onChange:e=>{st(e.target.value)},style:{width:"50%"},ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,- ]*$",type:"textarea",title:Oe("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_CITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"ccity",defaultValue:lt,rules:{required:Oe("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:lt,select:it,option:ke,optionKey:"i18nKey",t:Oe,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Oe("SV_LOCALITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"clocality",defaultValue:ot,rules:{required:Oe("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ot,select:at,option:yt,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:Oe,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Oe("SV_ADDRESS_PINCODE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:Oe,type:"tel",isMandatory:!1,optionKey:"i18nKey",name:"cpincode",value:tt,onChange:e=>{nt(e.target.value)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===Ue.type?"50%":"86%"},ValidationRequired:!0,validation:{required:!0,pattern:"^[0-9]{6}$",type:"tel",title:Oe("SV_ADDRESS_PINCODE_INVALID")},minLength:6,maxLength:6})))):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(p,{currentStep:3}):null,l.createElement(t.FormStep,{config:we,onSelect:bt,onSkip:Dt,t:Oe,isDisabled:!(je&&Ye&&Ke&&Xe&&Qe&&He)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+Oe("SV_HOUSE_NO")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:Ye,placeholder:"Enter House No",onChange:e=>{qe(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!0,pattern:"^[a-zA-z0-9- ]*$",type:"text",title:Oe("SV_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_ADDRESS_LINE1")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:Xe,placeholder:"Enter Address",onChange:e=>{Je(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:Oe("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_ADDRESS_LINE2")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:Qe,placeholder:"Enter Address",onChange:e=>{et(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,-/ ]*$",type:"textarea",title:Oe("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_LANDMARK")),l.createElement(t.TextInput,d({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:Ze,placeholder:"Enter Landmark",onChange:e=>{$e(e.target.value)},style:St,ValidationRequired:!0},Ve={isRequired:!1,pattern:"^[a-zA-Z,- ]*$",type:"text",title:Oe("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+Oe("SV_CITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"city",defaultValue:je,rules:{required:Oe("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:je,select:ze,option:ke,optionKey:"i18nKey",t:Oe,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Oe("SV_LOCALITY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:gt,name:"locality",defaultValue:Ke,rules:{required:Oe("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Ke,select:Ge,option:yt,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:Oe,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Oe("SV_ADDRESS_PINCODE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:Oe,type:"tel",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:He,onChange:e=>{We(e.target.value)},placeholder:"Enter Pincode",style:St,ValidationRequired:!0,validation:{required:!0,pattern:"^[0-9]{6}$",type:"tel",title:Oe("SV_ADDRESS_PINCODE_INVALID")},maxLength:6}))))},SVBankDetails:e=>{var i,o,a,r,u,s,c,v,m,f,E,g,S,h,y,_,b,A;let{t:C,config:N,onSelect:T,userType:I,formData:O,editdata:w,previousData:x}=e;const[R,L]=n.useState({accountNumber:(null==O||null===(i=O.bankdetails)||void 0===i?void 0:i.accountNumber)||(null==x||null===(o=x.bankDetail)||void 0===o?void 0:o.accountNumber)||(null==w||null===(a=w.bankDetail)||void 0===a?void 0:a.accountNumber)||"",confirmAccountNumber:(null==O||null===(r=O.bankdetails)||void 0===r?void 0:r.confirmAccountNumber)||(null==x||null===(u=x.bankDetail)||void 0===u?void 0:u.accountNumber)||(null==w||null===(s=w.bankDetail)||void 0===s?void 0:s.accountNumber)||"",ifscCode:(null==O||null===(c=O.bankdetails)||void 0===c?void 0:c.ifscCode)||(null==x||null===(v=x.bankDetail)||void 0===v?void 0:v.ifscCode)||(null==w||null===(m=w.bankDetail)||void 0===m?void 0:m.ifscCode)||"",bankName:(null==O||null===(f=O.bankdetails)||void 0===f?void 0:f.bankName)||(null==x||null===(E=x.bankDetail)||void 0===E?void 0:E.bankName)||(null==w||null===(g=w.bankDetail)||void 0===g?void 0:g.bankName)||"",bankBranchName:(null==O||null===(S=O.bankdetails)||void 0===S?void 0:S.bankBranchName)||(null==x||null===(h=x.bankDetail)||void 0===h?void 0:h.bankBranchName)||(null==w||null===(y=w.bankDetail)||void 0===y?void 0:y.bankBranchName)||"",accountHolderName:(null==O||null===(_=O.bankdetails)||void 0===_?void 0:_.accountHolderName)||(null==x||null===(b=x.bankDetail)||void 0===b?void 0:b.accountHolderName)||(null==w||null===(A=w.bankDetail)||void 0===A?void 0:A.accountHolderName)||""}),[P,M]=n.useState(null),k=Digit.UserService.getUser().info,B=n.useCallback(function(){try{const e=D(function(){return Promise.resolve(fetch("https://ifsc.razorpay.com/"+R.ifscCode)).then(function(e){return Promise.resolve(e.json()).then(function(e){null!=e&&e.BANK&&null!=e&&e.BRANCH?L(t=>d({},t,{bankName:e.BANK,bankBranchName:e.BRANCH})):M({error:!0,label:C("SV_IFSC_CODE_INVALID")})})})},function(){M({error:!0,label:C("SV_IFSC_CODE_INVALID")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[R.ifscCode,C]);n.useEffect(()=>{R.accountNumber&&R.confirmAccountNumber&&R.accountNumber===R.confirmAccountNumber&&M({error:!1,label:C("SV_ACCOUNT_NUMBER_MATCHES")})},[R.accountNumber,R.confirmAccountNumber,C]),n.useEffect(()=>{11===R.ifscCode.length&&B()},[R.ifscCode,B]),n.useEffect(()=>{if(P){const e=setTimeout(()=>M(null),2e3);return()=>clearTimeout(e)}},[P]),n.useEffect(()=>{"citizen"===I&&F()},[R.accountNumber||R.confirmAccountNumber||R.ifscCode||R.bankName||R.bankBranchName||R.accountHolderName]);const F=()=>{R.accountNumber===R.confirmAccountNumber?(T(N.key,d({},O.bankdetails,R),!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T,I,w,L,P,M,k,B,F,V,U,H,W,j;let z=[],K=Digit.ULBService.getCitizenCurrentTenant(!0);const G=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},Y=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},q=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},Z=e=>!e||""===e.trim();if(!Z(null==O||null===(e=O.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var $,X,J,Q,ee,te;const e=null==O||null===($=O.owner)||void 0===$||null===(X=$.units)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.spouseName,t=null==O||null===(Q=O.owner)||void 0===Q||null===(ee=Q.units)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.dependentName;Z(e)&&Z(t)?z=[G(O)]:!Z(e)&&Z(t)?z=[G(O),Y(O)]:Z(e)||Z(t)||(z=[G(O),Y(O),q(O)])}const ne=(null==O||null===(l=O.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),le=sessionStorage.getItem("Response"),ie=JSON.parse(le);let oe={addressDetails:[{addressId:"",addressLine1:null==O||null===(i=O.address)||void 0===i?void 0:i.addressline1,addressLine2:null==O||null===(o=O.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==O||null===(a=O.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==O||null===(d=O.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==O||null===(s=O.address)||void 0===s?void 0:s.houseNo,landmark:null==O||null===(c=O.address)||void 0===c?void 0:c.landmark,locality:null==O||null===(v=O.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.i18nKey,localityCode:null==O||null===(p=O.address)||void 0===p||null===(f=p.locality)||void 0===f?void 0:f.code,pincode:null==O||null===(E=O.address)||void 0===E?void 0:E.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==O||null===(g=O.correspondenceAddress)||void 0===g?void 0:g.caddressline1,addressLine2:null==O||null===(S=O.correspondenceAddress)||void 0===S?void 0:S.caddressline2,addressType:"",city:null==O||null===(h=O.correspondenceAddress)||void 0===h||null===(y=h.ccity)||void 0===y?void 0:y.name,cityCode:null==O||null===(_=O.correspondenceAddress)||void 0===_||null===(b=_.ccity)||void 0===b?void 0:b.code,doorNo:"",houseNo:null==O||null===(D=O.correspondenceAddress)||void 0===D?void 0:D.chouseNo,landmark:null==O||null===(A=O.correspondenceAddress)||void 0===A?void 0:A.clandmark,locality:null==O||null===(C=O.correspondenceAddress)||void 0===C||null===(N=C.clocality)||void 0===N?void 0:N.i18nKey,localityCode:null==O||null===(T=O.correspondenceAddress)||void 0===T||null===(I=T.clocality)||void 0===I?void 0:I.code,pincode:null==O||null===(w=O.correspondenceAddress)||void 0===w?void 0:w.cpincode,streetName:"",vendorId:"",isAddressSame:null==O||null===(L=O.correspondenceAddress)||void 0===L?void 0:L.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==R?void 0:R.accountHolderName,accountNumber:null==R?void 0:R.accountNumber,applicationId:"",bankBranchName:null==R?void 0:R.bankBranchName,bankName:null==R?void 0:R.bankName,id:"",ifscCode:null==R?void 0:R.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==x?void 0:x.draftId)||(null==ie||null===(P=ie.SVDetail)||void 0===P?void 0:P.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:null==O||null===(M=O.businessDetails)||void 0===M?void 0:M.nameOfAuthority,tenantId:K,termsAndCondition:"Y",tradeLicenseNo:null==O||null===(k=O.owner)||void 0===k||null===(B=k.units)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.tradeNumber,vendingActivity:null==O||null===(V=O.businessDetails)||void 0===V||null===(U=V.vendingType)||void 0===U?void 0:U.code,vendingArea:(null==O||null===(H=O.businessDetails)||void 0===H?void 0:H.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:ne,vendingZone:null==O||null===(W=O.businessDetails)||void 0===W||null===(j=W.vendingZones)||void 0===j?void 0:j.code,vendorDetail:[...z],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:oe,draftApplication:!0},K).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()):M({error:!0,label:C("SV_INVALID_ACCOUNTNUMBER")})},V={width:"EMPLOYEE"===k.type?"50%":null};return l.createElement(l.Fragment,null,l.createElement(p,{currentStep:4}),l.createElement(t.FormStep,{config:N,onSelect:F,onSkip:()=>T(),t:C},[{label:"SV_ACCOUNT_NUMBER",field:"accountNumber",maxLength:16,regex:/\D/g},{label:"SV_CONFIRM_ACCOUNT_NUMBER",field:"confirmAccountNumber",maxLength:16,regex:/\D/g},{label:"SV_IFSC_CODE",field:"ifscCode",maxLength:11,regex:/[^a-zA-Z0-9]/g},{label:"SV_BANK_NAME",field:"bankName",disabled:!0},{label:"SV_BANK_BRANCH_NAME",field:"bankBranchName",disabled:!0},{label:"SV_ACCOUNT_HOLDER_NAME",field:"accountHolderName",regex:/[^a-zA-Z\s]/g}].map(e=>{let{label:n,field:i,maxLength:o,regex:a,disabled:r}=e;return l.createElement("div",{key:i},l.createElement(t.CardLabel,null,C(n)),l.createElement(t.TextInput,d({t:C,type:"text",name:i,value:R[i],placeholder:C("Enter "+n),onChange:e=>function(e,t,n,l){void 0===n&&(n=null),void 0===l&&(l=null),l&&(t=t.replace(l,"")),n&&t.length>n||L(n=>d({},n,{[e]:t}))}(i,e.target.value,o,a),style:V,disabled:r||!1},"accountHolderName"===i?{pattern:"^[a-zA-Z ]+$",title:C("SV_INVALID_ACCOUNT_HOLDER_NAME")}:{pattern:11===o?"[a-zA-Z0-9]{11}":"[0-9]{8,16}",title:C("SV_INVALID_"+n)})))})),P&&l.createElement(t.Toast,{error:P.error,warning:P.warning,label:C(P.label),onClose:()=>M(null)}))},SVDocumentsDetail:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:c,editdata:v,previousData:m}=e;const[f,E]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[g,S]=n.useState(null),[h,y]=n.useState(!0),[_,b]=n.useState(!0),D=Digit.ULBService.getStateId(),{isLoading:C,data:N}=Digit.Hooks.sv.useSVDoc(D,"StreetVending","Documents"),T=e=>Array.isArray(e)?e.map(e=>({applicationId:"",documentType:e.documentType,fileStoreId:e.fileStoreId,documentDetailId:e.documentUid,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}})):[];return n.useEffect(()=>{var e;let t=0;null==N||null===(e=N.StreetVending)||void 0===e||e.Documents.forEach(e=>{e.hasDropdown=!0,!f.some(t=>e.required&&(null==t?void 0:t.documentType.includes(e.code)))&&e.required&&(t+=1)}),y(!(0===t&&f.length>0))},[f,_,N]),l.createElement("div",null,l.createElement(p,{currentStep:5}),C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:()=>{let e=d({},c.documents,{documents:f});s(u.key,e),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,s,v,p,E,g,S,h,y,_,b,D,A,C,N,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z;let $=[],X=Digit.ULBService.getCitizenCurrentTenant(!0);const J=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},Q=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},ee=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},te=e=>!e||""===e.trim();if(!te(null==c||null===(e=c.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var ne,le,ie,oe,ae,re;const e=null==c||null===(ne=c.owner)||void 0===ne||null===(le=ne.units)||void 0===le||null===(ie=le[0])||void 0===ie?void 0:ie.spouseName,t=null==c||null===(oe=c.owner)||void 0===oe||null===(ae=oe.units)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.dependentName;te(e)&&te(t)?$=[J(c)]:!te(e)&&te(t)?$=[J(c),Q(c)]:te(e)||te(t)||($=[J(c),Q(c),ee(c)])}const de=(null==c||null===(l=c.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),ue=sessionStorage.getItem("Response"),se=JSON.parse(ue);let ce={addressDetails:[{addressId:"",addressLine1:null==c||null===(i=c.address)||void 0===i?void 0:i.addressline1,addressLine2:null==c||null===(o=c.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==c||null===(a=c.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==c||null===(d=c.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==c||null===(s=c.address)||void 0===s?void 0:s.houseNo,landmark:null==c||null===(v=c.address)||void 0===v?void 0:v.landmark,locality:null==c||null===(p=c.address)||void 0===p||null===(E=p.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==c||null===(g=c.address)||void 0===g||null===(S=g.locality)||void 0===S?void 0:S.code,pincode:null==c||null===(h=c.address)||void 0===h?void 0:h.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==c||null===(y=c.correspondenceAddress)||void 0===y?void 0:y.caddressline1,addressLine2:null==c||null===(_=c.correspondenceAddress)||void 0===_?void 0:_.caddressline2,addressType:"",city:null==c||null===(b=c.correspondenceAddress)||void 0===b||null===(D=b.ccity)||void 0===D?void 0:D.name,cityCode:null==c||null===(A=c.correspondenceAddress)||void 0===A||null===(C=A.ccity)||void 0===C?void 0:C.code,doorNo:"",houseNo:null==c||null===(N=c.correspondenceAddress)||void 0===N?void 0:N.chouseNo,landmark:null==c||null===(I=c.correspondenceAddress)||void 0===I?void 0:I.clandmark,locality:null==c||null===(O=c.correspondenceAddress)||void 0===O||null===(w=O.clocality)||void 0===w?void 0:w.i18nKey,localityCode:null==c||null===(x=c.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.code,pincode:null==c||null===(L=c.correspondenceAddress)||void 0===L?void 0:L.cpincode,streetName:"",vendorId:"",isAddressSame:null==c||null===(P=c.correspondenceAddress)||void 0===P?void 0:P.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==c||null===(M=c.bankDetails)||void 0===M?void 0:M.accountHolderName,accountNumber:null==c||null===(k=c.bankDetails)||void 0===k?void 0:k.accountNumber,applicationId:"",bankBranchName:null==c||null===(B=c.bankDetails)||void 0===B?void 0:B.bankBranchName,bankName:null==c||null===(F=c.bankDetails)||void 0===F?void 0:F.bankName,id:"",ifscCode:null==c||null===(V=c.bankDetails)||void 0===V?void 0:V.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:"",enrollmentId:"",cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:"",draftId:(null==m?void 0:m.draftId)||(null==se||null===(U=se.SVDetail)||void 0===U?void 0:U.draftId),documentDetails:T(f),localAuthorityName:null==c||null===(H=c.businessDetails)||void 0===H?void 0:H.nameOfAuthority,tenantId:X,termsAndCondition:"Y",tradeLicenseNo:null==c||null===(W=c.owner)||void 0===W||null===(j=W.units)||void 0===j||null===(z=j[0])||void 0===z?void 0:z.tradeNumber,vendingActivity:null==c||null===(K=c.businessDetails)||void 0===K||null===(G=K.vendingType)||void 0===G?void 0:G.code,vendingArea:(null==c||null===(Y=c.businessDetails)||void 0===Y?void 0:Y.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:de,vendingZone:null==c||null===(q=c.businessDetails)||void 0===q||null===(Z=q.vendingZones)||void 0===Z?void 0:Z.code,vendorDetail:[...$],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:ce,draftApplication:!0},X).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()},onSkip:()=>s(),isDisabled:h},null==N||null===(o=N.StreetVending)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(A,{key:t,document:e,t:r,error:g,setError:S,setDocuments:E,documents:f,setCheckRequiredFields:b,formData:c,editdata:v,previousData:m})),g&&l.createElement(t.Toast,{label:g,onClose:()=>S(null),error:!0})))},CheckPage:e=>{var o,a,r,u,s,c,v,m,f,S,y,D,A,N,T,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re;let{onSubmit:de,editdata:ue,value:se={}}=e;const{t:ce}=i.useTranslation(),{owner:ve,businessDetails:me,address:pe,bankdetails:fe,documents:Ee,specialCategoryData:ge}=se,[Se,he]=n.useState(!1),ye=[{Header:ce("SV_WEEK_DAYS"),accessor:"name"},{Header:ce("SV_START_TIME"),accessor:"startTime"},{Header:ce("SV_END_TIME"),accessor:"endTime"}],_e=(null==me||null===(o=me.daysOfOperation)||void 0===o?void 0:o.filter(e=>e.isSelected).map((e,t)=>({name:null==e?void 0:e.name,startTime:parseInt(null==e?void 0:e.startTime)>=12?(null==e?void 0:e.startTime)+" PM":(null==e?void 0:e.startTime)+" AM",endTime:parseInt(null==e?void 0:e.endTime)>=12?(null==e?void 0:e.endTime)+" PM":(null==e?void 0:e.endTime)+" AM"})))||[];let be=[];if(null!=ue&&ue.documentDetails&&Array.isArray(null==ue?void 0:ue.documentDetails)&&(null==ue||ue.documentDetails.map(e=>{be.push(d({},e,{module:"StreetVending"}))})),_.isEmpty(ue)&&null!=Ee&&Ee.documents&&Ee.documents.forEach(e=>{be.some(t=>t.documentType===e.documentType)||be.push(d({},e,{module:"StreetVending"}))}),_.isEmpty(ue)){const e=JSON.parse(sessionStorage.getItem("CategoryDocument"));e&&Array.isArray(e)&&e.forEach(e=>{be.some(t=>t.documentType===e.documentType)||be.push(d({},e,{module:"StreetVending"}))})}const{data:De}=Digit.Hooks.useDocumentSearch(be,{enabled:(null==be?void 0:be.length)>0});let Ae=[];var Ce;return(null==De||null===(a=De.pdfFiles)||void 0===a?void 0:a.length)>0&&(null==De||null===(Ce=De.pdfFiles)||void 0===Ce||Ce.map(e=>{"StreetVending"==(null==e?void 0:e.module)&&Ae.push(e)})),l.createElement(l.Fragment,null,l.createElement(p,{currentStep:7}),l.createElement(t.Card,null,l.createElement(t.CardHeader,null,ce("SV_SUMMARY_PAGE")),l.createElement("div",null,l.createElement(t.CardSubHeader,null,ce("SV_VENDOR_PERSONAL_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_VENDOR_NAME"),text:""+ce(E(null==ve||null===(r=ve.units)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.vendorName)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/applicant-details"})}),l.createElement(t.Row,{label:ce("SV_REGISTERED_MOB_NUMBER"),text:""+ce(E(null==ve||null===(s=ve.units)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.mobileNumber))}),l.createElement(t.Row,{label:ce("SV_DATE_OF_BIRTH"),text:""+ce(E(null==ve||null===(v=ve.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.vendorDateOfBirth))}),l.createElement(t.Row,{label:ce("SV_GENDER"),text:""+ce(E(null==ve||null===(f=ve.units)||void 0===f||null===(S=f[0])||void 0===S||null===(y=S.gender)||void 0===y?void 0:y.code))}),l.createElement(t.Row,{label:ce("SV_FATHER_NAME"),text:""+ce(E(null==ve||null===(D=ve.units)||void 0===D||null===(A=D[0])||void 0===A?void 0:A.fatherName))}),null!=ve&&null!==(N=ve.units)&&void 0!==N&&null!==(T=N[0])&&void 0!==T&&T.email?l.createElement(t.Row,{label:ce("SV_EMAIL"),text:""+ce(E(null==ve||null===(I=ve.units)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.email))}):null,(null==ve||null===(w=ve.units)||void 0===w||null===(x=w[0])||void 0===x?void 0:x.spouseName)&&l.createElement(t.Row,{label:ce("SV_SPOUSE_NAME"),text:l.createElement("span",null,ce(E(null==ve||null===(R=ve.units)||void 0===R||null===(L=R[0])||void 0===L?void 0:L.spouseName))," ",l.createElement("span",{className:"astericColor"},"(",ce(null!=ve&&ve.spouseDependentChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ve&&null!==(P=ve.units)&&void 0!==P&&null!==(M=P[0])&&void 0!==M&&M.spouseDateBirth?l.createElement(t.Row,{label:ce("SV_SPOUSE_DATE_OF_BIRTH"),text:""+ce(E(null==ve||null===(k=ve.units)||void 0===k||null===(B=k[0])||void 0===B?void 0:B.spouseDateBirth))}):null,(null==ve||null===(F=ve.units)||void 0===F||null===(V=F[0])||void 0===V?void 0:V.dependentName)&&l.createElement(t.Row,{label:ce("SV_DEPENDENT_NAME"),text:l.createElement("span",null,ce(E(null==ve||null===(U=ve.units)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.dependentName))," ",l.createElement("span",{className:"astericColor"},"(",ce(null!=ve&&ve.dependentNameChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ve&&null!==(W=ve.units)&&void 0!==W&&null!==(j=W[0])&&void 0!==j&&j.dependentDateBirth?l.createElement(t.Row,{label:ce("SV_DEPENDENT_DATE_OF_BIRTH"),text:""+ce(E(null==ve||null===(z=ve.units)||void 0===z||null===(K=z[0])||void 0===K?void 0:K.dependentDateBirth))}):null,null!=ve&&null!==(G=ve.units)&&void 0!==G&&null!==(Y=G[0])&&void 0!==Y&&Y.dependentGender?l.createElement(t.Row,{label:ce("SV_DEPENDENT_GENDER"),text:""+ce(E(null==ve||null===(q=ve.units)||void 0===q||null===(Z=q[0])||void 0===Z||null===($=Z.dependentGender)||void 0===$?void 0:$.code))}):null,null!=ve&&null!==(X=ve.units)&&void 0!==X&&null!==(J=X[0])&&void 0!==J&&J.dependentGender?l.createElement(t.Row,{label:ce("SV_TRADE_NUMBER"),text:""+ce(E(null==ve||null===(Q=ve.units)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.tradeNumber))}):null),l.createElement(t.CardSubHeader,null,ce("SV_VENDOR_BUSINESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_VENDING_TYPE"),text:""+ce(E(null==me||null===(te=me.vendingType)||void 0===te?void 0:te.code)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/business-details"})}),l.createElement(t.Row,{label:ce("SV_VENDING_ZONES"),text:""+ce(E(null==me||null===(ne=me.vendingZones)||void 0===ne?void 0:ne.value))}),l.createElement(t.Row,{label:ce("SV_AREA_REQUIRED"),text:""+ce(E(null==me?void 0:me.areaRequired))}),l.createElement(t.Row,{label:ce("SV_LOCAL_AUTHORITY_NAME"),text:""+ce(E(null==me?void 0:me.nameOfAuthority))}),null!=me&&me.vendingLiscence?l.createElement(t.Row,{label:ce("SV_VENDING_LISCENCE"),text:""+ce(E(null==me?void 0:me.vendingLiscence))}):null,l.createElement("span",{style:{marginTop:"5px",fontSize:"18px",fontWeight:"bold"}},ce("SV_DAY_HOUR_OPERATION")),l.createElement(b,{t:ce,data:_e,columns:ye,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:_e.length})),(null==fe?void 0:fe.accountNumber)&&(null==fe?void 0:fe.ifscCode)&&(null==fe?void 0:fe.bankName)&&(null==fe?void 0:fe.bankBranchName)&&(null==fe?void 0:fe.accountHolderName)&&l.createElement(l.Fragment,null,l.createElement(t.CardSubHeader,null,ce("SV_BANK_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_ACCOUNT_NUMBER"),text:""+ce(E(null==fe?void 0:fe.accountNumber)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/bank-details"})}),l.createElement(t.Row,{label:ce("SV_IFSC_CODE"),text:""+ce(E(null==fe?void 0:fe.ifscCode))}),l.createElement(t.Row,{label:ce("SV_BANK_NAME"),text:""+ce(E(null==fe?void 0:fe.bankName))}),l.createElement(t.Row,{label:ce("SV_BANK_BRANCH_NAME"),text:""+ce(E(null==fe?void 0:fe.bankBranchName))}),l.createElement(t.Row,{label:ce("SV_ACCOUNT_HOLDER_NAME"),text:""+ce(E(null==fe?void 0:fe.accountHolderName))}))),l.createElement(t.CardSubHeader,null,ce("SV_ADDRESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_ADDRESS_LINE1"),text:""+ce(E(null==pe?void 0:pe.addressline1)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/address-details"})}),l.createElement(t.Row,{label:ce("SV_ADDRESS_LINE2"),text:""+ce(E(null==pe?void 0:pe.addressline2))}),l.createElement(t.Row,{label:ce("SV_CITY"),text:""+ce(E(null==pe||null===(le=pe.city)||void 0===le||null===(ie=le.city)||void 0===ie?void 0:ie.name))}),l.createElement(t.Row,{label:ce("SV_LOCALITY"),text:""+ce(E(null==pe||null===(oe=pe.locality)||void 0===oe?void 0:oe.i18nKey))}),null!=pe&&pe.pincode?l.createElement(t.Row,{label:ce("SV_ADDRESS_PINCODE"),text:""+ce(E(null==pe?void 0:pe.pincode))}):null,null!=pe&&pe.landmark?l.createElement(t.Row,{label:ce("SV_LANDMARK"),text:""+ce(E(null==pe?void 0:pe.landmark))}):null),l.createElement(t.CardSubHeader,null,ce("SV_ADDITIONAL_DETAILS")),l.createElement(t.StatusTable,{style:{marginBottom:"30px"}},l.createElement(t.Row,{label:ce("SV_CATEGORY"),text:""+ce(E(null==ge||null===(ae=ge.ownerCategory)||void 0===ae?void 0:ae.value)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/special-category"})}),null!==(null==ge?void 0:ge.beneficiary)?l.createElement(t.Row,{label:ce("SV_BENEFICIARY_SCHEMES"),text:""+ce(E(null==ge||null===(re=ge.beneficiary)||void 0===re?void 0:re.value))}):null,null!==(null==ge?void 0:ge.enrollmentId)?l.createElement(t.Row,{label:ce("SV_ENROLLMENT_APPLICATION_NUMBER"),text:""+ce(E(null==ge?void 0:ge.enrollmentId))}):null),l.createElement(t.CardSubHeader,null,ce("SV_DOCUMENT_DETAILS_LABEL")),l.createElement(h,{documents:g(Ae),svgStyles:{},isSendBackFlow:!1,titleStyles:{fontSize:"18px",fontWeight:700,marginBottom:"10px"}}),l.createElement("br",null),l.createElement(t.CheckBox,{label:ce("SV_FINAL_DECLARATION_MESSAGE"),onChange:()=>{he(!Se)},styles:{height:"auto",marginBottom:"30px",marginTop:"10px"}})),l.createElement(t.SubmitBar,{label:ce("SV_COMMON_BUTTON_SUBMIT"),onSubmit:de,disabled:!Se})))},SVEmpCreate:e=>{var t,n,r,u;const c=a.useQueryClient(),v=o.useRouteMatch(),{t:m}=i.useTranslation(),{pathname:p}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let E=[];const[g,S,h]=Digit.Hooks.useSessionStorage("SV_EMP_CREATES",{});function y(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=g.owners||[];n[l]=t,S(d({},g,{[e]:[...n]}))}else if("units"===e){let e=g.units||[];e=t,S(d({},g,{units:e}))}else S(d({},g,{[e]:d({},g[e],t)}));((e,t,n,l)=>{let i,o=p.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=p.slice(0,-3),o=o.split("/").pop(),r=!0):(o=p.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:d={}}=E.find(e=>e.route===o),u=f.push;if(e&&(u=f.replace),n&&(d=l),null===d)return u(v.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?v.path+"/"+d+"/"+t:v.path+"/"+d,u(i)})(n,l,i,e)}g&&Object.keys(g).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(h(),c.invalidateQueries("SV_EMP_CREATE"));const _=()=>{},b=()=>{};s.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const D=null===(t=Digit)||void 0===t||null===(n=t.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CheckPage"),A=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,d="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n,u=Digit.UserService.getUser().info.type;return l.createElement(o.Route,{path:v.path+"/"+e.route,key:t},l.createElement(d,{config:{texts:i,inputs:a,key:r},onSelect:y,onSkip:_,t:m,formData:g,onAdd:b,userType:u}))}),l.createElement(o.Route,{path:v.path+"/check"},l.createElement(D,{onSubmit:function(){try{return f.replace(v.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:g})),l.createElement(o.Route,{path:v.path+"/acknowledgement"},l.createElement(A,{data:g,onSuccess:()=>{h(),c.invalidateQueries("SV_EMP_CREATE"),sessionStorage.removeItem("CategoryDocument"),sessionStorage.removeItem("vendingApplicationID"),sessionStorage.removeItem("ApplicationId"),sessionStorage.removeItem("Response")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:v.path+"/"+E.indexRoute})))},SVAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:u}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),c=Digit.Hooks.sv.useSvCreateApi(s,!window.location.href.includes("edit")),v=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:p}=m||{};return n.useEffect(()=>{try{a.tenantId=s;let e=window.location.href.includes("edit")?(e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,h,y,_,b,D,A,C,N,T,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne;let le=[];const ie=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C;return{applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,specialCategory:null==e||null===(p=e.specialCategoryData)||void 0===p||null===(f=p.ownerCategory)||void 0===f?void 0:f.code,gender:null==e||null===(E=e.owner)||void 0===E||null===(g=E.units)||void 0===g||null===(S=g[0])||void 0===S||null===(h=S.gender)||void 0===h?void 0:h.code.charAt(0),id:sessionStorage.getItem("venId"),mobileNo:null==e||null===(y=e.owner)||void 0===y||null===(_=y.units)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.mobileNumber,name:null==e||null===(D=e.owner)||void 0===D||null===(A=D.units)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},oe=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m;return{applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(s=u.ownerCategory)||void 0===s?void 0:s.code,gender:"N/A",id:sessionStorage.getItem("venId"),mobileNo:"",name:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.spouseName,relationshipType:"SPOUSE",vendorId:null}},ae=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g;return{applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(s=u.ownerCategory)||void 0===s?void 0:s.code,gender:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m||null===(p=m.dependentGender)||void 0===p?void 0:p.code.charAt(0),id:sessionStorage.getItem("venId"),mobileNo:"",name:null==e||null===(f=e.owner)||void 0===f||null===(E=f.units)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.dependentName,relationshipType:"DEPENDENT",vendorId:null}},re=e=>!e||""===e.trim();if(!re(null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorName)){var de,ue,se,ce,ve,me;const t=null==e||null===(de=e.owner)||void 0===de||null===(ue=de.units)||void 0===ue||null===(se=ue[0])||void 0===se?void 0:se.spouseName,n=null==e||null===(ce=e.owner)||void 0===ce||null===(ve=ce.units)||void 0===ve||null===(me=ve[0])||void 0===me?void 0:me.dependentName;re(t)&&re(n)?le=[ie(e)]:!re(t)&&re(n)?le=[ie(e),oe(e)]:re(t)||re(n)||(le=[ie(e),oe(e),ae(e)])}const pe=(null==e||null===(i=e.businessDetails)||void 0===i?void 0:i.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:sessionStorage.getItem("ApplicationId"),auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""}));return{streetVendingDetail:{addressDetails:[{addressId:sessionStorage.getItem("addressIdOne"),addressLine1:null==e||null===(o=e.address)||void 0===o?void 0:o.addressline1,addressLine2:null==e||null===(a=e.address)||void 0===a?void 0:a.addressline2,addressType:"PERMANENT",city:(null==e||null===(r=e.address)||void 0===r||null===(d=r.city)||void 0===d?void 0:d.name)||(null==e||null===(u=e.address)||void 0===u||null===(s=u.city)||void 0===s?void 0:s.code),cityCode:null==e||null===(c=e.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code,doorNo:"",houseNo:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo,landmark:null==e||null===(p=e.address)||void 0===p?void 0:p.landmark,locality:null==e||null===(f=e.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==e||null===(g=e.address)||void 0===g||null===(h=g.locality)||void 0===h?void 0:h.code,pincode:null==e||null===(y=e.address)||void 0===y?void 0:y.pincode,streetName:"",vendorId:sessionStorage.getItem("vendorIds")},{addressId:sessionStorage.getItem("addressIdTwo"),addressLine1:null==e||null===(_=e.correspondenceAddress)||void 0===_?void 0:_.caddressline1,addressLine2:null==e||null===(b=e.correspondenceAddress)||void 0===b?void 0:b.caddressline2,addressType:"CORRESPONDENCE",city:(null==e||null===(D=e.correspondenceAddress)||void 0===D||null===(A=D.ccity)||void 0===A?void 0:A.name)||(null==e||null===(C=e.correspondenceAddress)||void 0===C||null===(N=C.ccity)||void 0===N?void 0:N.code),cityCode:null==e||null===(T=e.correspondenceAddress)||void 0===T||null===(I=T.ccity)||void 0===I?void 0:I.code,doorNo:"",houseNo:null==e||null===(O=e.correspondenceAddress)||void 0===O?void 0:O.chouseNo,landmark:null==e||null===(w=e.correspondenceAddress)||void 0===w?void 0:w.clandmark,locality:null==e||null===(x=e.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.i18nKey,localityCode:null==e||null===(L=e.correspondenceAddress)||void 0===L||null===(P=L.clocality)||void 0===P?void 0:P.code,pincode:null==e||null===(M=e.correspondenceAddress)||void 0===M?void 0:M.cpincode,streetName:"",vendorId:sessionStorage.getItem("vendorIds"),isAddressSame:null==e||null===(k=e.correspondenceAddress)||void 0===k?void 0:k.isAddressSame}],applicationDate:0,applicationId:sessionStorage.getItem("ApplicationId"),applicationNo:sessionStorage.getItem("vendingApplicationID"),applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==e||null===(B=e.bankdetails)||void 0===B?void 0:B.accountHolderName,accountNumber:null==e||null===(F=e.bankdetails)||void 0===F?void 0:F.accountNumber,applicationId:sessionStorage.getItem("ApplicationId"),bankBranchName:null==e||null===(V=e.bankdetails)||void 0===V?void 0:V.bankBranchName,bankName:null==e||null===(U=e.bankdetails)||void 0===U?void 0:U.bankName,id:sessionStorage.getItem("bankIds"),ifscCode:null==e||null===(H=e.bankdetails)||void 0===H?void 0:H.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==e||null===(W=e.specialCategoryData)||void 0===W||null===(j=W.beneficiary)||void 0===j?void 0:j.value,enrollmentId:null==e||null===(z=e.specialCategoryData)||void 0===z?void 0:z.enrollmentId,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==e||null===(K=e.specialCategoryData)||void 0===K||null===(G=K.ownerCategory)||void 0===G?void 0:G.code,documentDetails:S(null==e||null===(Y=e.documents)||void 0===Y?void 0:Y.documents),localAuthorityName:null==e||null===(q=e.businessDetails)||void 0===q?void 0:q.nameOfAuthority,tenantId:null==e?void 0:e.tenantId,termsAndCondition:"Y",tradeLicenseNo:null==e||null===(Z=e.owner)||void 0===Z||null===($=Z.units)||void 0===$||null===(X=$[0])||void 0===X?void 0:X.tradeNumber,vendingActivity:null==e||null===(J=e.businessDetails)||void 0===J||null===(Q=J.vendingType)||void 0===Q?void 0:Q.code,vendingArea:(null==e||null===(ee=e.businessDetails)||void 0===ee?void 0:ee.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:pe,vendingZone:null==e||null===(te=e.businessDetails)||void 0===te||null===(ne=te.vendingZones)||void 0===ne?void 0:ne.code,vendorDetail:[...le],workflow:{action:"RESUBMIT",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}}}})(a):(e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,h,y,_,b,D,A,C,N,T,I,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,ae,re,de,ue,se,ce,ve,me,pe,fe,Ee,ge,Se,he;let ye=[];const _e=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,specialCategory:null==e||null===(p=e.specialCategoryData)||void 0===p||null===(f=p.ownerCategory)||void 0===f?void 0:f.code,gender:null==e||null===(E=e.owner)||void 0===E||null===(g=E.units)||void 0===g||null===(S=g[0])||void 0===S||null===(h=S.gender)||void 0===h?void 0:h.code.charAt(0),id:"",isInvolved:!0,mobileNo:null==e||null===(y=e.owner)||void 0===y||null===(_=y.units)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.mobileNumber,name:null==e||null===(D=e.owner)||void 0===D||null===(A=D.units)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},be=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",specialCategory:null==e||null===(d=e.specialCategoryData)||void 0===d||null===(u=d.ownerCategory)||void 0===u?void 0:u.code,isInvolved:null==e||null===(s=e.owner)||void 0===s?void 0:s.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.spouseName,relationshipType:"SPOUSE",vendorId:null}},De=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(s=u.ownerCategory)||void 0===s?void 0:s.code,fatherName:"",gender:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m||null===(p=m.dependentGender)||void 0===p?void 0:p.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(f=e.owner)||void 0===f||null===(E=f.units)||void 0===E||null===(g=E[0])||void 0===g?void 0:g.dependentName,relationshipType:"DEPENDENT",vendorId:null}},Ae=e=>!e||""===e.trim();if(!Ae(null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorName)){var Ce,Ne,Te,Ie,Oe,we;const t=null==e||null===(Ce=e.owner)||void 0===Ce||null===(Ne=Ce.units)||void 0===Ne||null===(Te=Ne[0])||void 0===Te?void 0:Te.spouseName,n=null==e||null===(Ie=e.owner)||void 0===Ie||null===(Oe=Ie.units)||void 0===Oe||null===(we=Oe[0])||void 0===we?void 0:we.dependentName;Ae(t)&&Ae(n)?ye=[_e(e)]:!Ae(t)&&Ae(n)?ye=[_e(e),be(e)]:Ae(t)||Ae(n)||(ye=[_e(e),be(e),De(e)])}const xe=(null==e||null===(i=e.businessDetails)||void 0===i?void 0:i.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),Re=sessionStorage.getItem("Response"),Le=Re?JSON.parse(Re):null;return{streetVendingDetail:{addressDetails:[{addressId:"",addressLine1:null==e||null===(o=e.address)||void 0===o?void 0:o.addressline1,addressLine2:null==e||null===(a=e.address)||void 0===a?void 0:a.addressline2,addressType:"",city:(null==e||null===(r=e.address)||void 0===r||null===(d=r.city)||void 0===d?void 0:d.name)||(null==e||null===(u=e.address)||void 0===u||null===(s=u.city)||void 0===s?void 0:s.code),cityCode:(null==e||null===(c=e.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code)||(null==e?void 0:e.tenantId),doorNo:"",houseNo:null==e||null===(m=e.address)||void 0===m?void 0:m.houseNo,landmark:null==e||null===(p=e.address)||void 0===p?void 0:p.landmark,locality:(null==Le||null===(f=Le.SVDetail)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.addressDetails)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.locality)||(null==e||null===(y=e.address)||void 0===y||null===(_=y.locality)||void 0===_?void 0:_.i18nKey),localityCode:(null==Le||null===(b=Le.SVDetail)||void 0===b||null===(D=b[0])||void 0===D||null===(A=D.addressDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.localityCode)||(null==e||null===(N=e.address)||void 0===N||null===(T=N.locality)||void 0===T?void 0:T.code),pincode:null==e||null===(I=e.address)||void 0===I?void 0:I.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==e||null===(O=e.correspondenceAddress)||void 0===O?void 0:O.caddressline1,addressLine2:null==e||null===(w=e.correspondenceAddress)||void 0===w?void 0:w.caddressline2,addressType:"",city:(null==e||null===(x=e.correspondenceAddress)||void 0===x||null===(R=x.ccity)||void 0===R?void 0:R.name)||(null==e||null===(L=e.correspondenceAddress)||void 0===L||null===(P=L.ccity)||void 0===P?void 0:P.code),cityCode:(null==e||null===(M=e.correspondenceAddress)||void 0===M||null===(k=M.ccity)||void 0===k?void 0:k.code)||(null==e?void 0:e.tenantId),doorNo:"",houseNo:null==e||null===(B=e.correspondenceAddress)||void 0===B?void 0:B.chouseNo,landmark:null==e||null===(F=e.correspondenceAddress)||void 0===F?void 0:F.clandmark,locality:(null==Le||null===(V=Le.SVDetail)||void 0===V||null===(U=V[0])||void 0===U||null===(H=U.addressDetails)||void 0===H||null===(W=H[1])||void 0===W?void 0:W.locality)||(null==e||null===(j=e.correspondenceAddress)||void 0===j||null===(z=j.clocality)||void 0===z?void 0:z.i18nKey),localityCode:(null==Le||null===(K=Le.SVDetail)||void 0===K||null===(G=K[0])||void 0===G||null===(Y=G.addressDetails)||void 0===Y||null===(q=Y[1])||void 0===q?void 0:q.localityCode)||(null==e||null===(Z=e.correspondenceAddress)||void 0===Z||null===($=Z.clocality)||void 0===$?void 0:$.code),pincode:null==e||null===(X=e.correspondenceAddress)||void 0===X?void 0:X.cpincode,streetName:"",vendorId:"",isAddressSame:null==e||null===(J=e.correspondenceAddress)||void 0===J?void 0:J.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==e||null===(Q=e.bankdetails)||void 0===Q?void 0:Q.accountHolderName,accountNumber:null==e||null===(ee=e.bankdetails)||void 0===ee?void 0:ee.accountNumber,applicationId:"",bankBranchName:null==e||null===(te=e.bankdetails)||void 0===te?void 0:te.bankBranchName,bankName:null==e||null===(ne=e.bankdetails)||void 0===ne?void 0:ne.bankName,id:"",ifscCode:null==e||null===(le=e.bankdetails)||void 0===le?void 0:le.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==e||null===(ie=e.specialCategoryData)||void 0===ie||null===(oe=ie.beneficiary)||void 0===oe?void 0:oe.value,enrollmentId:null==e||null===(ae=e.specialCategoryData)||void 0===ae?void 0:ae.enrollmentId,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==e||null===(re=e.specialCategoryData)||void 0===re||null===(de=re.ownerCategory)||void 0===de?void 0:de.code,draftId:(null==Le||null===(ue=Le.SVDetail)||void 0===ue?void 0:ue.draftId)||"",documentDetails:S(null==e||null===(se=e.documents)||void 0===se?void 0:se.documents),localAuthorityName:null==e||null===(ce=e.businessDetails)||void 0===ce?void 0:ce.nameOfAuthority,tenantId:null==e?void 0:e.tenantId,termsAndCondition:"Y",tradeLicenseNo:null==e||null===(ve=e.owner)||void 0===ve||null===(me=ve.units)||void 0===me||null===(pe=me[0])||void 0===pe?void 0:pe.tradeNumber,vendingActivity:null==e||null===(fe=e.businessDetails)||void 0===fe||null===(Ee=fe.vendingType)||void 0===Ee?void 0:Ee.code,vendingArea:(null==e||null===(ge=e.businessDetails)||void 0===ge?void 0:ge.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:xe,vendingZone:null==e||null===(Se=e.businessDetails)||void 0===Se||null===(he=Se.vendingZones)||void 0===he?void 0:he.code,vendorDetail:[...ye],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}},draftApplication:!1}})(a);c.mutate(e,{onSuccess:r})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(Q,{t:u,data:c.data,isSuccess:c.isSuccess,isLoading:c.isIdle||c.isLoading}),l.createElement(t.StatusTable,null,c.isSuccess&&l.createElement(t.Row,{rowContainerStyle:J,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),c.isSuccess&&l.createElement(t.SubmitBar,{label:u("SV_ACKNOWLEDGEMENT"),onSubmit:function(){try{const{SVDetail:e=[]}=c.data;let t=e||{};const n=p.find(e=>e.code===t.tenantId);return Promise.resolve($(d({},t),n,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},SVApplicationDetails:Il,SVMyApplications:()=>{var e,a;const{t:r}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.UserService.getUser().info,[c,v]=n.useState(""),[m,p]=n.useState(""),[f,E]=n.useState(null),[g,S]=n.useState([]);let h,y=window.location.href.split("/").pop();h=isNaN(parseInt(y))?4:parseInt(y)+50;let _={limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:u,isDraftApplication:!1,mobileNumber:null==s?void 0:s.mobileNumber};n.useEffect(()=>{E(_)},[y]);const{isLoading:b,data:D}=Digit.Hooks.sv.useSvSearchApplication({filters:d({},f,{isDraftApplication:!1})}),{isLoading:A,data:C}=Digit.Hooks.sv.useSvSearchApplication({filters:d({},f,{isDraftApplication:!0,sortOrder:"DESC"})}),N=null==C||null===(e=C.SVDetail)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.draftId;n.useEffect(()=>{null!=C&&C.SVDetail&&null!=D&&D.SVDetail&&S([...C.SVDetail||[],...D.SVDetail||[]])},[C,D]);const T=e=>{S(t=>t.filter(t=>t!==e))};return b||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,r("SV_MY_APPLICATIONS")+" "+(g?"("+g.length+")":"")),l.createElement(t.Card,null,l.createElement("div",{style:{marginLeft:"16px"}},l.createElement("div",{className:"svsearchbox"},l.createElement("div",{style:{flex:1}},l.createElement("div",{className:"svsearchfield"},l.createElement(t.CardLabel,null,r("SV_APPLICATION_NUMBER")),l.createElement(t.TextInput,{placeholder:r("Enter Application No."),value:c,onChange:e=>v(e.target.value),style:{width:"100%",padding:"8px",height:"150%"}}))),l.createElement("div",{style:{flex:1}},l.createElement("div",{className:"svsearchfield"},l.createElement(t.CardLabel,null,r("SV_REGISTERED_MOB_NUMBER")),l.createElement(t.TextInput,{placeholder:r("Enter Mobile No."),value:m,onChange:e=>p(e.target.value),style:{width:"100%",padding:"8px",height:"150%"}}))),l.createElement("div",null,l.createElement("div",{style:{marginTop:"17%"}},l.createElement(t.SubmitBar,{label:r("ES_COMMON_SEARCH"),onSubmit:()=>{const e=c.trim(),t=d({},_,{applicationNumber:e||null,mobileNumber:m||null});E(t)}}),l.createElement("p",{className:"link svclearall",onClick:()=>{v(""),p("")}},r("ES_COMMON_CLEAR_ALL"))))))),l.createElement("div",null,(null==g?void 0:g.length)>0&&g.map((e,t)=>l.createElement("div",{key:t},l.createElement(Ol,{application:e,tenantId:null==s?void 0:s.permanentCity,buttonLabel:r("SV_TRACK"),previousDraftId:N,onDiscard:T}))),!(null!=g&&g.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r("SV_NO_APPLICATION_FOUND_MSG")),0!==(null==g?void 0:g.length)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/citizen/sv/my-applications/"+h},r("SV_LOAD_MORE_MSG")))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r("SV_NO_APPLICATION_FOUND")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(o.Link,{to:"/digit-ui/citizen/sv/apply/info"},r("SV_CLICK_TO_APPLY_NEW_APPLICATION")))))},SvApplicationDetails:()=>{var e,a,r,s,c,v,m,p,f,E,g,S,h,y,_,b,D,A,C,N,T,I;const{t:O}=i.useTranslation(),{applicationNo:w,tenantId:x}=o.useParams(),[R,L]=n.useState(!1),[P,M]=n.useState(!1),[k,B]=n.useState(null),{data:F}=Digit.Hooks.useStore.getInitData(),{tenants:V}=F||{},{isLoading:U,data:H}=Digit.Hooks.sv.useSvSearchApplication({tenantId:x,filters:{applicationNumber:w,isDraftApplication:!1}}),[W,j]=n.useState(null),z=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return pt(e)?e:function(e,t){if(pt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Rl(e))||Pl.test(e)||!Ll.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Ul(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(pt(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(Rl(t))return Wl?Wl.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[jl(t[n++])];return n&&n==l?e:void 0}(e,"SVDetail");return void 0===l?[]:l}(H);let K=z&&z.length>0&&z[0]||{};const G=K;sessionStorage.setItem("streetvending",JSON.stringify(G));const[Y,q]=n.useState(!1);n.useEffect(()=>{!function(){try{q(!0),Promise.resolve(Digit.PaymentService.fetchBill(x,{businessService:"sv-services",consumerCode:w})).then(function(e){j(e),q(!1)})}catch(e){return Promise.reject(e)}}()},[x,w]);const{data:Z,isLoading:X}=Digit.Hooks.useRecieptSearch({tenantId:x,businessService:"sv-services",consumerCodes:w,isEmployee:!1},{enabled:!!w});if(K.workflow||(K.workflow={id:null,tenantId:x,businessService:"street-vending",businessId:null==G?void 0:G.applicationNo,action:"",moduleName:"sv-services",state:null,comment:null,documents:null,assignes:null}),U)return l.createElement(t.Loader,null);let J=[];return J.push({label:O("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=G||{},t=V.find(t=>t.code===e.tenantId);return Promise.resolve($(d({},e),t,O)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&J.push({label:O("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;u(e,zl);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[d({},n)]},"svservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==Z||null===(e=Z.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Z?void 0:Z.Payments[0]})}}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&J.push({label:O("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(x,{SVDetail:[null==H||null===(e=H.SVDetail)||void 0===e?void 0:e[0]]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(x,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&J.push({label:O("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(x,{SVDetail:[null==H||null===(e=H.SVDetail)||void 0===e?void 0:e[0]]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(x,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},O("SV_APPLICATION_DETAILS")),J&&J.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>L(!R),displayOptions:R,options:J})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:O("SV_APPLICATION_NUMBER"),text:null==K?void 0:K.applicationNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},O("SV_VENDOR_PERSONAL_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:O("SV_VENDOR_NAME"),text:(null==K||null===(e=K.vendorDetail)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.name)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_FATHER_NAME"),text:(null==K||null===(r=K.vendorDetail)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.fatherName)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_REGISTERED_MOB_NUMBER"),text:(null==K||null===(c=K.vendorDetail)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.mobileNo)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_DATE_OF_BIRTH"),text:(null==K||null===(m=K.vendorDetail)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.dob)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_EMAIL"),text:(null==K||null===(f=K.vendorDetail)||void 0===f||null===(E=f[0])||void 0===E?void 0:E.emailId)||O("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},O("SV_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:O("SV_HOUSE_NO"),text:(null==K||null===(g=K.addressDetails)||void 0===g||null===(S=g[0])||void 0===S?void 0:S.houseNo)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_ADDRESS_LINE1"),text:(null==K||null===(h=K.addressDetails)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.addressLine1)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_ADDRESS_LINE2"),text:(null==K||null===(_=K.addressDetails)||void 0===_||null===(b=_[0])||void 0===b?void 0:b.addressLine2)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_ADDRESS_PINCODE"),text:(null==K||null===(D=K.addressDetails)||void 0===D||null===(A=D[0])||void 0===A?void 0:A.pincode)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_CITY"),text:(null==K||null===(C=K.addressDetails)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.city)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_LOCALITY"),text:(null==K||null===(T=K.addressDetails)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.locality)||O("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},O("SV_VENDOR_BUSINESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:O("SV_VENDING_ZONES"),text:(null==K?void 0:K.vendingZone)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_VENDING_TYPE"),text:(null==K?void 0:K.vendingActivity)||O("CS_NA")}),"STATIONARY"===(null==K?void 0:K.vendingActivity)&&l.createElement(t.Row,{className:"border-none",label:O("SV_AREA_REQUIRED"),text:(null==K?void 0:K.vendingArea)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_LOCAL_AUTHORITY_NAME"),text:(null==K?void 0:K.localAuthorityName)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_BENEFICIARY_SCHEMES"),text:(null==K?void 0:K.benificiaryOfSocialSchemes)||O("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:O("SV_CATEGORY"),text:(null==K?void 0:K.disabilityStatus)||O("CS_NA")})),l.createElement(xl,{application:G,id:null==G?void 0:G.applicationNo,userType:"citizen"}),k&&l.createElement(t.Toast,{error:k.key,label:O(k.label),style:{bottom:"0px"},onClose:()=>{B(null)}})),P&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:M,setShowToast:B,data:H})))},Caption:wl,ViewTimeline:xl,SVSpecialCategory:e=>{var i,o,a,u,s,c,v;let{t:m,config:f,onSelect:E,userType:g,formData:h,editdata:y,previousData:_}=e;const b=Digit.UserService.getUser().info,D=e=>e?{i18nKey:e,code:e,value:e}:null,[A,C]=n.useState((null==h||null===(i=h.specialCategoryData)||void 0===i?void 0:i.ownerCategory)||D((null==_?void 0:_.disabilityStatus)||(null==y?void 0:y.disabilityStatus))||""),[N,T]=n.useState((null==h||null===(o=h.specialCategoryData)||void 0===o?void 0:o.enrollmentId)||(null==_?void 0:_.enrollmentId)||(null==y?void 0:y.enrollmentId)||""),[I,O]=n.useState((null==h||null===(a=h.specialCategoryData)||void 0===a?void 0:a.beneficiary)||D((null==_?void 0:_.benificiaryOfSocialSchemes)||(null==y?void 0:y.benificiaryOfSocialSchemes))||""),w={width:"EMPLOYEE"===b.type?"50%":"100%"},[x,R]=n.useState(null),L=null==_||null===(u=_.documentDetails)||void 0===u?void 0:u.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==A?void 0:A.code)}),P=null==y||null===(s=y.documentDetails)||void 0===s?void 0:s.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==A?void 0:A.code)}),[M,k]=n.useState((null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId)||(null==h||null===(c=h.specialCategoryData)||void 0===c?void 0:c.uploadedFile)||null),[B,F]=n.useState(!1);((null==_||null===(v=_.draftId)||void 0===v?void 0:v.length)>0||null!=y&&y.applicationNo)&&sessionStorage.setItem("CategoryDocument",JSON.stringify([{documentType:(null==_?void 0:_.disabilityStatus)||(null==y?void 0:y.disabilityStatus),documentUid:(null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId),fileStoreId:(null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId)}]));const[V,U]=n.useState(null),{control:H}=r.useForm(),{data:W}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"PropertyTax",[{name:"OwnerType"}],{select:e=>{var t;return null==e||null===(t=e.PropertyTax)||void 0===t?void 0:t.OwnerType}});let j=[];W&&W.map(e=>{j.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:z}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"StreetVending",[{name:"Schemes"}],{select:e=>{var t;return null==e||null===(t=e.StreetVending)||void 0===t?void 0:t.Schemes}});let K=[];z&&z.map(e=>{K.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),n.useEffect(()=>{x&&(x.size>=5242880?setError(m("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")):(k(null),F(!0),Digit.UploadServices.Filestorage("StreetVending",x,Digit.ULBService.getStateId()).then(e=>{var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){const t=[{documentType:null==A?void 0:A.code,documentUid:e.data.files[0].fileStoreId,fileStoreId:e.data.files[0].fileStoreId}];k(e.data.files[0].fileStoreId),sessionStorage.setItem("CategoryDocument",JSON.stringify(t))}else setError(m("CS_FILE_UPLOAD_ERROR"))}).catch(()=>setError(m("CS_FILE_UPLOAD_ERROR"))).finally(()=>{F(!1)})))},[x,m]);const G=()=>{let e=d({},h.specialCategoryData,{ownerCategory:A,beneficiary:I,uploadedFile:M,enrollmentId:N});E(f.key,e,!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,y,b,D,C,T,O,w,x,R,L,P,M,k,B,F,V,U,H,W,j,z,K,G,Y,q,Z,$,X,J;let Q=[],ee=Digit.ULBService.getCitizenCurrentTenant(!0);const te=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y,_,b,D;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.vendorDateOfBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:null==e||null===(d=e.owner)||void 0===d||null===(u=d.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.email,fatherName:null==e||null===(c=e.owner)||void 0===c||null===(v=c.units)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.fatherName,gender:null==e||null===(p=e.owner)||void 0===p||null===(f=p.units)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(S=e.owner)||void 0===S||null===(h=S.units)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(_=e.owner)||void 0===_||null===(b=_.units)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.vendorName,relationshipType:"VENDOR",vendorId:null}},ne=e=>{var t,n,l,i,o,a,r,d,u,s,c;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.spouseDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[1])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[1])||void 0===c?void 0:c.spouseName,relationshipType:"SPOUSE",vendorId:null}},le=e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f;return{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dob:null==e||null===(t=e.owner)||void 0===t||null===(n=t.units)||void 0===n||null===(l=n[2])||void 0===l?void 0:l.dependentDateBirth,userCategory:null==e||null===(i=e.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[2])||void 0===a||null===(r=a.userCategory)||void 0===r?void 0:r.code,emailId:"",isInvolved:null==e||null===(d=e.owner)||void 0===d?void 0:d.dependentNameChecked,fatherName:"",gender:null==e||null===(u=e.owner)||void 0===u||null===(s=u.units)||void 0===s||null===(c=s[2])||void 0===c||null===(v=c.dependentGender)||void 0===v?void 0:v.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(m=e.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},ie=e=>!e||""===e.trim();if(!ie(null==h||null===(e=h.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var oe,ae,re,de,ue,se;const e=null==h||null===(oe=h.owner)||void 0===oe||null===(ae=oe.units)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.spouseName,t=null==h||null===(de=h.owner)||void 0===de||null===(ue=de.units)||void 0===ue||null===(se=ue[0])||void 0===se?void 0:se.dependentName;ie(e)&&ie(t)?Q=[te(h)]:!ie(e)&&ie(t)?Q=[te(h),ne(h)]:ie(e)||ie(t)||(Q=[te(h),ne(h),le(h)])}const ce=(null==h||null===(l=h.businessDetails)||void 0===l?void 0:l.daysOfOperation).filter(e=>e.isSelected).map(e=>({applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},dayOfWeek:e.name.toUpperCase(),fromTime:e.startTime,toTime:e.endTime,id:""})),ve=sessionStorage.getItem("Response"),me=JSON.parse(ve);let pe={addressDetails:[{addressId:"",addressLine1:null==h||null===(i=h.address)||void 0===i?void 0:i.addressline1,addressLine2:null==h||null===(o=h.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==h||null===(a=h.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==h||null===(d=h.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==h||null===(s=h.address)||void 0===s?void 0:s.houseNo,landmark:null==h||null===(c=h.address)||void 0===c?void 0:c.landmark,locality:null==h||null===(v=h.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.i18nKey,localityCode:null==h||null===(p=h.address)||void 0===p||null===(f=p.locality)||void 0===f?void 0:f.code,pincode:null==h||null===(E=h.address)||void 0===E?void 0:E.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==h||null===(g=h.correspondenceAddress)||void 0===g?void 0:g.caddressline1,addressLine2:null==h||null===(y=h.correspondenceAddress)||void 0===y?void 0:y.caddressline2,addressType:"",city:null==h||null===(b=h.correspondenceAddress)||void 0===b||null===(D=b.ccity)||void 0===D?void 0:D.name,cityCode:null==h||null===(C=h.correspondenceAddress)||void 0===C||null===(T=C.ccity)||void 0===T?void 0:T.code,doorNo:"",houseNo:null==h||null===(O=h.correspondenceAddress)||void 0===O?void 0:O.chouseNo,landmark:null==h||null===(w=h.correspondenceAddress)||void 0===w?void 0:w.clandmark,locality:null==h||null===(x=h.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.i18nKey,localityCode:null==h||null===(L=h.correspondenceAddress)||void 0===L||null===(P=L.clocality)||void 0===P?void 0:P.code,pincode:null==h||null===(M=h.correspondenceAddress)||void 0===M?void 0:M.cpincode,streetName:"",vendorId:"",isAddressSame:null==h||null===(k=h.correspondenceAddress)||void 0===k?void 0:k.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==h||null===(B=h.bankDetails)||void 0===B?void 0:B.accountHolderName,accountNumber:null==h||null===(F=h.bankDetails)||void 0===F?void 0:F.accountNumber,applicationId:"",bankBranchName:null==h||null===(V=h.bankDetails)||void 0===V?void 0:V.bankBranchName,bankName:null==h||null===(U=h.bankDetails)||void 0===U?void 0:U.bankName,id:"",ifscCode:null==h||null===(H=h.bankDetails)||void 0===H?void 0:H.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==I?void 0:I.value,enrollmentId:N,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==A?void 0:A.code,draftId:(null==_?void 0:_.draftId)||(null==me||null===(W=me.SVDetail)||void 0===W?void 0:W.draftId),documentDetails:S(null==h||null===(j=h.documents)||void 0===j?void 0:j.documents),localAuthorityName:null==h||null===(z=h.businessDetails)||void 0===z?void 0:z.nameOfAuthority,tenantId:ee,termsAndCondition:"Y",tradeLicenseNo:null==h||null===(K=h.owner)||void 0===K||null===(G=K.units)||void 0===G||null===(Y=G[0])||void 0===Y?void 0:Y.tradeNumber,vendingActivity:null==h||null===(q=h.businessDetails)||void 0===q||null===(Z=q.vendingType)||void 0===Z?void 0:Z.code,vendingArea:(null==h||null===($=h.businessDetails)||void 0===$?void 0:$.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:ce,vendingZone:null==h||null===(X=h.businessDetails)||void 0===X||null===(J=X.vendingZones)||void 0===J?void 0:J.code,vendorDetail:[...Q],workflow:{action:"APPLY",comments:"",businessService:"street-vending",moduleName:"sv-services",businessService:"street-vending",moduleName:"sv-services",varificationDocuments:[{additionalDetails:{},auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentType:"",documentUid:"",fileStoreId:"",id:""}]}};Digit.SVService.create({streetVendingDetail:pe,draftApplication:!0},ee).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()};n.useEffect(()=>{if(V){const e=setTimeout(()=>{U(null)},2e3);return()=>clearTimeout(e)}},[V]),n.useEffect(()=>{"citizen"===g&&G()},[A,I]);const Y=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement(l.Fragment,null,l.createElement(p,{currentStep:6}),l.createElement("div",null,l.createElement(t.FormStep,{config:f,onSelect:G,onSkip:()=>E(),t:m,isDisabled:!A},l.createElement("div",null,l.createElement(t.CardLabel,null,""+m("SV_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:H,name:"ownerCategory",defaultValue:A,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:A,select:C,option:j,style:w,optionKey:"i18nKey",t:m,placeholder:"Select"})}),A&&"NONE"!==(null==A?void 0:A.code)&&l.createElement("div",{className:"field",style:{marginRight:"EMPLOYEE"===(null==b?void 0:b.type)?"50%":null,marginBottom:"10px"}},l.createElement(t.UploadFile,{onUpload:e=>{R(e.target.files[0])},onDelete:()=>{k(null)},id:"SV",message:B?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(Y,null),l.createElement("span",null,"Uploading...")):M?"1 File Uploaded":"No File Uploaded",accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!M})),l.createElement(t.CardLabel,null,""+m("SV_BENEFICIARY_SCHEMES")),l.createElement(r.Controller,{control:H,name:"beneficiary",defaultValue:I,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:I,select:O,style:w,optionCardStyles:{overflowY:"auto",maxHeight:"315px"},option:K,optionKey:"i18nKey",t:m,placeholder:"Select"})}),I&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+m("SV_ENROLLMENT_APPLICATION_NUMBER")),l.createElement(t.TextInput,d({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"enrollmentId",value:N,onChange:function(e){T(e.target.value)},style:w,ValidationRequired:!1},{isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]*$",type:"text",title:m("SV_INPUT_DID_NOT_MATCH")}))))),V&&l.createElement(t.Toast,{error:V.error,warning:V.warning,label:m(V.label),onClose:()=>{U(null)}})))}},Gl=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:d}=o.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"SV",language:u}),Object.entries(Kl).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("SV_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(V,{path:r,url:d,userType:i}):l.createElement(v,null)},Yl=e=>{let{matchPath:o}=e;const{t:a}=i.useTranslation(),[r,d,u]=Digit.Hooks.useSessionStorage("SV",{});n.useEffect(()=>{u()},[]);const s=[{link:o+"/sv/apply",i18nKey:a("sv_APPLY")},{link:o+"/sv/my-applications",i18nKey:a("sv_MY_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:a("STREET_VENDING_SERVICES"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.SVComponents={SVModule:Gl,SVLinks:Yl,SVCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("0"),{data:r,isLoading:d,isFetching:u,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"SV",filters:{limit:10,offset:0,services:["street-vending"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.svAccess()}});if(n.useEffect(()=>{!u&&s&&a(r)},[u]),!Digit.Utils.svAccess())return null;const c=[{count:d?"-":null==o?void 0:o.totalCount,label:e("SV_INBOX"),link:"/digit-ui/employee/sv/inbox"},{label:e("SV_CREATE_APPLICATION"),link:"/digit-ui/employee/sv/apply"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/sv/my-applications"}],v=Digit.UserService.hasAccess(["SV_VENDOR"])||!1,m={Icon:l.createElement(t.PropertyHouse,null),moduleName:l.createElement("div",{style:{width:"200px",wordWrap:"break-word"}},e("MODULE_SV")),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/sv/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||v)};return l.createElement(t.EmployeeModuleCard,m)},SV_INBOX_FILTER:e=>l.createElement(q,e),SVInboxTableConfig:e=>({SV:{inboxColumns:t=>[{Header:e("SV_APPLICATION_NUMBER"),Cell:e=>{var n,i,a,r;let{row:d}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/application-details/"+(null==d||null===(n=d.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.applicationNo)},null===(a=d.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.applicationNo)))},mobileCell:e=>{var t;return H(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationNumber)}},{Header:e("SV_VENDOR_NAME"),Cell:e=>{var t,n,l,i,o;return U(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i||null===(o=i.vendorDetail[0])||void 0===o?void 0:o.name))},mobileCell:e=>{var t,n;return H(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.vendorDetail[0])||void 0===n?void 0:n.name)}},{Header:e("SV_VENDING_TYPE"),Cell:e=>{var t,n,l,i;return U(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.vendingActivity))},mobileCell:e=>{var t;return H(null==e||null===(t=e.searchData)||void 0===t?void 0:t.vendingActivity)}},{Header:e("SV_VENDING_ZONES"),Cell:e=>{var t,n,l,i;return U(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.vendingZone))},mobileCell:e=>{var t;return H(null==e||null===(t=e.searchData)||void 0===t?void 0:t.vendingZone)}},{Header:e("SV_APPLICATION_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return U(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return H(e("ES_SV_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("SV_INBOX_UNIQUE_APPLICATION_NUMBER")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.SVLinks=Yl,exports.SVModule=Gl;