@mseva/digit-ui-module-sv 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
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"),r=require("react-query"),a=require("react-hook-form");function u(){return(u=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 d(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,r,a,u;const s=o.useRouteMatch(),{path:v}=s,p=(d(s,c),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("Create")),m=null===(i=Digit)||void 0===i||null===(r=i.ComponentRegistryService)||void 0===r?void 0:r.getComponent("SVMyApplications"),f=null===(a=Digit)||void 0===a||null===(u=a.ComponentRegistryService)||void 0===u?void 0:u.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:p}),l.createElement(t.PrivateRoute,{path:v+"/edit",component:p}),l.createElement(t.PrivateRoute,{path:v+"/my-applications",component:m}),l.createElement(t.PrivateRoute,{path:v+"/application/:applicationNo/:tenantId",component:f}))))};let p=["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 m=e=>{let{currentStep:n=1}=e;const{t:o}=i.useTranslation(),r=Digit.UserService.getUser().info,a=window.Digit.Utils.browser.isMobile();return l.createElement("div",{className:"timeline-container",style:a?{}:"EMPLOYEE"===(null==r?void 0:r.type)?{maxWidth:"960px",minWidth:"640px",marginRight:"auto",marginLeft:"auto",display:"flex",justifyContent:"center"}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto",display:"flex",justifyContent:"center"}},p.map((e,i,r)=>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<r.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},h=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,r,a;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===(r=o.split("."))||void 0===r||null===(a=r.slice(0,2))||void 0===a?void 0:a.join("_"))})===n);null==t||t.map(t=>{var l,i,o,r;const a=null==e?void 0:e.filter(e=>{var n,l,i,o,r,a;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===(r=o.split("."))||void 0===r||null===(a=r.slice(0,2))||void 0===a?void 0:a.join("_"))});null==a||a.forEach(e=>e.title=e.documentType),n.push({title:null==a||null===(l=a[0])||void 0===l||null===(i=l.documentType)||void 0===i||null===(o=i.split("."))||void 0===o||null===(r=o.slice(0,2))||void 0===r?void 0:r.join("_"),values:a})})}return n},E=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,r;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===(r=n[0])||void 0===r?void 0:r.documentUid)||"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}}),l};function y(e){let{documents:t,isSendBackFlow:n=!1,isHrLine:o=!1}=e;const{t:r}=i.useTranslation(),a=()=>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 u;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===(u=e.values)||void 0===u?void 0:u.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"}},r(null==e?void 0:e.title)),l.createElement(a,null)," "),n?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},r(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},r(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,r("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 S=e=>{var i;let{t:o,onSelect:r,formData:a={},handleRemove:u,onSave:d}=e;const[s,c]=n.useState((null==a||null===(i=a.address)||void 0===i?void 0:i.location)||{}),v=Digit.Hooks.obps.useTenants();Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let p=!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:p?{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:()=>r(),t:o,position:s,onSave:()=>d(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:u,Webview:p,isPopUp:!0}))))},b=e=>{let{t:n,currentPage:i,columns:o,data:r,getCellProps:a,disableSort:u,onSort:d,onNextPage:s,onPrevPage:c,onPageSizeChange:v,pageSizeLimit:p,sortParams:m,totalRecords:f,styles:h,isPaginationRequired:g}=e;return l.createElement(t.Table,{t:n,data:r,currentPage:i,columns:o,getCellProps:a,onNextPage:s,onPrevPage:c,pageSizeLimit:p,disableSort:u,onPageSizeChange:v,onSort:d,sortParams:m,totalRecords:f,styles:h,isPaginationRequired:g})};function A(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function D(e){var i,o,r;let{t:a,document:d,setDocuments:s,setError:c,documents:v,id:p,editdata:m,previousData:f}=e;const h=null==v?void 0:v.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.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==d?void 0:d.code)}),E=null==m||null===(o=m.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==d?void 0:d.code)}),_=Digit.UserService.getUser().info,y=e=>e?u({},e,{active:!0===(null==d?void 0:d.active),code:null==e?void 0:e.documentType,i18nKey:null==e?void 0:e.documentType}):null,S=y(g)||y(E)||y(h)||(1===(null==d||null===(r=d.dropdownData)||void 0===r?void 0:r.length)?null==d?void 0:d.dropdownData[0]:{}),[b,A]=n.useState(S),[D,C]=n.useState(null),[T,N]=n.useState((null==S?void 0:S.fileStoreId)||null),[I,w]=n.useState(!1);n.useEffect(()=>{var e;const t=(null==f?void 0:f.documentDetails)||(null==m?void 0:m.documentDetails)||[];null==t||null===(e=t.documentDetails)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==d?void 0:d.code)&&N(e)})},[null==m?void 0:m.documentDetails,null==f?void 0:f.documentDetails,null==d?void 0:d.code]),n.useEffect(()=>{D&&(D.size>=5242880?c(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")):(N(null),w(!0),Digit.UploadServices.Filestorage("StreetVending",D,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?N(e.data.files[0].fileStoreId):c(a("CS_FILE_UPLOAD_ERROR"))}).catch(()=>c(a("CS_FILE_UPLOAD_ERROR"))).finally(()=>{w(!1)})))},[D,a]),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 T?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==b?void 0:b.code,fileStoreId:T,documentUid:T}]:t}):null!=b&&b.code&&null!=m&&m.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 T?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==b?void 0:b.code,fileStoreId:T,documentUid:T}]: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 T?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==b?void 0:b.code,fileStoreId:T,documentUid:T}]:t})},[T,b,s]);const{dropdownData:O}=d;let x=O;const R=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement("div",{style:{marginBottom:"24px"}},(null==d?void 0:d.hasDropdown)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==d?void 0:d.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{A(e)},style:{width:"EMPLOYEE"===(null==_?void 0:_.type)?"50%":"100%"},option:x.map(e=>{var t;return u({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),optionKey:"i18nKey",t:a,placeholder:"Select"})),l.createElement(t.LabelFieldPair,null,l.createElement("div",{className:"field",style:{marginLeft:"EMPLOYEE"===(null==_?void 0:_.type)?"30%":null}},l.createElement(t.UploadFile,{onUpload:e=>{C(e.target.files[0])},onDelete:()=>{N(null)},id:p,message:I?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(R,null),l.createElement("span",null,"Uploading...")):T?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!T}))))}"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 r=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(){r.push(n)}})},T={date:t.DatePicker,mobileNumber:t.MobileNumber},N=e=>{var n;let{onSearch:o,type:r,onClose:d,searchFields:s,searchParams:c,isInboxPage:v,clearSearch:p}=e;const{t:m}=i.useTranslation(),{handleSubmit:f,reset:h,watch:g,control:E,formState:_,setValue:y}=a.useForm({defaultValues:v?c:u({locality:null,city:null},c)}),S=g(),b=innerWidth<=640;function A(){const e=s.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(h(e),v){const e=u({},c);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(u({},e))}else p()}const D=e=>l.createElement(t.LinkLabel,{style:u({display:"inline",margin:"10px"},e?{margin:0}:{}),onClick:A},m("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"===r&&d()})},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"===r||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,m("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:d},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,r;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,m(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(a.Controller,e.type?{render:t=>l.createElement(null==T?void 0:T[e.type],{formValue:S,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:E,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:E,defaultValue:""})),null!=_&&null!==(i=_.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==_||null===(o=_.errors)||void 0===o||null===(r=o[e.name])||void 0===r?void 0:r.message):null)}),v&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,D())),"desktop"===r&&!b&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:m("ES_COMMON_SEARCH"),disabled:!!Object.keys(_.errors).length||(()=>{var e;let t=!0;return Object.keys(S).forEach(e=>{!["locality","city"].includes(e)&&S[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=S&&null!==(e=S.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!v&&l.createElement("div",null,D()))))),("mobile"===r||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},D(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(_.errors).length,label:m("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},I=["tableConfig","filterComponent"],w=e=>{let{tableConfig:o,filterComponent:r}=e,a=d(e,I);const{data:u,useNewInboxAPI:s}=a,{t:c}=i.useTranslation(),[v,p]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[m,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[h,g]=n.useState(!1),E=l.useMemo(()=>a.isSearch?o.searchColumns(a):o.inboxColumns(a)||[],[]);let _;return a.isLoading?_=l.createElement(t.Loader,null):h?_=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?_=m&&l.createElement(m,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[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==u?void 0:u.length)>0&&(_=l.createElement(b,{t:c,data:u,columns:E,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:a.onPageSizeChange,currentPage:a.currentPage,onNextPage:a.onNextPage,onPrevPage:a.onPrevPage,pageSizeLimit:a.pageSizeLimit,onSort:a.onSort,disableSort:a.disableSort,sortParams:a.sortParams,totalRecords:a.totalRecords})),l.createElement("div",{className:"inbox-container"},!a.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement("div",null,l.createElement(v,{defaultSearchParams:a.defaultSearchParams,onFilterChange:a.onFilterChange,searchParams:a.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(N,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),g(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>g(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},_)))},O=e=>{const{t:o}=i.useTranslation(),[r,a]=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 u(){}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:u},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},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:r,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:r,onSearch:a,onSort:u,serviceRequestIdKey:d,isFstpOperator:s,isLoading:c,isSearch:v,searchParams:p,searchFields:m,sortParams:f,linkPrefix:h,filterComponent:g}=e;const[E,_]=n.useState(v?"SEARCH":""),[y,S]=n.useState(!!v),[b,A]=n.useState(f),[D]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{E&&S(!0)},[E]);const C=()=>{S(!1),_(""),A(f)};if(c)return l.createElement(t.Loader,null);let T;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(T=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:d,linkPrefix:h||"/digit-ui/employee/sv/"})):T=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"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{_("SEARCH"),S(!0)}}),!v&&r&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{_("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{_("SORT"),S(!0)}})),T,y&&l.createElement(t.PopUp,null,"FILTER"===E&&l.createElement("div",{className:"popup-module"},l.createElement(D,{onFilterChange:e=>{r(e),S(!1)},Close:C,type:"mobile",searchParams:p})),"SORT"===E&&l.createElement("div",{className:"popup-module"},l.createElement(O,{type:"mobile",sortParams:f,onClose:C,onSort:u})),"SEARCH"===E&&l.createElement("div",{className:"popup-module"},l.createElement(N,{type:"mobile",onClose:C,onSearch:a,isFstpOperator:s,searchParams:p,searchFields:m}))))},R=e=>{let{classNameForMobileView:r=""}=e;const{t:a}=i.useTranslation(),u=[{text:a("SV_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/sv/apply"}],[d,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.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 "+r},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},a("ES_TITLE_SV_REGISTRATION"))),l.createElement("div",{className:"body"},d.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:r,onFilterChange:a,onSearch:u,onSort:d,parentRoute:s,searchParams:c,sortParams:v,linkPrefix:p,tableConfig:m,filterComponent:f}=e;const{t:h}=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:h,data:null==t?void 0:t.map(e=>{const t={};return(o?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:a,isLoading:n,isSearch:o,onSearch:u,onSort:d,searchParams:c,searchFields:r,linkPrefix:p,sortParams:v,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:f}))))},P=["isFetching","isLoading","searchResponseKey","data","searchFields"],M=e=>{var o,r,a,s,c;let{useNewInboxAPI:v,parentRoute:p,moduleCode:m="SV",initialStates:f={},filterComponent:h,isInbox:g,rawWfHandler:E,rawSearchHandler:_,combineResponse:y,wfConfig:S,searchConfig:b,middlewaresWf:A,middlewareSearch:D,EmptyResultInboxComp:C}=e;const T=Digit.ULBService.getCurrentTenantId(),{t:N}=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}]),[j,H]=n.useState(f.searchParams||{});let W=window.Digit.Utils.browser.isMobile(),z=W?{limit:100,offset:0,sortBy:null==V||null===(o=V[0])||void 0===o?void 0:o.id,sortOrder:null!=V&&null!==(r=V[0])&&void 0!==r&&r.desc?"DESC":"ASC"}:{limit:k,offset:M,sortBy:null==V||null===(a=V[0])||void 0===a?void 0:a.id,sortOrder:null!=V&&null!==(s=V[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const K=v?Digit.Hooks.useNewInboxGeneral({tenantId:T,ModuleCode:m,filters:u({},j,z,{sortParams:V})}):Digit.Hooks.useInboxGeneral({tenantId:T,businessService:m,isInbox:g,filters:u({},j,z,{sortParams:V}),rawWfHandler:E,rawSearchHandler:_,combineResponse:y,wfConfig:S,searchConfig:u({},I,b),middlewaresWf:A,middlewareSearch:D}),{isLoading:G,data:Y,searchFields:q}=K,Z=d(K,P);n.useEffect(()=>{B(0)},[j]);const $=e=>{let t=e.delete,n=u({},j,e);t&&t.forEach(e=>delete n[e]),delete e.delete,H(u({},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 W?l.createElement(L,{data:Y,isLoading:G,isSearch:!g,searchFields:q,onFilterChange:$,onSearch:$,onSort:X,parentRoute:p,searchParams:j,sortParams:V,linkPrefix:p+"/application-details/",tableConfig:null!=Z&&Z.tableConfig?null==Z?void 0:Z.tableConfig:x(N).SV,filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:v}):l.createElement("div",null,g&&l.createElement(t.Header,null,N("ES_COMMON_INBOX")),l.createElement(w,{moduleCode:m,data:Y,tableConfig:x(N).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:p,searchParams:j,sortParams:V,totalRecords:Number(null==Y||null===(J=Y[0])||void 0===J?void 0:J.totalCount),filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:v}))},B=e=>{var i,r;let{isLoading:u,t:d,onSubmit:s,data:c,count:v,setShowToast:p}=e;const m=window.Digit.Utils.browser.isMobile(),f=(new Date).toISOString().split("T")[0],{register:h,control:g,handleSubmit:E,setValue:_,getValues:y,reset:S,formState:b}=a.useForm({defaultValues:{offset:0,limit:!m&&10,sortBy:"commencementDate",sortOrder:"DESC",isDraftApplication:"false",fromDate:f,toDate:f}});n.useEffect(()=>{h("offset",0),h("limit",10),h("sortBy","commencementDate"),h("sortOrder","DESC"),h("isDraftApplication","false"),_("fromDate",f),_("toDate",f)},[h,_,f]);const{data:A}=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 D=[];A&&A.map(e=>{D.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 T=[];C&&C.map(e=>{T.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Digit.ULBService.getStateId();const N=e=>l.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:d("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:d("SV_VENDOR_NAME"),Cell:e=>{var t,n,l;return N(""+(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:d("SV_VENDING_TYPE"),Cell:e=>{var t,n;return N(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.vendingActivity))},disableSortBy:!0},{Header:d("SV_VENDING_ZONES"),Cell:e=>{var t,n;return N(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.vendingZone))},disableSortBy:!0},{Header:d("SV_REGISTERED_MOB_NUMBER"),Cell:e=>{var t,n;let{row:l}=e;return N(""+(null==l||null===(t=l.original)||void 0===t||null===(n=t.vendorDetail[0])||void 0===n?void 0:n.mobileNo))},disableSortBy:!0},{Header:d("SV_APPLICATION_STATUS"),Cell:e=>{var t;let{row:n}=e;return N(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.applicationStatus))},disableSortBy:!0}],[]),w=n.useCallback(e=>{0!==e.length&&(_("sortBy",e.id),_("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){_("offset",y("offset")-y("limit")),E(s)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,d("SV_SEARCH_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},d("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:s,handleSubmit:E},l.createElement(t.SearchField,null,l.createElement("label",null,d("SV_APPLICATION_NUMBER")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:h({})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("SV_VENDING_TYPE")),l.createElement(a.Controller,{control:g,name:"vendingType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:D,optionKey:"i18nKey",t:d,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("SV_VENDING_ZONES")),l.createElement(a.Controller,{control:g,name:"vendingZone",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:T,optionKey:"i18nKey",t:d,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("SV_REGISTERED_MOB_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:h({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("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===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,null,l.createElement("label",null,d("SV_FROM_DATE")),l.createElement(a.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,d("SV_TO_DATE")),l.createElement(a.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:d("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{S({applicationNumber:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),p(null),O()}},d("ES_COMMON_CLEAR_ALL")))),!u&&null!=c&&c.display?l.createElement(t.Card,{style:{marginTop:20}},d(c.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):u||""===c?""!==c||u&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:d,data:c,totalRecords:v,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===d("SV_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){_("limit",Number(e.target.value)),E(s)()},currentPage:y("offset")/y("limit"),onNextPage:function(){_("offset",y("offset")+y("limit")),E(s)()},onPrevPage:O,pageSizeLimit:y("limit"),onSort:w,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},k=e=>{o.useParams();const{t:r}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[d,s]=n.useState({}),[c,v]=n.useState(null),p={enabled:!!(d&&Object.keys(d).length>0)},{isLoading:m,isSuccess:f,data:{SVDetail:h,count:g}={}}=Digit.Hooks.sv.useSvSearchApplication({tenantId:a,filters:d},p);return l.createElement(l.Fragment,null,l.createElement(B,{t:r,isLoading:m,tenantId:a,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=u({},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)=>u({},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&&!m?h.length>0?h:{display:"ES_COMMON_NO_DATA"}:"",count:g}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:r(c.label),isDleteBtn:!0,onClose:()=>{v(null)}}))},F=["path","url"],V=()=>{var e,n,r,a;const s=o.useRouteMatch(),{path:c}=s,v=(d(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}}),p=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("SVEmpCreate"),m=null===(r=Digit)||void 0===r||null===(a=r.ComponentRegistryService)||void 0===a?void 0:a.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:p}),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(m,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/applicationsearch/application-details/:id",component:()=>l.createElement(m,{parentRoute:c})}),l.createElement(t.PrivateRoute,{path:c+"/my-applications",component:e=>l.createElement(k,u({},e,{parentRoute:c}))}))))},U=e=>l.createElement("span",{className:"cell-text"},e),j=e=>l.createElement("span",{className:"sla-cell"},e),H=e=>{var n;let{status:o,searchParams:r,onAssignmentChange:a,statusMap:d}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>a(u({},e,{state:o.state}),o),checked:null==r?void 0:r.applicationStatus.some(e=>e.uuid===o.uuid),label:o.name+" ("+((null==d||null===(n=d.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-")+")"})},W=e=>{var o,r,a,d,s;let{onAssignmentChange:c,searchParams:v,businessServices:p,statusMap:m}=e;const{t:f}=i.useTranslation(),[h,g]=n.useState(!1),{data:E,isLoading:_}=Digit.Hooks.useApplicationStatusGeneral({businessServices:p},{}),{userRoleStates:y}=E||{},S=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_SV_COMMON_STATUS_"+(e.state||"CREATED"));return _?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===(r=o.slice(0,4))||void 0===r?void 0:r.map((e,t)=>l.createElement(H,{businessServices:p,key:t,onAssignmentChange:c,status:u({name:S(e,f),code:e.applicationStatus},e),searchParams:v,statusMap:m})),(null==y||null===(a=y.filter(e=>!e.isTerminateState))||void 0===a?void 0:a.slice(4).length)>0?l.createElement(l.Fragment,null,h&&(null==y||null===(d=y.filter(e=>!e.isTerminateState))||void 0===d||null===(s=d.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement(H,{businessServices:p,key:e.uuid,onAssignmentChange:c,status:u({name:S(e,f),code:e.applicationStatus},e),searchParams:v,statusMap:m}))),l.createElement("div",{className:"filter-button",onClick:()=>g(!h)}," ",f(h?"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]",r="[object Array]",a="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",f="[object RegExp]",h="[object Set]",g="[object String]",E="[object Symbol]",_="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",b="[object Float32Array]",A="[object Float64Array]",D="[object Int8Array]",C="[object Int16Array]",T="[object Int32Array]",N="[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)\]/,j=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,K=RegExp(W.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,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",pe="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+he+")",Ae="(?:"+Se+"|"+he+")",De="(?:"+pe+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[Ee,_e,ye].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",_e,ye].join("|")+")"+Ce,Ne="(?:"+[Ee+pe+"?",pe,_e,ye,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),we=RegExp(pe,"g"),Oe=RegExp(ge+"(?="+ge+")|"+Ne+Ce,"g"),xe=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Te].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[A]=Be[D]=Be[C]=Be[T]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[I]=Be[w]=!0,Be[o]=Be[r]=Be[y]=Be[a]=Be[S]=Be[u]=Be[d]=Be[s]=Be[v]=Be[p]=Be[m]=Be[f]=Be[h]=Be[g]=Be[_]=!1;var ke={};ke[o]=ke[r]=ke[y]=ke[S]=ke[a]=ke[u]=ke[b]=ke[A]=ke[D]=ke[C]=ke[T]=ke[v]=ke[p]=ke[m]=ke[f]=ke[h]=ke[g]=ke[E]=ke[N]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[w]=!0,ke[d]=ke[s]=ke[_]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Ue=parseInt,je="object"==typeof z&&z&&z.Object===Object&&z,He="object"==typeof self&&self&&self.Object===Object&&self,We=je||He||Function("return this")(),ze=t&&!t.nodeType&&t,Ke=ze&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===ze,Ye=Ge&&je.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 r=e[i];t(l,r,n(r),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 rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function pt(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 mt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(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):ht(e,_t,n)}function Et(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function _t(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Dt(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 Tt(e){return e?e.slice(0,zt(e)+1).replace(G,""):e}function Nt(e){return function(t){return e(t)}}function It(e,t){return dt(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,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Ht(e){return Bt(e)?function(e){for(var t=Oe.lastIndex=0;Oe.test(e);)++t;return t}(e):mt(e)}function Wt(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?We:Gt.defaults(We.Object(),t,Gt.pick(We,Pe))).Array,se=t.Date,ce=t.Error,ve=t.Function,pe=t.Math,me=t.Object,fe=t.RegExp,he=t.String,ge=t.TypeError,Ee=Y.prototype,_e=me.prototype,ye=t["__core-js_shared__"],Se=ve.prototype.toString,be=_e.hasOwnProperty,Ae=0,De=(z=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Ce=_e.toString,Te=Se.call(me),Ne=We._,Oe=fe("^"+Se.call(be).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ge?t.Buffer:void 0,Fe=t.Symbol,je=t.Uint8Array,He=Re?Re.allocUnsafe:void 0,ze=Ft(me.getPrototypeOf,me),Ke=me.create,Ye=_e.propertyIsEnumerable,qe=Ee.splice,mt=Fe?Fe.isConcatSpreadable:void 0,bt=Fe?Fe.iterator:void 0,Yt=Fe?Fe.toStringTag:void 0,qt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Zt=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,$t=se&&se.now!==We.Date.now&&se.now,Xt=t.setTimeout!==We.setTimeout&&t.setTimeout,Jt=pe.ceil,Qt=pe.floor,en=me.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=Ee.join,on=Ft(me.keys,me),rn=pe.max,an=pe.min,un=se.now,dn=t.parseInt,sn=pe.random,cn=Ee.reverse,vn=Ji(t,"DataView"),pn=Ji(t,"Map"),mn=Ji(t,"Promise"),fn=Ji(t,"Set"),hn=Ji(t,"WeakMap"),gn=Ji(me,"create"),En=hn&&new hn,_n={},yn=Io(vn),Sn=Io(pn),bn=Io(mn),An=Io(fn),Dn=Io(hn),Cn=Fe?Fe.prototype:void 0,Tn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function In(e){if(Kr(e)&&!Pr(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(!zr(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=Pr(e),l=!n&&Lr(e),i=!n&&!l&&Fr(e),o=!n&&!l&&!i&&Qr(e),r=n||l||i||o,a=r?Ct(e.length,he):[],u=a.length;for(var d in e)!t&&!be.call(e,d)||r&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||oo(d,u))||a.push(d);return a}function Vn(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function Un(e,t){return Ao(hi(e),Zn(t,0,e.length))}function jn(e){return Ao(hi(e))}function Hn(e,t,n){(void 0!==n&&!Or(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function Wn(e,t,n){var l=e[t];be.call(e,t)&&Or(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Or(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,Sa(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:ha(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,r){var d,_=1&t,O=2&t,x=4&t;if(n&&(d=i?n(e,l,i,r):n(e)),void 0!==d)return d;if(!zr(e))return e;var R=Pr(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!_)return hi(e,d)}else{var L=to(e),P=L==s||L==c;if(Fr(e))return si(e,_);if(L==m||L==o||P&&!i){if(d=O||P?{}:lo(e),!_)return O?function(e,t){return gi(e,eo(e),t)}(e,function(e,t){return e&&gi(t,ba(t),e)}(d,e)):function(e,t){return gi(e,Qi(e),t)}(e,Gn(d,e))}else{if(!ke[L])return i?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case y:return ci(e);case a:case u:return new l(+e);case S: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 A:case D:case C:case T:case N:case"[object Uint8ClampedArray]":case I:case w:return vi(e,n);case v:return new l;case p: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 h:return new l;case E:return Tn?me(Tn.call(e)):{}}}(e,L,_)}}r||(r=new kn);var M=r.get(e);if(M)return M;r.set(e,d),$r(e)?e.forEach(function(l){d.add($n(l,t,n,l,e,r))}):Gr(e)&&e.forEach(function(l,i){d.set(i,$n(l,t,n,i,e,r))});var B=R?void 0:(x?O?Ki:zi:O?ba:Sa)(e);return lt(B||e,function(l,i){B&&(l=e[i=l]),Wn(d,i,$n(l,t,n,i,e,r))}),d}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new ge(n);return _o(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],d=t.length;if(!a)return u;n&&(t=dt(t,Nt(n))),l?(o=ut,r=!1):t.length>=200&&(o=wt,r=!1,t=new Bn(t));e:for(;++i<a;){var s=e[i],c=null==n?s:n(s);if(s=l||0!==s?s:0,r&&c==c){for(var v=d;v--;)if(t[v]===c)continue e;u.push(s)}else o(t,c,l)||u.push(s)}return u}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(pn||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(!pn||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(ul),tl=yi(dl,!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],r=t(o);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,u=o}return u}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,r=e.length;for(n||(n=io),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?ol(a,t-1,n,l,i):st(i,a):l||(i[i.length]=a)}return i}var rl=Si(),al=Si(!0);function ul(e,t){return e&&rl(e,t,Sa)}function dl(e,t){return e&&al(e,t,Sa)}function sl(e,t){return rt(t,function(t){return jr(e[t])})}function cl(e,t){for(var n=0,l=(t=ri(t,e)).length;null!=e&&n<l;)e=e[No(t[n++])];return n&&n==l?e:void 0}function vl(e,t,n){var l=t(e);return Pr(e)?l:st(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Yt&&Yt in me(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 ml(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function hl(e,t){return null!=e&&t in me(e)}function gl(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=Y(o),u=Infinity,d=[];r--;){var s=e[r];r&&t&&(s=dt(s,Nt(t))),u=an(s.length,u),a[r]=!n&&(t||i>=120&&s.length>=120)?new Bn(r&&s):void 0}s=e[0];var c=-1,v=a[0];e:for(;++c<i&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?wt(v,m):l(d,m,n))){for(r=o;--r;){var f=a[r];if(!(f?wt(f,m):l(e[r],m,n)))continue e}v&&v.push(m),d.push(p)}}return d}function El(e,t,n){var l=null==(e=fo(e,t=ri(t,e)))?e:e[No(Uo(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return Kr(e)&&pl(e)==o}function yl(e,t,n,l,i){return e===t||(null==e||null==t||!Kr(e)&&!Kr(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var c=Pr(e),_=Pr(t),b=c?r:to(e),A=_?r:to(t),D=(b=b==o?m:b)==m,C=(A=A==o?m:A)==m,T=b==A;if(T&&Fr(e)){if(!Fr(t))return!1;c=!0,D=!1}if(T&&!D)return s||(s=new kn),c||Qr(e)?Hi(e,t,n,l,i,s):function(e,t,n,l,i,o,r){switch(n){case S: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 je(e),new je(t)));case a:case u:case p:return Or(+e,+t);case d:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v:var s=kt;case h:if(s||(s=Ut),e.size!=t.size&&!(1&l))return!1;var c=r.get(e);if(c)return c==t;l|=2,r.set(e,t);var m=Hi(s(e),s(t),l,i,o,r);return r.delete(e),m;case E:if(Tn)return Tn.call(e)==Tn.call(t)}return!1}(e,t,b,n,l,i,s);if(!(1&n)){var N=D&&be.call(e,"__wrapped__"),I=C&&be.call(t,"__wrapped__");if(N||I){var w=N?e.value():e,O=I?t.value():t;return s||(s=new kn),i(w,O,n,l,s)}}return!!T&&(s||(s=new kn),function(e,t,n,l,i,o){var r=1&n,a=zi(e),u=a.length;if(u!=zi(t).length&&!r)return!1;for(var d=u;d--;){var s=a[d];if(!(r?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 p=!0;o.set(e,t),o.set(t,e);for(var m=r;++d<u;){var f=e[s=a[d]],h=t[s];if(l)var g=r?l(h,f,s,t,e,o):l(f,h,s,e,t,o);if(!(void 0===g?f===h||i(f,h,n,l,o):g)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var E=e.constructor,_=t.constructor;E==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,l,i,s))}(e,t,n,l,yl,i))}function Sl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=me(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],d=e[u],s=a[1];if(r&&a[2]){if(void 0===d&&!(u in e))return!1}else{var c=new kn;if(l)var v=l(d,s,u,e,t,c);if(!(void 0===v?yl(s,d,3,l,c):v))return!1}}return!0}function bl(e){return!(!zr(e)||(t=e,De&&De in t))&&(jr(e)?Oe:ie).test(Io(e));var t}function Al(e){return"function"==typeof e?e:null==e?Ya:"object"==typeof e?Pr(e)?Il(e[0],e[1]):Nl(e):nu(e)}function Dl(e){if(!co(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Tl(e,t){var n=-1,l=Br(e)?Y(e.length):[];return el(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(e){var t=Xi(e);return 1==t.length&&t[0][2]?po(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Il(e,t){return ao(e)&&vo(t)?po(No(e),t):function(n){var l=ha(n,e);return void 0===l&&l===t?ga(n,e):yl(t,l,3)}}function wl(e,t,n,l,i){e!==t&&rl(t,function(o,r){if(i||(i=new kn),zr(o))!function(e,t,n,l,i,o,r){var a=go(e,n),u=go(t,n),d=r.get(u);if(d)Hn(e,n,d);else{var s=o?o(a,u,n+"",e,t,r):void 0,c=void 0===s;if(c){var v=Pr(u),p=!v&&Fr(u),m=!v&&!p&&Qr(u);s=u,v||p||m?Pr(a)?s=a:kr(a)?s=hi(a):p?(c=!1,s=si(u,!0)):m?(c=!1,s=vi(u,!0)):s=[]:qr(u)||Lr(u)?(s=a,Lr(a)?s=aa(a):zr(a)&&!jr(a)||(s=lo(u))):c=!1}c&&(r.set(u,s),i(s,u,l,o,r),r.delete(u)),Hn(e,n,s)}}(e,t,r,n,wl,l,i);else{var a=l?l(go(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),Hn(e,r,a)}},ba)}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?dt(t,function(e){return Pr(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Ya];var l=-1;return t=dt(t,Nt(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,r=i.length,a=n.length;++l<r;){var u=pi(i[l],o[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Tl(e,function(e,n,i){return{criteria:dt(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 r=t[l],a=cl(e,r);n(a,r)&&Ul(o,ri(r,e),a)}return o}function Ll(e,t,n,l){var i=l?Et:gt,o=-1,r=t.length,a=e;for(e===t&&(t=hi(t)),n&&(a=dt(e,Nt(n)));++o<r;)for(var u=0,d=t[o],s=n?n(d):d;(u=i(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var 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(mo(e,t,Ya),e+"")}function Fl(e){return Vn(Oa(e))}function Vl(e,t){var n=Oa(e);return Ao(n,Zn(t,0,n.length))}function Ul(e,t,n,l){if(!zr(e))return e;for(var i=-1,o=(t=ri(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=No(t[i]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var s=a[u];void 0===(d=l?l(s,u,a):void 0)&&(d=zr(s)?s:oo(t[i+1])?[]:{})}Wn(a,u,d),a=a[u]}return e}var jl=En?function(e,t){return En.set(e,t),e}:Ya,Hl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:za(t),writable:!0})}:Ya;function Wl(e){return Ao(Oa(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,r=e[o];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Yl(e,t,Ya,n)}function Yl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),d=void 0===t;i<o;){var s=Qt((i+o)/2),c=n(e[s]),v=void 0!==c,p=null===c,m=c==c,f=Jr(c);if(r)var h=l||m;else h=d?m&&(l||v):a?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?c<=t:c<t);h?i=s+1:o=s}return an(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Or(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function Zl(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function $l(e){if("string"==typeof e)return e;if(Pr(e))return dt(e,$l)+"";if(Jr(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,i=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var d=t?null:Bi(e);if(d)return Ut(d);r=!1,i=wt,u=new Bn}else u=t?[]:a;e:for(;++l<o;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,r&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),a.push(s)}else i(u,c,n)||(u!==a&&u.push(c),a.push(s))}return a}function Jl(e,t){return null==(e=fo(e,t=ri(t,e)))||delete e[No(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 r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Qn(o[i]||r,e[a],t,n));return Xl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function ii(e){return kr(e)?e:[]}function oi(e){return"function"==typeof e?e:Ya}function ri(e,t){return Pr(e)?e:ao(e,t)?[e]:To(ua(e))}var ai=kl;function ui(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var di=Zt||function(e){return We.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new je(t).set(new je(e)),t}function vi(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Jr(e),r=void 0!==t,a=null===t,u=t==t,d=Jr(t);if(!a&&!d&&!o&&e>t||o&&r&&u&&!a&&!d||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!d&&e<t||d&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,d=rn(o-r,0),s=Y(u+d),c=!l;++a<u;)s[a]=t[a];for(;++i<r;)(c||i<o)&&(s[n[i]]=e[i]);for(;d--;)s[a++]=e[i++];return s}function fi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,d=t.length,s=rn(o-a,0),c=Y(s+d),v=!l;++i<s;)c[i]=e[i];for(var p=i;++u<d;)c[p+u]=t[u];for(;++r<a;)(v||i<o)&&(c[p+n[r]]=e[i++]);return c}function hi(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,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Yn(n,a,u):Wn(n,a,u)}return n}function Ei(e,t){return function(n,l){var i=Pr(n)?nt:Kn,o=t?t():{};return i(n,e,Zi(l,2),o)}}function _i(e){return kl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&ro(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function yi(e,t){return function(n,l){if(null==n)return n;if(!Br(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=me(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=me(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Bt(t=ua(t))?Wt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ui(n,1).join(""):t.slice(1);return l[e]()+i}}function Ai(e){return function(t){return ct(ja(La(t).replace(Ie,"")),e,"")}}function Di(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 zr(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!Br(t)){var o=Zi(n,3);t=Sa(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Ti(e){return Wi(function(t){var l=t.length,i=l,o=xn.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new ge(n);if(o&&!a&&"wrapper"==Yi(r))var a=new xn([],!0)}for(i=a?i:l;++i<l;){var u=Yi(r=t[i]),d="wrapper"==u?Gi(r):void 0;a=d&&uo(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[Yi(d[0])].apply(a,d[3]):1==r.length&&uo(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Pr(n))return a.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 Ni(e,t,n,l,i,o,r,a,u,d){var s=128&t,c=1&t,v=2&t,p=24&t,m=512&t,f=v?void 0:Di(e);return function h(){for(var g=arguments.length,E=Y(g),_=g;_--;)E[_]=arguments[_];if(p)var y=qi(h),S=Rt(E,y);if(l&&(E=mi(E,l,i,p)),o&&(E=fi(E,o,r,p)),g-=S,p&&g<d){var b=Vt(E,y);return Pi(e,t,Ni,h.placeholder,n,E,b,a,u,d-g)}var A=c?n:this,D=v?A[e]:e;return g=E.length,a?E=ho(E,a):m&&g>1&&E.reverse(),s&&u<g&&(E.length=u),this&&this!==We&&this instanceof h&&(D=f||Di(D)),D.apply(A,E)}}function Ii(e,t){return function(n,l){return function(e,t,n,l){return ul(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 Wi(function(t){return t=dt(t,Nt(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/Ht(t)));return Bt(t)?ui(Wt(l),0,e).join(""):l.slice(0,e)}function Ri(e){return function(t,n,l){return l&&"number"!=typeof l&&ro(t,n,l)&&(n=l=void 0),t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n,l){for(var i=-1,o=rn(Jt((t-e)/(n||1)),0),r=Y(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Pi(e,t,n,l,i,o,r,a,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?r:void 0,s?void 0:o,s?void 0:r,a,u,d],v=n.apply(void 0,c);return uo(e)&&Eo(v,c),v.placeholder=l,So(v,e,t)}function Mi(e){var t=pe[e];return function(e,n){if(e=ra(e),(n=null==n?0:an(ia(n),292))&&nn(e)){var l=(ua(e)+"e").split("e");return+((l=(ua(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)}:Ja;function ki(e){return function(t){var n=to(t);return n==v?kt(t):n==h?jt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,r,a,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new ge(n);var c=o?o.length:0;if(c||(t&=-97,o=r=void 0),u=void 0===u?u:rn(ia(u),0),d=void 0===d?d:ia(d),c-=r?r.length:0,64&t){var v=o,p=r;o=r=void 0}var m=s?void 0:Gi(e),f=[e,t,i,o,r,v,p,a,u,d];if(m&&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 r=t[3];if(r){var a=e[3];e[3]=a?mi(a,r,t[4]):r,e[4]=a?Vt(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?fi(a,r,t[6]):r,e[6]=a?Vt(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:rn(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Di(e);return function i(){for(var o=arguments.length,r=Y(o),a=o,u=qi(i);a--;)r[a]=arguments[a];var d=o<3&&r[0]!==u&&r[o-1]!==u?[]:Vt(r,u);if((o-=d.length)<n)return Pi(e,t,Ni,i.placeholder,void 0,r,d,void 0,void 0,n-o);var s=this&&this!==We&&this instanceof i?l:e;return tt(s,this,r)}}(e,t,d):32!=t&&33!=t||r.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Di(e);return function t(){for(var r=-1,a=arguments.length,u=-1,d=l.length,s=Y(d+a),c=this&&this!==We&&this instanceof t?o:e;++u<d;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(c,i?n:this,s)}}(e,t,i,o);else var h=function(e,t,n){var l=1&t,i=Di(e);return function t(){var o=this&&this!==We&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return So((m?jl:Eo)(h,f),e,t)}function Vi(e,t,n,l){return void 0===e||Or(e,_e[n])&&!be.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return zr(e)&&zr(t)&&(o.set(t,e),wl(e,t,void 0,Ui,o),o.delete(t)),e}function ji(e){return qr(e)?void 0:e}function Hi(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,p=2&n?new Bn:void 0;for(o.set(e,t),o.set(t,e);++c<a;){var m=e[c],f=t[c];if(l)var h=r?l(f,m,c,t,e,o):l(m,f,c,e,t,o);if(void 0!==h){if(h)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!wt(p,t)&&(m===e||i(m,e,n,l,o)))return p.push(t)})){v=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function Wi(e){return yo(mo(e,void 0,Mo),e+"")}function zi(e){return vl(e,Sa,Qi)}function Ki(e){return vl(e,ba,eo)}var Gi=En?function(e){return En.get(e)}:Ja;function Yi(e){for(var t=e.name+"",n=_n[t],l=be.call(_n,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||qa;return e=e===qa?Al: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=Sa(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=me(e),rt(en(e),function(t){return Ye.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)st(t,Qi(e)),e=ze(e);return t}:ou,to=pl;function no(e,t,n){for(var l=-1,i=(t=ri(t,e)).length,o=!1;++l<i;){var r=No(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Wr(i)&&oo(r,i)&&(Pr(e)||Lr(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:wn(ze(e))}function io(e){return Pr(e)||Lr(e)||!!(mt&&e&&e[mt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ro(e,t,n){if(!zr(n))return!1;var l=typeof t;return!!("number"==l?Br(n)&&oo(t,n.length):"string"==l&&t in n)&&Or(n[t],e)}function ao(e,t){if(Pr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(e))||j.test(e)||!U.test(e)||null!=t&&e in me(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)))!=S||pn&&to(new pn)!=v||mn&&"[object Promise]"!=to(mn.resolve())||fn&&to(new fn)!=h||hn&&to(new hn)!=_)&&(to=function(e){var t=pl(e),n=t==m?e.constructor:void 0,l=n?Io(n):"";if(l)switch(l){case yn:return S;case Sn:return v;case bn:return"[object Promise]";case An:return h;case Dn:return _}return t});var so=ye?jr:ru;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function vo(e){return e==e&&!zr(e)}function po(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=rn(l.length-t,0),r=Y(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=Y(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function fo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function ho(e,t){for(var n=e.length,l=an(t.length,n),i=hi(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 Eo=bo(jl),_o=Xt||function(e,t){return We.setTimeout(e,t)},yo=bo(Hl);function So(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]&&!at(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=un(),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 Ao(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),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var Do,Co,To=(Do=Dr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,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=Do.cache,Do);function No(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Io(e){if(null!=e){try{return Se.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__=hi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Oo=kl(function(e,t){return kr(e)?Qn(e,ol(t,1,kr,!0)):[]}),xo=kl(function(e,t){var n=Uo(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,ol(t,1,kr,!0),Zi(n,2)):[]}),Ro=kl(function(e,t){var n=Uo(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,ol(t,1,kr,!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:ia(n);return i<0&&(i=rn(l+i,0)),ht(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=ia(n),i=n<0?rn(l+i,0):an(i,l-1)),ht(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=dt(e,ii);return t.length&&t[0]===e[0]?gl(t):[]}),Fo=kl(function(e){var t=Uo(e),n=dt(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=dt(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 jo=kl(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var Wo=Wi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Pl(e,dt(t,function(e){return oo(e,n)?+e:e}).sort(pi)),l});function zo(e){return null==e?e:cn.call(e)}var Ko=kl(function(e){return Xl(ol(e,1,kr,!0))}),Go=kl(function(e){var t=Uo(e);return kr(t)&&(t=void 0),Xl(ol(e,1,kr,!0),Zi(t,2))}),Yo=kl(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Xl(ol(e,1,kr,!0),void 0,t)});function qo(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(kr(e))return t=rn(e.length,t),!0}),Ct(t,function(t){return dt(e,St(t))})}function Zo(e,t){if(!e||!e.length)return[];var n=qo(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var $o=kl(function(e,t){return kr(e)?Qn(e,t):[]}),Xo=kl(function(e){return ni(rt(e,kr))}),Jo=kl(function(e){var t=Uo(e);return kr(t)&&(t=void 0),ni(rt(e,kr),Zi(t,2))}),Qo=kl(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ni(rt(e,kr),void 0,t)}),er=kl(qo),tr=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 nr(e){var t=In(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var ir=Wi(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:lr,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)}),or=Ei(function(e,t,n){be.call(e,n)?++e[n]:Yn(e,n,1)}),rr=Ci(Lo),ar=Ci(Po);function ur(e,t){return(Pr(e)?lt:el)(e,Zi(t,3))}function dr(e,t){return(Pr(e)?it:tl)(e,Zi(t,3))}var sr=Ei(function(e,t,n){be.call(e,n)?e[n].push(t):Yn(e,n,[t])}),cr=kl(function(e,t,n){var l=-1,i="function"==typeof t,o=Br(e)?Y(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):El(e,t,n)}),o}),vr=Ei(function(e,t,n){Yn(e,n,t)});function pr(e,t){return(Pr(e)?dt:Tl)(e,Zi(t,3))}var mr=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ro(e,t[0],t[1])?t=[]:n>2&&ro(t[0],t[1],t[2])&&(t=[t[0]]),xl(e,ol(t,1),[])}),hr=$t||function(){return We.Date.now()};function gr(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 Er(e,t){var l;if("function"!=typeof t)throw new ge(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var _r=kl(function(e,t,n){var l=1;if(n.length){var i=Vt(n,qi(_r));l|=32}return Fi(e,l,t,n,i)}),yr=kl(function(e,t,n){var l=3;if(n.length){var i=Vt(n,qi(yr));l|=32}return Fi(t,l,e,n,i)});function Sr(e,t,l){var i,o,r,a,u,d,s=0,c=!1,v=!1,p=!0;if("function"!=typeof e)throw new ge(n);function m(t){var n=i,l=o;return i=o=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=_o(g,t),c?m(e):a}function h(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-s>=r}function g(){var e=hr();if(h(e))return E(e);u=_o(g,function(e){var n=t-(e-d);return v?an(n,r-(e-s)):n}(e))}function E(e){return u=void 0,p&&i?m(e):(i=o=void 0,a)}function _(){var e=hr(),n=h(e);if(i=arguments,o=this,d=e,n){if(void 0===u)return f(d);if(v)return di(u),u=_o(g,t),m(d)}return void 0===u&&(u=_o(g,t)),a}return t=ra(t)||0,zr(l)&&(c=!!l.leading,r=(v="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,p="trailing"in l?!!l.trailing:p),_.cancel=function(){void 0!==u&&di(u),s=0,i=d=o=u=void 0},_.flush=function(){return void 0===u?a:E(hr())},_}var br=kl(function(e,t){return Jn(e,1,t)}),Ar=kl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Dr(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 r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(Dr.Cache||Mn),l}function Cr(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)}}Dr.Cache=Mn;var Tr=ai(function(e,t){var n=(t=1==t.length&&Pr(t[0])?dt(t[0],Nt(Zi())):dt(ol(t,1),Nt(Zi()))).length;return kl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Nr=kl(function(e,t){return Fi(e,32,void 0,t,Vt(t,qi(Nr)))}),Ir=kl(function(e,t){return Fi(e,64,void 0,t,Vt(t,qi(Ir)))}),wr=Wi(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Or(e,t){return e===t||e!=e&&t!=t}var xr=Li(ml),Rr=Li(function(e,t){return e>=t}),Lr=_l(function(){return arguments}())?_l:function(e){return Kr(e)&&be.call(e,"callee")&&!Ye.call(e,"callee")},Pr=Y.isArray,Mr=Ze?Nt(Ze):function(e){return Kr(e)&&pl(e)==y};function Br(e){return null!=e&&Wr(e.length)&&!jr(e)}function kr(e){return Kr(e)&&Br(e)}var Fr=tn||ru,Vr=$e?Nt($e):function(e){return Kr(e)&&pl(e)==u};function Ur(e){if(!Kr(e))return!1;var t=pl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qr(e)}function jr(e){if(!zr(e))return!1;var t=pl(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Hr(e){return"number"==typeof e&&e==ia(e)}function Wr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function zr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Kr(e){return null!=e&&"object"==typeof e}var Gr=Xe?Nt(Xe):function(e){return Kr(e)&&to(e)==v};function Yr(e){return"number"==typeof e||Kr(e)&&pl(e)==p}function qr(e){if(!Kr(e)||pl(e)!=m)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&&Se.call(n)==Te}var Zr=Je?Nt(Je):function(e){return Kr(e)&&pl(e)==f},$r=Qe?Nt(Qe):function(e){return Kr(e)&&to(e)==h};function Xr(e){return"string"==typeof e||!Pr(e)&&Kr(e)&&pl(e)==g}function Jr(e){return"symbol"==typeof e||Kr(e)&&pl(e)==E}var Qr=et?Nt(et):function(e){return Kr(e)&&Wr(e.length)&&!!Be[pl(e)]},ea=Li(Cl),ta=Li(function(e,t){return e<=t});function na(e){if(!e)return[];if(Br(e))return Xr(e)?Wt(e):hi(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==h?Ut:Oa)(e)}function la(e){return e?(e=ra(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ia(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function oa(e){return e?Zn(ia(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if(zr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=zr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=le.test(e);return n||oe.test(e)?Ue(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return gi(e,ba(e))}function ua(e){return null==e?"":$l(e)}var da=_i(function(e,t){if(co(t)||Br(t))gi(t,Sa(t),e);else for(var n in t)be.call(t,n)&&Wn(e,n,t[n])}),sa=_i(function(e,t){gi(t,ba(t),e)}),ca=_i(function(e,t,n,l){gi(t,ba(t),e,l)}),va=_i(function(e,t,n,l){gi(t,Sa(t),e,l)}),pa=Wi(qn),ma=kl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ro(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=ba(o),a=-1,u=r.length;++a<u;){var d=r[a],s=e[d];(void 0===s||Or(s,_e[d])&&!be.call(e,d))&&(e[d]=o[d])}return e}),fa=kl(function(e){return e.push(void 0,Ui),tt(Da,void 0,e)});function ha(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function ga(e,t){return null!=e&&no(e,t,hl)}var Ea=Ii(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},za(Ya)),_a=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),ya=kl(El);function Sa(e){return Br(e)?Fn(e):Dl(e)}function ba(e){return Br(e)?Fn(e,!0):function(e){if(!zr(e))return function(e){var t=[];if(null!=e)for(var n in me(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 Aa=_i(function(e,t,n){wl(e,t,n)}),Da=_i(function(e,t,n,l){wl(e,t,n,l)}),Ca=Wi(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=ri(t,e),l||(l=t.length>1),t}),gi(e,Ki(e),n),l&&(n=$n(n,7,ji));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Ta=Wi(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return ga(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=dt(Ki(e),function(e){return[e]});return t=Zi(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Ia=ki(Sa),wa=ki(ba);function Oa(e){return null==e?[]:It(e,Sa(e))}var xa=Ai(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return Ua(ua(e).toLowerCase())}function La(e){return(e=ua(e))&&e.replace(ae,Lt).replace(we,"")}var Pa=Ai(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=Ai(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ba=bi("toLowerCase"),ka=Ai(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fa=Ai(function(e,t,n){return e+(n?" ":"")+Ua(t)}),Va=Ai(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ua=bi("toUpperCase");function ja(e,t,n){return e=ua(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 Ha=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ur(e)?e:new ce(e)}}),Wa=Wi(function(e,t){return lt(t,function(t){t=No(t),Yn(e,t,_r(e[t],e))}),e});function za(e){return function(){return e}}var Ka=Ti(),Ga=Ti(!0);function Ya(e){return e}function qa(e){return Al("function"==typeof e?e:$n(e,1))}var Za=kl(function(e,t){return function(n){return El(n,e,t)}}),$a=kl(function(e,t){return function(n){return El(e,n,t)}});function Xa(e,t,n){var l=Sa(t),i=sl(t,l);null!=n||zr(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Sa(t)));var o=!(zr(n)&&"chain"in n&&!n.chain),r=jr(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=hi(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 Ja(){}var Qa=Oi(dt),eu=Oi(ot),tu=Oi(pt);function nu(e){return ao(e)?St(No(e)):function(e){return function(t){return cl(t,e)}}(e)}var lu=Ri(),iu=Ri(!0);function ou(){return[]}function ru(){return!1}var au,uu=wi(function(e,t){return e+t},0),du=Mi("ceil"),su=wi(function(e,t){return e/t},1),cu=Mi("floor"),vu=wi(function(e,t){return e*t},1),pu=Mi("round"),mu=wi(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new ge(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=gr,In.assign=da,In.assignIn=sa,In.assignInWith=ca,In.assignWith=va,In.at=pa,In.before=Er,In.bind=_r,In.bindAll=Wa,In.bindKey=yr,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pr(e)?e:[e]},In.chain=nr,In.chunk=function(e,t,n){t=(n?ro(e,t,n):void 0===t)?1:rn(ia(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=Y(Jt(l/t));i<l;)r[o++]=zl(e,i,i+=t);return r},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(Pr(n)?hi(n):[n],ol(t,1))},In.cond=function(e){var t=null==e?0:e.length,l=Zi();return e=t?dt(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=Sa(e);return function(n){return Xn(n,e,t)}}($n(e,1))},In.constant=za,In.countBy=or,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=Sr,In.defaults=ma,In.defaultsDeep=fa,In.defer=br,In.delay=Ar,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:ia(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:ia(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&&ro(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ia(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ia(l))<0&&(l+=i),l=n>l?0:oa(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},In.filter=function(e,t){return(Pr(e)?rt:il)(e,Zi(t,3))},In.flatMap=function(e,t){return ol(pr(e,t),1)},In.flatMapDeep=function(e,t){return ol(pr(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:ia(n),ol(pr(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:ia(t)):[]},In.flip=function(e){return Fi(e,512)},In.flow=Ka,In.flowRight=Ga,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,Sa(e))},In.functionsIn=function(e){return null==e?[]:sl(e,ba(e))},In.groupBy=sr,In.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},In.intersection=ko,In.intersectionBy=Fo,In.intersectionWith=Vo,In.invert=Ea,In.invertBy=_a,In.invokeMap=cr,In.iteratee=qa,In.keyBy=vr,In.keys=Sa,In.keysIn=ba,In.map=pr,In.mapKeys=function(e,t){var n={};return t=Zi(t,3),ul(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),ul(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},In.matches=function(e){return Nl($n(e,1))},In.matchesProperty=function(e,t){return Il(e,$n(t,1))},In.memoize=Dr,In.merge=Aa,In.mergeWith=Da,In.method=Za,In.methodOf=$a,In.mixin=Xa,In.negate=Cr,In.nthArg=function(e){return e=ia(e),kl(function(t){return Ol(t,e)})},In.omit=Ca,In.omitBy=function(e,t){return Na(e,Cr(Zi(t)))},In.once=function(e){return Er(2,e)},In.orderBy=function(e,t,n,l){return null==e?[]:(Pr(t)||(t=null==t?[]:[t]),Pr(n=l?void 0:n)||(n=null==n?[]:[n]),xl(e,t,n))},In.over=Qa,In.overArgs=Tr,In.overEvery=eu,In.overSome=tu,In.partial=Nr,In.partialRight=Ir,In.partition=mr,In.pick=Ta,In.pickBy=Na,In.property=nu,In.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},In.pull=jo,In.pullAll=Ho,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=Wo,In.range=lu,In.rangeRight=iu,In.rearg=wr,In.reject=function(e,t){return(Pr(e)?rt:il)(e,Cr(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 r=e[l];t(r,l,e)&&(n.push(r),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:ia(t))},In.reverse=zo,In.sampleSize=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),(Pr(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(Pr(e)?jn:Wl)(e)},In.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ro(e,t,n)?(t=0,n=l):(t=null==t?0:ia(t),n=void 0===n?l:ia(n)),zl(e,t,n)):[]},In.sortBy=fr,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&&ro(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Zr(t))&&!(t=$l(t))&&Bt(e)?ui(Wt(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:rn(ia(t),0),kl(function(n){var l=n[t],i=ui(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:ia(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:ia(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 zr(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Sr(e,t,{leading:i,maxWait:t,trailing:o})},In.thru=lr,In.toArray=na,In.toPairs=Ia,In.toPairsIn=wa,In.toPath=function(e){return Pr(e)?dt(e,No):Jr(e)?[e]:hi(To(ua(e)))},In.toPlainObject=aa,In.transform=function(e,t,n){var l=Pr(e),i=l||Fr(e)||Qr(e);if(t=Zi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:zr(e)&&jr(o)?wn(ze(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},In.unary=function(e){return gr(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=Oa,In.valuesIn=function(e){return null==e?[]:It(e,ba(e))},In.without=$o,In.words=ja,In.wrap=function(e,t){return Nr(oi(t),e)},In.xor=Xo,In.xorBy=Jo,In.xorWith=Qo,In.zip=er,In.zipObject=function(e,t){return li(e||[],t||[],Wn)},In.zipObjectDeep=function(e,t){return li(e||[],t||[],Ul)},In.zipWith=tr,In.entries=Ia,In.entriesIn=wa,In.extend=sa,In.extendWith=ca,Xa(In,In),In.add=uu,In.attempt=Ha,In.camelCase=xa,In.capitalize=Ra,In.ceil=du,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),Zn(ra(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,Sa(t))},In.deburr=La,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=su,In.endsWith=function(e,t,n){e=ua(e),t=$l(t);var l=e.length,i=n=void 0===n?l:Zn(ia(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},In.eq=Or,In.escape=function(e){return(e=ua(e))&&B.test(e)?e.replace(P,Pt):e},In.escapeRegExp=function(e){return(e=ua(e))&&K.test(e)?e.replace(W,"\\$&"):e},In.every=function(e,t,n){var l=Pr(e)?ot:nl;return n&&ro(e,t,n)&&(t=void 0),l(e,Zi(t,3))},In.find=rr,In.findIndex=Lo,In.findKey=function(e,t){return ft(e,Zi(t,3),ul)},In.findLast=ar,In.findLastIndex=Po,In.findLastKey=function(e,t){return ft(e,Zi(t,3),dl)},In.floor=cu,In.forEach=ur,In.forEachRight=dr,In.forIn=function(e,t){return null==e?e:rl(e,Zi(t,3),ba)},In.forInRight=function(e,t){return null==e?e:al(e,Zi(t,3),ba)},In.forOwn=function(e,t){return e&&ul(e,Zi(t,3))},In.forOwnRight=function(e,t){return e&&dl(e,Zi(t,3))},In.get=ha,In.gt=xr,In.gte=Rr,In.has=function(e,t){return null!=e&&no(e,t,fl)},In.hasIn=ga,In.head=Bo,In.identity=Ya,In.includes=function(e,t,n,l){e=Br(e)?e:Oa(e),n=n&&!l?ia(n):0;var i=e.length;return n<0&&(n=rn(i+n,0)),Xr(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:ia(n);return i<0&&(i=rn(l+i,0)),gt(e,t,i)},In.inRange=function(e,t,n){return t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n){return e>=an(t,n)&&e<rn(t,n)}(e=ra(e),t,n)},In.invoke=ya,In.isArguments=Lr,In.isArray=Pr,In.isArrayBuffer=Mr,In.isArrayLike=Br,In.isArrayLikeObject=kr,In.isBoolean=function(e){return!0===e||!1===e||Kr(e)&&pl(e)==a},In.isBuffer=Fr,In.isDate=Vr,In.isElement=function(e){return Kr(e)&&1===e.nodeType&&!qr(e)},In.isEmpty=function(e){if(null==e)return!0;if(Br(e)&&(Pr(e)||"string"==typeof e||"function"==typeof e.splice||Fr(e)||Qr(e)||Lr(e)))return!e.length;var t=to(e);if(t==v||t==h)return!e.size;if(co(e))return!Dl(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=Ur,In.isFinite=function(e){return"number"==typeof e&&nn(e)},In.isFunction=jr,In.isInteger=Hr,In.isLength=Wr,In.isMap=Gr,In.isMatch=function(e,t){return e===t||Sl(e,t,Xi(t))},In.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Xi(t),n)},In.isNaN=function(e){return Yr(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=Yr,In.isObject=zr,In.isObjectLike=Kr,In.isPlainObject=qr,In.isRegExp=Zr,In.isSafeInteger=function(e){return Hr(e)&&e>=-9007199254740991&&e<=9007199254740991},In.isSet=$r,In.isString=Xr,In.isSymbol=Jr,In.isTypedArray=Qr,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return Kr(e)&&to(e)==_},In.isWeakSet=function(e){return Kr(e)&&"[object WeakSet]"==pl(e)},In.join=function(e,t){return null==e?"":ln.call(e,t)},In.kebabCase=Pa,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=ia(n))<0?rn(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):ht(e,_t,i,!0)},In.lowerCase=Ma,In.lowerFirst=Ba,In.lt=ea,In.lte=ta,In.max=function(e){return e&&e.length?ll(e,Ya,ml):void 0},In.maxBy=function(e,t){return e&&e.length?ll(e,Zi(t,2),ml):void 0},In.mean=function(e){return yt(e,Ya)},In.meanBy=function(e,t){return yt(e,Zi(t,2))},In.min=function(e){return e&&e.length?ll(e,Ya,Cl):void 0},In.minBy=function(e,t){return e&&e.length?ll(e,Zi(t,2),Cl):void 0},In.stubArray=ou,In.stubFalse=ru,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=vu,In.nth=function(e,t){return e&&e.length?Ol(e,ia(t)):void 0},In.noConflict=function(){return We._===this&&(We._=Ne),this},In.noop=Ja,In.now=hr,In.pad=function(e,t,n){e=ua(e);var l=(t=ia(t))?Ht(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=ua(e);var l=(t=ia(t))?Ht(e):0;return t&&l<t?e+xi(t-l,n):e},In.padStart=function(e,t,n){e=ua(e);var l=(t=ia(t))?Ht(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),dn(ua(e).replace(G,""),t||0)},In.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ro(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=la(e),void 0===t?(t=e,e=0):t=la(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Ml(e,t)},In.reduce=function(e,t,n){var l=Pr(e)?ct:At,i=arguments.length<3;return l(e,Zi(t,4),n,i,el)},In.reduceRight=function(e,t,n){var l=Pr(e)?vt:At,i=arguments.length<3;return l(e,Zi(t,4),n,i,tl)},In.repeat=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),Bl(ua(e),t)},In.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var l=-1,i=(t=ri(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[No(t[l])];void 0===o&&(l=i,o=n),e=jr(o)?o.call(e):o}return e},In.round=pu,In.runInContext=e,In.sample=function(e){return(Pr(e)?Vn:Fl)(e)},In.size=function(e){if(null==e)return 0;if(Br(e))return Xr(e)?Ht(e):e.length;var t=to(e);return t==v||t==h?e.size:Dl(e).length},In.snakeCase=ka,In.some=function(e,t,n){var l=Pr(e)?pt:Kl;return n&&ro(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&&Or(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(Or(e[n],t))return n}return-1},In.startCase=Fa,In.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Zn(ia(n),0,e.length),t=$l(t),e.slice(n,n+t.length)==t},In.subtract=mu,In.sum=function(e){return e&&e.length?Dt(e,Ya):0},In.sumBy=function(e,t){return e&&e.length?Dt(e,Zi(t,2)):0},In.template=function(e,t,n){var l=In.templateSettings;n&&ro(e,t,n)&&(t=void 0),e=ua(e),t=ca({},t,l,Vi);var i,o,r=ca({},t.imports,l.imports,Vi),a=Sa(r),u=It(r,a),d=0,s=t.interpolate||ue,c="__p += '",v=fe((t.escape||ue).source+"|"+s.source+"|"+(s===V?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,function(t,n,l,r,a,u){return l||(l=r),c+=e.slice(d,u).replace(de,Mt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),a&&(o=!0,c+="';\n"+a+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(J.test(m))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("+(m||"obj")+") {\n"+(m?"":"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=Ha(function(){return ve(a,p+"return "+c).apply(void 0,u)});if(f.source=c,Ur(f))throw f;return f},In.times=function(e,t){if((e=ia(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Zi(t));++n<e;)t(n);return i},In.toFinite=la,In.toInteger=ia,In.toLength=oa,In.toLower=function(e){return ua(e).toLowerCase()},In.toNumber=ra,In.toSafeInteger=function(e){return e?Zn(ia(e),-9007199254740991,9007199254740991):0===e?e:0},In.toString=ua,In.toUpper=function(e){return ua(e).toUpperCase()},In.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=$l(t)))return e;var l=Wt(e),i=Wt(t);return ui(l,Ot(l,i),xt(l,i)+1).join("")},In.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=$l(t)))return e;var l=Wt(e);return ui(l,0,xt(l,Wt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=$l(t)))return e;var l=Wt(e);return ui(l,Ot(l,Wt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(zr(t)){var i="separator"in t?t.separator:i;n="length"in t?ia(t.length):n,l="omission"in t?$l(t.omission):l}var o=(e=ua(e)).length;if(Bt(e)){var r=Wt(e);o=r.length}if(n>=o)return e;var a=n-Ht(l);if(a<1)return l;var u=r?ui(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),Zr(i)){if(e.slice(a).search(i)){var d,s=u;for(i.global||(i=fe(i.source,ua(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?a:c)}}else if(e.indexOf($l(i),a)!=a){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},In.unescape=function(e){return(e=ua(e))&&M.test(e)?e.replace(L,Kt):e},In.uniqueId=function(e){var t=++Ae;return ua(e)+t},In.upperCase=Va,In.upperFirst=Ua,In.each=ur,In.eachRight=dr,In.first=Bo,Xa(In,(au={},ul(In,function(e,t){be.call(In.prototype,t)||(au[t]=e)}),au),{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:rn(ia(n),0);var l=this.__filtered__&&!t?new Rn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},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(Ya)},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 El(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Cr(Zi(e)))},Rn.prototype.slice=function(e,t){e=ia(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=ia(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)},ul(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__,r=l?[1]:arguments,a=t instanceof Rn,u=r[0],d=a||Pr(t),s=function(e){var t=i.apply(In,st([e],r));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(a=d=!1);var c=this.__chain__,v=!!this.__actions__.length,p=o&&!c,m=a&&!v;if(!o&&d){t=m?t:new Rn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[s],thisArg:void 0}),new xn(f,c)}return p&&m?e.apply(this,r):(f=this.thru(s),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[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(Pr(i)?i:[],e)}return this[n](function(n){return t.apply(Pr(n)?n:[],e)})}}),ul(Rn.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";be.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=hi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hi(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=Pr(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],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,d=l?a:r-1,s=this.__iteratees__,c=s.length,v=0,p=an(u,this.__takeCount__);if(!n||!l&&i==u&&p==u)return ti(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,h=e[d+=t];++f<c;){var g=s[f],E=g.type,_=(0,g.iteratee)(h);if(2==E)h=_;else if(!_){if(1==E)continue e;break e}}m[v++]=h}return m},In.prototype.at=ir,In.prototype.chain=function(){return nr(this)},In.prototype.commit=function(){return new xn(this.value(),this.__chain__)},In.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(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:lr,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):We._=Gt}).call(z)});const Y=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],q=e=>{let{searchParams:o,onFilterChange:a,defaultSearchParams:s,statusMap:c,moduleCode:v}=e,p=d(e,Y);const{t:m}=i.useTranslation(),f=r.useQueryClient(),[h,g]=n.useState(()=>u({},o,{services:[]})),[E,_]=n.useState(),[y,S]=n.useState(),[b,A]=n.useState(),D=[{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 T=[];C&&C.map(e=>{T.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:N}=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=[];N&&N.map(e=>{I.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const w=e=>{let t=e.delete,n=u({},h,e);t&&t.forEach(e=>delete n[e]),delete e.delete,g(u({},n))},O=()=>{g(u({},s,{services:[]})),a(u({},s)),_(null),S(null),A(null)};return n.useEffect(()=>{y&&w({vendingZone:(null==y?void 0:y.code)||""}),E&&w({vendingType:(null==E?void 0:E.code)||""}),b&&w({status:(null==b?void 0:b.i18nKey)||""})},[y,E,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"}},m("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:O},m("ES_COMMON_CLEAR_ALL")),"desktop"===p.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"===p.type&&l.createElement("span",{onClick:p.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("SV_VENDING_ZONES"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:y,select:S,option:I,optionKey:"i18nKey",t:m,placeholder:"Select"})),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("SV_VENDING_TYPE"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:E,select:_,option:T,optionKey:"i18nKey",t:m,placeholder:"Select"})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("SV_APPLICATION_STATUS"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:b,select:A,option:[{i18nKey:"APPLIED"},{i18nKey:"APPROVED"},{i18nKey:"REGISTRATIONCOMPLETED"},{i18nKey:"INSPECTIONPENDING"},{i18nKey:"REJECTED"}],optionKey:"i18nKey",t:m,placeholder:"Select"}))),l.createElement("div",null,l.createElement(W,{searchParams:h,businessServices:h.services,statusMap:c||f.getQueryData("INBOX_STATUS_MAP_"+v),moduleCode:v,onAssignmentChange:(e,t)=>{if(e.target.checked)w({applicationStatus:[...null==h?void 0:h.applicationStatus,t]});else{let e=null==h?void 0:h.applicationStatus.filter(e=>e.state!==t.state);w({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{a(0===h.services.length?u({},h,{services:D.map(e=>e.value)}):h)},label:m("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,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,C,T,N;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===(r=t.city)||void 0===r?void 0:r.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===(a=e.vendorDetail[0])||void 0===a?void 0:a.name},{title:n("SV_FATHER_NAME"),value:null==e||null===(u=e.vendorDetail[0])||void 0===u?void 0:u.fatherName},{title:n("SV_REGISTERED_MOB_NUMBER"),value:null==e||null===(d=e.vendorDetail[0])||void 0===d?void 0:d.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===(p=e.vendorDetail[0])||void 0===p?void 0:p.spouseDob},{title:n("SV_DEPENDENT_NAME"),value:null==e||null===(m=e.vendorDetail[0])||void 0===m?void 0:m.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===(h=e.vendorDetail[0])||void 0===h?void 0:h.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===(E=e.bankDetail)||void 0===E?void 0:E.ifscCode},{title:n("SV_BANK_NAME"),value:null==e||null===(_=e.bankDetail)||void 0===_?void 0:_.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===(S=e.bankDetail)||void 0===S?void 0:S.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===(A=e.addressDetails[0])||void 0===A?void 0:A.addressLine1},{title:n("SV_CITY"),value:null==e||null===(D=e.addressDetails[0])||void 0===D?void 0:D.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===(T=e.addressDetails[0])||void 0===T?void 0:T.pincode},{title:n("SV_LANDMARK"),value:null==e||null===(N=e.addressDetails[0])||void 0===N?void 0:N.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%"}})};function ee(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const te=e=>l.createElement("h1",{className:"heading-m"},e.label),ne=()=>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"})),le=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ne,null)),ie=e=>{var i,o;let{t:r,action:a,tenantId:d,closeModal:s,submitAction:c,applicationData:v,businessService:p,moduleCode:m}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(d,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:g,data:E}=Digit.Hooks.pt.useMDMS(d,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,y]=n.useState({}),[S,b]=n.useState({}),[A,D]=n.useState([]),[C,T]=n.useState(null),[N,I]=n.useState(null),[w,O]=n.useState(null),[x,R]=n.useState(null),[L,P]=n.useState([]),[M,B]=n.useState(null),[k,F]=n.useState(!1);function V(e){I(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&P(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;D(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=ee(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):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(r("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(()=>{a&&y(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:r,setSelectedFinancialYear:a}=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:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:L,selectedFinancialYear:M,setSelectedFinancialYear:B}):(e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:A,selectedApprover:C,setSelectedApprover:T,selectFile:V,uploadedFile:w,setUploadedFile:O,businessService:p}))},[a,A,L,M,w]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(te,{label:r(_.label.heading)}),headerBarEnd:l.createElement(le,{onClick:s}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!M:h||(null==a?void 0:a.docUploadRequired)&&!w,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:u({},v,{workflow:t})})}else if(null!=a&&a.showFinancialYearsModal)c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==v?void 0:v.propertyId,tenantId:d,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],w&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:w}]),c({Property:u({},v,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},oe=e=>l.createElement("h1",{className:"heading-m"},e.label),re=()=>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(re,null)),ue=e=>{var i,o;let{t:r,action:a,tenantId:d,closeModal:s,submitAction:c,applicationData:v,businessService:p}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(d,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:f,data:h}=Digit.Hooks.pt.useMDMS(d,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,E]=n.useState({}),[_,y]=n.useState({}),[S,b]=n.useState([]),[A,D]=n.useState({}),[C,T]=n.useState(null),[N,I]=n.useState(null),[w,O]=n.useState(null),[x,R]=n.useState([]),[L,P]=n.useState(null);n.useEffect(()=>{var e;h&&h["egf-master"]&&R(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]);const{data:M}=Digit.Hooks.useCustomMDMS(d,"common-masters",[{name:"Department"}]);function B(e){T(e.target.files[0])}return n.useEffect(()=>{if(m&&M){var e;const t=M["common-masters"].Department;b(null==m||null===(e=m.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,r=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",r),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==r?void 0:r.name)}}))}},[m]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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(()=>{a&&E((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:A,setSelectedApprover:D,selectFile:B,uploadedFile:N,setUploadedFile:I,businessService:p}))},[a,S,x,L,N]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(oe,{label:r(g.label.heading)}),headerBarEnd:l.createElement(ae,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(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=u({},v,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),c({Licenses:[v]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},de=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),se=()=>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"})),ce=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(se,null)),ve=e=>{var i,o;let{t:r,action:a,tenantId:d,closeModal:s,submitAction:c,applicationData:v,businessService:p}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,A]=n.useState({}),[D,C]=n.useState(null),[T,N]=n.useState(null),[I,w]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function x(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(null==m||null===(e=m.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}}))},[m]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",D,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{a&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:r,action:a,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:p,error:I}))},[a,y,T,I]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(de,{label:r(h.label.heading)}),headerBarEnd:l.createElement(ce,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:T?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null}),c({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},pe=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"})),fe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(me,null)),he=e=>{var i,o,a,d,s,c,v,p,m,f,h,g;let{t:E,action:_,tenantId:y,closeModal:S,submitAction:b,applicationDetails:A,applicationData:D,businessService:C,workflowDetails:T,blockReason:N}=e;console.log("applicationData",D),console.log("workflowDetails",T),Digit.Hooks.obps.useObpsAPI(null!==(i=D)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.city?null===(d=D)||void 0===d||null===(s=d.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:y,!1);const{data:I,isLoading:w}=Digit.Hooks.useEmployeeSearch(y,{roles:null==T||null===(v=T.data)||void 0===v||null===(p=v.initialActionState)||void 0===p||null===(m=p.nextActions)||void 0===m||null===(f=m.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[O,x]=(r.useQueryClient(),n.useState({})),[R,L]=n.useState({}),[P,M]=n.useState([]),[B,k]=n.useState([]),[F,V]=n.useState({}),[U,j]=n.useState({}),[H,W]=n.useState(null),[z,K]=n.useState(null),[G,Y]=n.useState(null),[q,Z]=n.useState(null),$=!!Digit.Utils.browser.isMobile();function X(e){W(e.target.files[0])}n.useEffect(()=>{var e;M(null==I||null===(e=I.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}}))},[I]),n.useEffect(()=>{!function(){try{Y(null);const e=function(){if(H){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(H.size>=5242880)Y(E("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=H&&H.type&&!e.test(null==H?void 0:H.type))Y(E("NOT_SUPPORTED_FILE_TYPE"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",H,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?K(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):Y(E("CS_FILE_UPLOAD_ERROR"))})},function(){Y(E("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)}}()},[H]);const J=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},Q=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},te=e=>{var t,n;let l=[],i=[];var o,r;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===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{i.push({docs:J(e.Documents),date:e.InspectionDate,questions:Q(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=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,r,a;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},le=()=>{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(()=>{k(null==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&x((e=>{var n,i,o,r,a,u,d;let{t:s,action:c,approvers:v,selectedApprover:p,setSelectedApprover:m,selectedBlockReason:f,setBlockReason:h,selectFile:g,uploadedFile:E,setUploadedFile:_,assigneeLabel:y,businessService:S,error:b,blockReasonFiltered:A}=e,D=!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)||(D=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+S+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||D||"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||D||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)?null:l.createElement(t.Dropdown,{option:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:p})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(d=c.state)||void 0===d?void 0:d.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,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:()=>{_(null)},message:E?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:E,action:_,approvers:P,selectedApprover:F,setSelectedApprover:V,selectedBlockReason:U,setBlockReason:j,selectFile:X,uploadedFile:z,setUploadedFile:K,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:B}))},[_,P,q,z,G]),_&&O.form?l.createElement(t.Modal,{headerBarMain:l.createElement(pe,{label:E(O.label.heading)}),headerBarEnd:l.createElement(fe,{onClick:S}),actionCancelLabel:E(O.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:E(O.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:$?{width:"720px"}:{},style:$?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:$?{paddingLeft:"5px"}:{}},w?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:O.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,r,a,d,s,c,v,p,m,f,h,g,C,N,I,w,O,x,R,L,P,M,B;D=u({},D,{documents:ne(),additionalDetails:u({},null===(t=D)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:te(D),pendingapproval:le(),blockingReason:null==U?void 0:U.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(i=T.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.state)||void 0===a?void 0:a.applicationStatus)?[null==T||null===(d=T.data)||void 0===d||null===(s=d.processInstances)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.assigner)||void 0===v?void 0:v.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(p=T.data)||void 0===p||null===(m=p.processInstances)||void 0===m||null===(f=m[0])||void 0===f||null===(h=f.state)||void 0===h?void 0:h.applicationStatus)?[null==T||null===(g=T.data)||void 0===g||null===(C=g.processInstances)||void 0===C||null===(N=C[0])||void 0===N||null===(I=N.assigner)||void 0===I?void 0:I.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,varificationDocuments:z?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==H?void 0:H.name,fileStoreId:z}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(w=T.data)||void 0===w||null===(O=w.processInstances)||void 0===O||null===(x=O[0])||void 0===x||null===(R=x.state)||void 0===R?void 0:R.applicationStatus)?[null==T||null===(L=T.data)||void 0===L||null===(P=L.processInstances)||void 0===P||null===(M=P[0])||void 0===M||null===(B=M.assigner)||void 0===B?void 0:B.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,wfDocuments:z?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==H?void 0:H.name,fileStoreId:z}]:null});const k=function(e,t,n,l,i,o,r,a,d,s,c,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=D)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=D)||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===(r=D)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(d=a.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null===(s=D)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(v=c.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS))){var p,m,f;D.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",D.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",D.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",D.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),D.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==A||null===(p=A.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(m=e[0])||void 0===m||null===(f=m.Noc)||void 0===f?void 0:f.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())||1!=l&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,n,r,a,u,d,s,c,v,p,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==D.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:D},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(S(),alert(E("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:D},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}S(),alert(E("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(k&&k.then?k.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(t.Loader,null)},ge=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ee=()=>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"})),_e=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ee,null)),ye=e=>{var i,a;let{t:d,action:s,tenantId:c,closeModal:v,submitAction:p,applicationData:m,businessService:f}=e;const{data:h,isLoading:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[E,_]=(r.useQueryClient(),n.useState({})),[y,S]=n.useState({}),[b,A]=n.useState([]),[D,C]=n.useState({}),[T,N]=n.useState(null),[I,w]=n.useState(null),[O,x]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function L(e){N(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;A(null==h||null===(e=h.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}}))},[h]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)x(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))x(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,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(d("CS_FILE_UPLOAD_ERROR"))})},function(){x(d("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{s&&_((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,error:m}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:d,action:s,approvers:b,selectedApprover:D,setSelectedApprover:C,selectFile:L,uploadedFile:I,setUploadedFile:w,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[s,b,I,O]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ge,{label:d(E.label.heading)}),headerBarEnd:l.createElement(_e,{onClick:v}),actionCancelLabel:d(E.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:d(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},g?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){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m=u({},m,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,documents:I?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:I}]:null},documents:o}),p({Noc:m},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};var Se=function(e,t){return e===t||e!=e&&t!=t},be=function(e,t){for(var n=e.length;n--;)if(Se(e[n][0],t))return n;return-1},Ae=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=be(t,e);return!(n<0||(n==t.length-1?t.pop():Ae.call(t,n,1),--this.size,0))},De.prototype.get=function(e){var t=this.__data__,n=be(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return be(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,l=be(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ce,Te=De,Ne="object"==typeof z&&z&&z.Object===Object&&z,Ie="object"==typeof self&&self&&self.Object===Object&&self,we=Ne||Ie||Function("return this")(),Oe=we.Symbol,xe=Object.prototype,Re=xe.hasOwnProperty,Le=xe.toString,Pe=Oe?Oe.toStringTag:void 0,Me=Object.prototype.toString,Be=Oe?Oe.toStringTag:void 0,ke=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Be&&Be in Object(e)?function(e){var t=Re.call(e,Pe),n=e[Pe];try{e[Pe]=void 0;var l=!0}catch(e){}var i=Le.call(e);return l&&(t?e[Pe]=n:delete e[Pe]),i}(e):function(e){return Me.call(e)}(e)},Fe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ve=function(e){if(!Fe(e))return!1;var t=ke(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ue=we["__core-js_shared__"],je=(Ce=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||""))?"Symbol(src)_1."+Ce:"",He=Function.prototype.toString,We=function(e){if(null!=e){try{return He.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ze=/^\[object .+?Constructor\]$/,Ke=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Fe(e)||(t=e,je&&je in t))&&(Ve(e)?Ke:ze).test(We(e));var t}(n)?n:void 0},Ye=Ge(we,"Map"),qe=Ge(Object,"create"),Ze=Object.prototype.hasOwnProperty,$e=Object.prototype.hasOwnProperty;function Xe(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])}}Xe.prototype.clear=function(){this.__data__=qe?qe(null):{},this.size=0},Xe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Xe.prototype.get=function(e){var t=this.__data__;if(qe){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ze.call(t,e)?t[e]:void 0},Xe.prototype.has=function(e){var t=this.__data__;return qe?void 0!==t[e]:$e.call(t,e)},Xe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qe&&void 0===t?"__lodash_hash_undefined__":t,this};var Je=Xe,Qe=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 et(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])}}et.prototype.clear=function(){this.size=0,this.__data__={hash:new Je,map:new(Ye||Te),string:new Je}},et.prototype.delete=function(e){var t=Qe(this,e).delete(e);return this.size-=t?1:0,t},et.prototype.get=function(e){return Qe(this,e).get(e)},et.prototype.has=function(e){return Qe(this,e).has(e)},et.prototype.set=function(e,t){var n=Qe(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var tt=et;function nt(e){var t=this.__data__=new Te(e);this.size=t.size}nt.prototype.clear=function(){this.__data__=new Te,this.size=0},nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nt.prototype.get=function(e){return this.__data__.get(e)},nt.prototype.has=function(e){return this.__data__.has(e)},nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Te){var l=n.__data__;if(!Ye||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new tt(l)}return n.set(e,t),this.size=n.size,this};var lt=nt,it=function(){try{var e=Ge(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ot=function(e,t,n){"__proto__"==t&&it?it(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},rt=Object.prototype.hasOwnProperty,at=function(e,t,n){var l=e[t];rt.call(e,t)&&Se(l,n)&&(void 0!==n||t in e)||ot(e,t,n)},ut=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?ot(n,a,u):at(n,a,u)}return n},dt=function(e){return null!=e&&"object"==typeof e},st=function(e){return dt(e)&&"[object Arguments]"==ke(e)},ct=Object.prototype,vt=ct.hasOwnProperty,pt=ct.propertyIsEnumerable,mt=st(function(){return arguments}())?st:function(e){return dt(e)&&vt.call(e,"callee")&&!pt.call(e,"callee")},ft=Array.isArray,ht=function(){return!1},gt=K(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?we.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ht}),Et=/^(?:0|[1-9]\d*)$/,_t=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Et.test(e))&&e>-1&&e%1==0&&e<t},yt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},St={};St["[object Float32Array]"]=St["[object Float64Array]"]=St["[object Int8Array]"]=St["[object Int16Array]"]=St["[object Int32Array]"]=St["[object Uint8Array]"]=St["[object Uint8ClampedArray]"]=St["[object Uint16Array]"]=St["[object Uint32Array]"]=!0,St["[object Arguments]"]=St["[object Array]"]=St["[object ArrayBuffer]"]=St["[object Boolean]"]=St["[object DataView]"]=St["[object Date]"]=St["[object Error]"]=St["[object Function]"]=St["[object Map]"]=St["[object Number]"]=St["[object Object]"]=St["[object RegExp]"]=St["[object Set]"]=St["[object String]"]=St["[object WeakMap]"]=!1;var bt=function(e){return function(t){return e(t)}},At=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=At&&At.isTypedArray,Ct=Dt?bt(Dt):function(e){return dt(e)&&yt(e.length)&&!!St[ke(e)]},Tt=Object.prototype.hasOwnProperty,Nt=function(e,t){var n=ft(e),l=!n&&mt(e),i=!n&&!l&&gt(e),o=!n&&!l&&!i&&Ct(e),r=n||l||i||o,a=r?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var d in e)!t&&!Tt.call(e,d)||r&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||_t(d,u))||a.push(d);return a},It=Object.prototype,wt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||It)},Ot=function(e,t){return function(n){return e(t(n))}},xt=Ot(Object.keys,Object),Rt=Object.prototype.hasOwnProperty,Lt=function(e){return null!=e&&yt(e.length)&&!Ve(e)},Pt=function(e){return Lt(e)?Nt(e):function(e){if(!wt(e))return xt(e);var t=[];for(var n in Object(e))Rt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Mt=Object.prototype.hasOwnProperty,Bt=function(e){return Lt(e)?Nt(e,!0):function(e){if(!Fe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=wt(e),n=[];for(var l in e)("constructor"!=l||!t&&Mt.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?we.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}}),Ft=function(){return[]},Vt=Object.prototype.propertyIsEnumerable,Ut=Object.getOwnPropertySymbols,jt=Ut?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,r=[];++l<i;){var a=t[l];Vt.call(e,a)&&(r[o++]=a)}return r}(Ut(e)))}:Ft,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),zt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ht(t,jt(e)),e=Wt(e);return t}:Ft,Kt=function(e,t,n){var l=t(e);return ft(e)?l:Ht(l,n(e))},Gt=function(e){return Kt(e,Pt,jt)},Yt=function(e){return Kt(e,Bt,zt)},qt=Ge(we,"DataView"),Zt=Ge(we,"Promise"),$t=Ge(we,"Set"),Xt=Ge(we,"WeakMap"),Jt=We(qt),Qt=We(Ye),en=We(Zt),tn=We($t),nn=We(Xt),ln=ke;(qt&&"[object DataView]"!=ln(new qt(new ArrayBuffer(1)))||Ye&&"[object Map]"!=ln(new Ye)||Zt&&"[object Promise]"!=ln(Zt.resolve())||$t&&"[object Set]"!=ln(new $t)||Xt&&"[object WeakMap]"!=ln(new Xt))&&(ln=function(e){var t=ke(e),n="[object Object]"==t?e.constructor:void 0,l=n?We(n):"";if(l)switch(l){case Jt:return"[object DataView]";case Qt:return"[object Map]";case en:return"[object Promise]";case tn:return"[object Set]";case nn:return"[object WeakMap]"}return t});var on=ln,rn=Object.prototype.hasOwnProperty,an=we.Uint8Array,un=function(e){var t=new e.constructor(e.byteLength);return new an(t).set(new an(e)),t},dn=/\w*$/,sn=Oe?Oe.prototype:void 0,cn=sn?sn.valueOf:void 0,vn=Object.create,pn=function(){function e(){}return function(t){if(!Fe(t))return{};if(vn)return vn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mn=At&&At.isMap,fn=mn?bt(mn):function(e){return dt(e)&&"[object Map]"==on(e)},hn=At&&At.isSet,gn=hn?bt(hn):function(e){return dt(e)&&"[object Set]"==on(e)},En={};En["[object Arguments]"]=En["[object Array]"]=En["[object ArrayBuffer]"]=En["[object DataView]"]=En["[object Boolean]"]=En["[object Date]"]=En["[object Float32Array]"]=En["[object Float64Array]"]=En["[object Int8Array]"]=En["[object Int16Array]"]=En["[object Int32Array]"]=En["[object Map]"]=En["[object Number]"]=En["[object Object]"]=En["[object RegExp]"]=En["[object Set]"]=En["[object String]"]=En["[object Symbol]"]=En["[object Uint8Array]"]=En["[object Uint8ClampedArray]"]=En["[object Uint16Array]"]=En["[object Uint32Array]"]=!0,En["[object Error]"]=En["[object Function]"]=En["[object WeakMap]"]=!1;var _n=function e(t,n,l,i,o,r){var a,u=1&n,d=2&n,s=4&n;if(l&&(a=o?l(t,i,o,r):l(t)),void 0!==a)return a;if(!Fe(t))return t;var c=ft(t);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&rn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,a)}else{var v=on(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(gt(t))return kt(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!o){if(a=d||p?{}:function(e){return"function"!=typeof e.constructor||wt(e)?{}:pn(Wt(e))}(t),!u)return d?function(e,t){return ut(e,zt(e),t)}(t,function(e,t){return e&&ut(t,Bt(t),e)}(a,t)):function(e,t){return ut(e,jt(e),t)}(t,function(e,t){return e&&ut(t,Pt(t),e)}(a,t))}else{if(!En[v])return o?t:{};a=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return un(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?un(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?un(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 cn?Object(cn.call(e)):{}}}(t,v,u)}}r||(r=new lt);var m=r.get(t);if(m)return m;r.set(t,a),gn(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):fn(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=c?void 0:(s?d?Yt:Gt:d?Bt:Pt)(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(a,o,e(i,n,l,o,t,r))}),a},yn=function(e){return _n(e,5)};const Sn=e=>l.createElement("h1",{className:"heading-m"},e.label),bn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),An=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(bn,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}},Cn=e=>{var i,o;let{t:r,action:a,tenantId:d,closeModal:s,submitAction:c,applicationData:v,businessService:p}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,A]=n.useState({}),[D,C]=n.useState(null),[T,N]=n.useState(null),[I,w]=n.useState(null),O=window.Digit.Utils.browser.isMobile(),x=window.location.href.includes("/employee");function R(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(null==m||null===(e=m.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}}))},[m]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",D,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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{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)?a&&g((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:d,selectFile:s,uploadedFile:c,setUploadedFile:v,businessService:p,error:m}=e,f=!0,h=!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)||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:a}):null},h&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!h,type:"custom",populators:h?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({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:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:T,setUploadedFile:N,businessService:p,error:I})):a&&g((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:v,error:p}=e,m=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:T,setUploadedFile:N,businessService:p,error:I}))},[a,y,T,I]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Sn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(An,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:O&&x?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,r,s,p,m,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var h,g,E,_,y,S,A,C,N;const t=u({},null===(h=v)||void 0===h||null===(g=h.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(E=v)||void 0===E?void 0:E.billAmendmentDetails,{workflow:{businessId:null===(_=v)||void 0===_||null===(y=_.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==a?void 0:a.action,tenantId:d,businessService:null!==(S=v)&&void 0!==S&&null!==(A=S.applicationType)&&void 0!==A&&A.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=v)&&void 0!==C&&null!==(N=C.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==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:T?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:[]}});c({AmendmentUpdate:n})}else{if(v=u({},v,{action:null==a?void 0:a.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==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null,processInstance:u({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.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=yn(null==e?void 0:e.date);v.disconnectionExecutionDate=Dn(t)}else if(null!=e&&e.date){const t=yn(null==e?void 0:e.date);v.connectionExecutionDate=Dn(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(p=s.processInstance)||void 0===p?void 0:p.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===(m=v)||void 0===m?void 0:m.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,j;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===(j=v)||void 0===j?void 0:j.serviceType)?c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Tn=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"})),In=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Nn,null)),wn=e=>{var i,o;let{t:r,action:a,tenantId:d,closeModal:s,submitAction:c,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,g]=n.useState({}),[E,_]=n.useState({}),[y,S]=n.useState([]),[b,A]=n.useState(null),[D,C]=n.useState(null),[T,N]=n.useState(null),[I,w]=n.useState(null),[O,x]=n.useState(!1);function R(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{a&&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:r,action:a,approvers:y,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:T,setUploadedFile:N,businessService:p}))},[a,y,T]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Tn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(In,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==a?void 0:a.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};v.creationReason="CREATE",c({PetRegistrationApplications:[u({},v,{workflow:t})]})}let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=a&&a.isTerminateState||!b?[]:[b],T&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]),c({PetRegistrationApplications:[u({},v,{workflow:t})]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},On=e=>null!=e&&e.businessService.includes("PT")?l.createElement(ie,e):null!=e&&e.businessService.includes("ptr")?l.createElement(wn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(ue,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ve,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(he,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(ye,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Cn,e):void 0;function xn(e){let{documents:n,svgStyles:o={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:d}=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:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==n?void 0:n.title)),r?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),r?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),a&&(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"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(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"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}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]",r="[object Array]",a="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",f="[object RegExp]",h="[object Set]",g="[object String]",E="[object Symbol]",_="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",b="[object Float32Array]",A="[object Float64Array]",D="[object Int8Array]",C="[object Int16Array]",T="[object Int32Array]",N="[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)\]/,j=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,K=RegExp(W.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,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",pe="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+he+")",Ae="(?:"+Se+"|"+he+")",De="(?:"+pe+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[Ee,_e,ye].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",_e,ye].join("|")+")"+Ce,Ne="(?:"+[Ee+pe+"?",pe,_e,ye,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),we=RegExp(pe,"g"),Oe=RegExp(ge+"(?="+ge+")|"+Ne+Ce,"g"),xe=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Te].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[A]=Be[D]=Be[C]=Be[T]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[I]=Be[w]=!0,Be[o]=Be[r]=Be[y]=Be[a]=Be[S]=Be[u]=Be[d]=Be[s]=Be[v]=Be[p]=Be[m]=Be[f]=Be[h]=Be[g]=Be[_]=!1;var ke={};ke[o]=ke[r]=ke[y]=ke[S]=ke[a]=ke[u]=ke[b]=ke[A]=ke[D]=ke[C]=ke[T]=ke[v]=ke[p]=ke[m]=ke[f]=ke[h]=ke[g]=ke[E]=ke[N]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[w]=!0,ke[d]=ke[s]=ke[_]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Ue=parseInt,je="object"==typeof z&&z&&z.Object===Object&&z,He="object"==typeof self&&self&&self.Object===Object&&self,We=je||He||Function("return this")(),ze=t&&!t.nodeType&&t,Ke=ze&&e&&!e.nodeType&&e,Ge=Ke&&Ke.exports===ze,Ye=Ge&&je.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 r=e[i];t(l,r,n(r),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 rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function ct(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function pt(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 mt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(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):ht(e,_t,n)}function Et(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function _t(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Dt(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 Tt(e){return e?e.slice(0,zt(e)+1).replace(G,""):e}function Nt(e){return function(t){return e(t)}}function It(e,t){return dt(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,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Ht(e){return Bt(e)?function(e){for(var t=Oe.lastIndex=0;Oe.test(e);)++t;return t}(e):mt(e)}function Wt(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=(t=null==t?We:Gt.defaults(We.Object(),t,Gt.pick(We,Pe))).Array,Y=t.Date,se=t.Error,ce=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,fe=t.String,he=t.TypeError,ge=z.prototype,Ee=pe.prototype,_e=t["__core-js_shared__"],ye=ce.prototype.toString,Se=Ee.hasOwnProperty,be=0,Ae=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=Ee.toString,Ce=ye.call(pe),Te=We._,Ne=me("^"+ye.call(Se).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=Ge?t.Buffer:void 0,Re=t.Symbol,Fe=t.Uint8Array,je=Oe?Oe.allocUnsafe:void 0,He=Ft(pe.getPrototypeOf,pe),ze=pe.create,Ke=Ee.propertyIsEnumerable,Ye=ge.splice,qe=Re?Re.isConcatSpreadable:void 0,mt=Re?Re.iterator:void 0,bt=Re?Re.toStringTag:void 0,Yt=function(){try{var e=Xi(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,Zt=Y&&Y.now!==We.Date.now&&Y.now,$t=t.setTimeout!==We.setTimeout&&t.setTimeout,Xt=ve.ceil,Jt=ve.floor,Qt=pe.getOwnPropertySymbols,en=Oe?Oe.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ft(pe.keys,pe),on=ve.max,rn=ve.min,an=Y.now,un=t.parseInt,dn=ve.random,sn=ge.reverse,cn=Xi(t,"DataView"),vn=Xi(t,"Map"),pn=Xi(t,"Promise"),mn=Xi(t,"Set"),fn=Xi(t,"WeakMap"),hn=Xi(pe,"create"),gn=fn&&new fn,En={},_n=No(cn),yn=No(vn),Sn=No(pn),bn=No(mn),An=No(fn),Dn=Re?Re.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,Tn=Dn?Dn.toString:void 0;function Nn(e){if(zr(e)&&!Lr(e)&&!(e instanceof xn)){if(e instanceof On)return e;if(Se.call(e,"__wrapped__"))return Io(e)}return new On(e)}var In=function(){function e(){}return function(t){if(!Wr(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function wn(){}function On(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function xn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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.__data__=new Pn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Ln(e);this.size=t.size}function kn(e,t){var n=Lr(e),l=!n&&Rr(e),i=!n&&!l&&kr(e),o=!n&&!l&&!i&&Jr(e),r=n||l||i||o,a=r?Ct(e.length,fe):[],u=a.length;for(var d in e)!t&&!Se.call(e,d)||r&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||a.push(d);return a}function Fn(e){var t=e.length;return t?e[Pl(0,t-1)]:void 0}function Vn(e,t){return bo(fi(e),qn(t,0,e.length))}function Un(e){return bo(fi(e))}function jn(e,t,n){(void 0!==n&&!wr(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var l=e[t];Se.call(e,t)&&wr(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(wr(e[n][0],t))return n;return-1}function zn(e,t,n,l){return Qn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Kn(e,t){return e&&hi(t,ya(t),e)}function Gn(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,l=t.length,i=z(l),o=null==e;++n<l;)i[n]=o?void 0:fa(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Zn(e,t,n,l,i,r){var d,_=1&t,O=2&t,x=4&t;if(n&&(d=i?n(e,l,i,r):n(e)),void 0!==d)return d;if(!Wr(e))return e;var R=Lr(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!_)return fi(e,d)}else{var L=eo(e),P=L==s||L==c;if(kr(e))return di(e,_);if(L==m||L==o||P&&!i){if(d=O||P?{}:no(e),!_)return O?function(e,t){return hi(e,Qi(e),t)}(e,function(e,t){return e&&hi(t,Sa(t),e)}(d,e)):function(e,t){return hi(e,Ji(e),t)}(e,Kn(d,e))}else{if(!ke[L])return i?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case y:return si(e);case a:case u:return new l(+e);case S:return function(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case A:case D:case C:case T:case N:case"[object Uint8ClampedArray]":case I:case w:return ci(e,n);case v:return new l;case p: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 h:return new l;case E:return Cn?pe(Cn.call(e)):{}}}(e,L,_)}}r||(r=new Bn);var M=r.get(e);if(M)return M;r.set(e,d),Zr(e)?e.forEach(function(l){d.add(Zn(l,t,n,l,e,r))}):Kr(e)&&e.forEach(function(l,i){d.set(i,Zn(l,t,n,i,e,r))});var B=R?void 0:(x?O?zi:Wi:O?Sa:ya)(e);return lt(B||e,function(l,i){B&&(l=e[i=l]),Hn(d,i,Zn(l,t,n,i,e,r))}),d}function $n(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 Xn(e,t,l){if("function"!=typeof e)throw new he(n);return Eo(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],d=t.length;if(!a)return u;n&&(t=dt(t,Nt(n))),l?(o=ut,r=!1):t.length>=200&&(o=wt,r=!1,t=new Mn(t));e:for(;++i<a;){var s=e[i],c=null==n?s:n(s);if(s=l||0!==s?s:0,r&&c==c){for(var v=d;v--;)if(t[v]===c)continue e;u.push(s)}else o(t,c,l)||u.push(s)}return u}Nn.templateSettings={escape:k,evaluate:F,interpolate:V,variable:"",imports:{_:Nn}},(Nn.prototype=wn.prototype).constructor=Nn,(On.prototype=In(wn.prototype)).constructor=On,(xn.prototype=In(wn.prototype)).constructor=xn,Rn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:Se.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0||(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return Wn(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=Wn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(vn||Ln),string:new Rn}},Pn.prototype.delete=function(e){var t=Zi(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Zi(this,e).get(e)},Pn.prototype.has=function(e){return Zi(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Zi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Ln,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 Ln){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(l)}return n.set(e,t),this.size=n.size,this};var Qn=_i(al),el=_i(ul,!0);function tl(e,t){var n=!0;return Qn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],r=t(o);if(null!=r&&(void 0===a?r==r&&!Xr(r):n(r,a)))var a=r,u=o}return u}function ll(e,t){var n=[];return Qn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,r=e.length;for(n||(n=lo),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?il(a,t-1,n,l,i):st(i,a):l||(i[i.length]=a)}return i}var ol=yi(),rl=yi(!0);function al(e,t){return e&&ol(e,t,ya)}function ul(e,t){return e&&rl(e,t,ya)}function dl(e,t){return rt(t,function(t){return Ur(e[t])})}function sl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[To(t[n++])];return n&&n==l?e:void 0}function cl(e,t,n){var l=t(e);return Lr(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in pe(e)?function(e){var t=Se.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=De.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return De.call(e)}(e)}function pl(e,t){return e>t}function ml(e,t){return null!=e&&Se.call(e,t)}function fl(e,t){return null!=e&&t in pe(e)}function hl(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=z(o),u=Infinity,d=[];r--;){var s=e[r];r&&t&&(s=dt(s,Nt(t))),u=rn(s.length,u),a[r]=!n&&(t||i>=120&&s.length>=120)?new Mn(r&&s):void 0}s=e[0];var c=-1,v=a[0];e:for(;++c<i&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?wt(v,m):l(d,m,n))){for(r=o;--r;){var f=a[r];if(!(f?wt(f,m):l(e[r],m,n)))continue e}v&&v.push(m),d.push(p)}}return d}function gl(e,t,n){var l=null==(e=mo(e,t=oi(t,e)))?e:e[To(Vo(t))];return null==l?void 0:tt(l,e,n)}function El(e){return zr(e)&&vl(e)==o}function _l(e,t,n,l,i){return e===t||(null==e||null==t||!zr(e)&&!zr(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var c=Lr(e),_=Lr(t),b=c?r:eo(e),A=_?r:eo(t),D=(b=b==o?m:b)==m,C=(A=A==o?m:A)==m,T=b==A;if(T&&kr(e)){if(!kr(t))return!1;c=!0,D=!1}if(T&&!D)return s||(s=new Bn),c||Jr(e)?ji(e,t,n,l,i,s):function(e,t,n,l,i,o,r){switch(n){case S: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 Fe(e),new Fe(t)));case a:case u:case p:return wr(+e,+t);case d:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v:var s=kt;case h:if(s||(s=Ut),e.size!=t.size&&!(1&l))return!1;var c=r.get(e);if(c)return c==t;l|=2,r.set(e,t);var m=ji(s(e),s(t),l,i,o,r);return r.delete(e),m;case E:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,b,n,l,i,s);if(!(1&n)){var N=D&&Se.call(e,"__wrapped__"),I=C&&Se.call(t,"__wrapped__");if(N||I){var w=N?e.value():e,O=I?t.value():t;return s||(s=new Bn),i(w,O,n,l,s)}}return!!T&&(s||(s=new Bn),function(e,t,n,l,i,o){var r=1&n,a=Wi(e),u=a.length;if(u!=Wi(t).length&&!r)return!1;for(var d=u;d--;){var s=a[d];if(!(r?s in t:Se.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=r;++d<u;){var f=e[s=a[d]],h=t[s];if(l)var g=r?l(h,f,s,t,e,o):l(f,h,s,e,t,o);if(!(void 0===g?f===h||i(f,h,n,l,o):g)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var E=e.constructor,_=t.constructor;E==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,l,i,s))}(e,t,n,l,_l,i))}function yl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=pe(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],d=e[u],s=a[1];if(r&&a[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Bn;if(l)var v=l(d,s,u,e,t,c);if(!(void 0===v?_l(s,d,3,l,c):v))return!1}}return!0}function Sl(e){return!(!Wr(e)||(t=e,Ae&&Ae in t))&&(Ur(e)?Ne:ie).test(No(e));var t}function bl(e){return"function"==typeof e?e:null==e?Ga:"object"==typeof e?Lr(e)?Nl(e[0],e[1]):Tl(e):tu(e)}function Al(e){if(!so(e))return ln(e);var t=[];for(var n in pe(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Dl(e,t){return e<t}function Cl(e,t){var n=-1,l=Mr(e)?z(e.length):[];return Qn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Tl(e){var t=$i(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||yl(n,e,t)}}function Nl(e,t){return ro(e)&&co(t)?vo(To(e),t):function(n){var l=fa(n,e);return void 0===l&&l===t?ha(n,e):_l(t,l,3)}}function Il(e,t,n,l,i){e!==t&&ol(t,function(o,r){if(i||(i=new Bn),Wr(o))!function(e,t,n,l,i,o,r){var a=ho(e,n),u=ho(t,n),d=r.get(u);if(d)jn(e,n,d);else{var s=o?o(a,u,n+"",e,t,r):void 0,c=void 0===s;if(c){var v=Lr(u),p=!v&&kr(u),m=!v&&!p&&Jr(u);s=u,v||p||m?Lr(a)?s=a:Br(a)?s=fi(a):p?(c=!1,s=di(u,!0)):m?(c=!1,s=ci(u,!0)):s=[]:Yr(u)||Rr(u)?(s=a,Rr(a)?s=ra(a):Wr(a)&&!Ur(a)||(s=no(u))):c=!1}c&&(r.set(u,s),i(s,u,l,o,r),r.delete(u)),jn(e,n,s)}}(e,t,r,n,Il,l,i);else{var a=l?l(ho(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),jn(e,r,a)}},Sa)}function wl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Ol(e,t,n){t=t.length?dt(t,function(e){return Lr(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[Ga];var l=-1;return t=dt(t,Nt(qi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,r=i.length,a=n.length;++l<r;){var u=vi(i[l],o[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Cl(e,function(e,n,i){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function xl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var r=t[l],a=sl(e,r);n(a,r)&&Vl(o,oi(r,e),a)}return o}function Rl(e,t,n,l){var i=l?Et:gt,o=-1,r=t.length,a=e;for(e===t&&(t=fi(t)),n&&(a=dt(e,Nt(n)));++o<r;)for(var u=0,d=t[o],s=n?n(d):d;(u=i(a,s,u,l))>-1;)a!==e&&Ye.call(a,u,1),Ye.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?Ye.call(e,i,1):Xl(e,i)}}return e}function Pl(e,t){return e+Jt(dn()*(t-e+1))}function Ml(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Bl(e,t){return _o(po(e,t,Ga),e+"")}function kl(e){return Fn(wa(e))}function Fl(e,t){var n=wa(e);return bo(n,qn(t,0,n.length))}function Vl(e,t,n,l){if(!Wr(e))return e;for(var i=-1,o=(t=oi(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=To(t[i]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var s=a[u];void 0===(d=l?l(s,u,a):void 0)&&(d=Wr(s)?s:io(t[i+1])?[]:{})}Hn(a,u,d),a=a[u]}return e}var Ul=gn?function(e,t){return gn.set(e,t),e}:Ga,jl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Wa(t),writable:!0})}:Ga;function Hl(e){return bo(wa(e))}function Wl(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=z(i);++l<i;)o[l]=e[l+t];return o}function zl(e,t){var n;return Qn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Kl(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,r=e[o];null!==r&&!Xr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Gl(e,t,Ga,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Xr(t),d=void 0===t;i<o;){var s=Jt((i+o)/2),c=n(e[s]),v=void 0!==c,p=null===c,m=c==c,f=Xr(c);if(r)var h=l||m;else h=d?m&&(l||v):a?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?c<=t:c<t);h?i=s+1:o=s}return rn(o,4294967294)}function Yl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!wr(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function ql(e){return"number"==typeof e?e:Xr(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(Lr(e))return dt(e,Zl)+"";if(Xr(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $l(e,t,n){var l=-1,i=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var d=t?null:Mi(e);if(d)return Ut(d);r=!1,i=wt,u=new Mn}else u=t?[]:a;e:for(;++l<o;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,r&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;t&&u.push(c),a.push(s)}else i(u,c,n)||(u!==a&&u.push(c),a.push(s))}return a}function Xl(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[To(Vo(t))]}function Jl(e,t,n,l){return Vl(e,t,n(sl(e,t)),l)}function Ql(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?Wl(e,l?0:o,l?o+1:i):Wl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof xn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?$l(e[0]):[];for(var i=-1,o=z(l);++i<l;)for(var r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Jn(o[i]||r,e[a],t,n));return $l(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function li(e){return Br(e)?e:[]}function ii(e){return"function"==typeof e?e:Ga}function oi(e,t){return Lr(e)?e:ro(e,t)?[e]:Co(aa(e))}var ri=Bl;function ai(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:Wl(e,t,n)}var ui=qt||function(e){return We.clearTimeout(e)};function di(e,t){if(t)return e.slice();var n=e.length,l=je?je(n):new e.constructor(n);return e.copy(l),l}function si(e){var t=new e.constructor(e.byteLength);return new Fe(t).set(new Fe(e)),t}function ci(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Xr(e),r=void 0!==t,a=null===t,u=t==t,d=Xr(t);if(!a&&!d&&!o&&e>t||o&&r&&u&&!a&&!d||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!d&&e<t||d&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function pi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,d=on(o-r,0),s=z(u+d),c=!l;++a<u;)s[a]=t[a];for(;++i<r;)(c||i<o)&&(s[n[i]]=e[i]);for(;d--;)s[a++]=e[i++];return s}function mi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,d=t.length,s=on(o-a,0),c=z(s+d),v=!l;++i<s;)c[i]=e[i];for(var p=i;++u<d;)c[p+u]=t[u];for(;++r<a;)(v||i<o)&&(c[p+n[r]]=e[i++]);return c}function fi(e,t){var n=-1,l=e.length;for(t||(t=z(l));++n<l;)t[n]=e[n];return t}function hi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Gn(n,a,u):Hn(n,a,u)}return n}function gi(e,t){return function(n,l){var i=Lr(n)?nt:zn,o=t?t():{};return i(n,e,qi(l,2),o)}}function Ei(e){return Bl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&oo(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=pe(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function _i(e,t){return function(n,l){if(null==n)return n;if(!Mr(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=pe(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function yi(e){return function(t,n,l){for(var i=-1,o=pe(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function Si(e){return function(t){var n=Bt(t=aa(t))?Wt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ai(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return ct(Ua(Ra(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=In(e.prototype),l=e.apply(n,t);return Wr(l)?l:n}}function Di(e){return function(t,n,l){var i=pe(t);if(!Mr(t)){var o=qi(n,3);t=ya(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Ci(e){return Hi(function(t){var l=t.length,i=l,o=On.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new he(n);if(o&&!a&&"wrapper"==Gi(r))var a=new On([],!0)}for(i=a?i:l;++i<l;){var u=Gi(r=t[i]),d="wrapper"==u?Ki(r):void 0;a=d&&ao(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[Gi(d[0])].apply(a,d[3]):1==r.length&&ao(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Lr(n))return a.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,r,a,u,d){var s=128&t,c=1&t,v=2&t,p=24&t,m=512&t,f=v?void 0:Ai(e);return function h(){for(var g=arguments.length,E=z(g),_=g;_--;)E[_]=arguments[_];if(p)var y=Yi(h),S=Rt(E,y);if(l&&(E=pi(E,l,i,p)),o&&(E=mi(E,o,r,p)),g-=S,p&&g<d){var b=Vt(E,y);return Li(e,t,Ti,h.placeholder,n,E,b,a,u,d-g)}var A=c?n:this,D=v?A[e]:e;return g=E.length,a?E=fo(E,a):m&&g>1&&E.reverse(),s&&u<g&&(E.length=u),this&&this!==We&&this instanceof h&&(D=f||Ai(D)),D.apply(A,E)}}function Ni(e,t){return function(n,l){return function(e,t,n,l){return al(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ii(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=Zl(n),l=Zl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function wi(e){return Hi(function(t){return t=dt(t,Nt(qi())),Bl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Oi(e,t){var n=(t=void 0===t?" ":Zl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Xt(e/Ht(t)));return Bt(t)?ai(Wt(l),0,e).join(""):l.slice(0,e)}function xi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n,l){for(var i=-1,o=on(Xt((t-e)/(n||1)),0),r=z(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:na(l),e)}}function Ri(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=oa(t),n=oa(n)),e(t,n)}}function Li(e,t,n,l,i,o,r,a,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?r:void 0,s?void 0:o,s?void 0:r,a,u,d],v=n.apply(void 0,c);return ao(e)&&go(v,c),v.placeholder=l,yo(v,e,t)}function Pi(e){var t=ve[e];return function(e,n){if(e=oa(e),(n=null==n?0:rn(la(n),292))&&tn(e)){var l=(aa(e)+"e").split("e");return+((l=(aa(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Mi=mn&&1/Ut(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Xa;function Bi(e){return function(t){var n=eo(t);return n==v?kt(t):n==h?jt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function ki(e,t,i,o,r,a,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new he(n);var c=o?o.length:0;if(c||(t&=-97,o=r=void 0),u=void 0===u?u:on(la(u),0),d=void 0===d?d:la(d),c-=r?r.length:0,64&t){var v=o,p=r;o=r=void 0}var m=s?void 0:Ki(e),f=[e,t,i,o,r,v,p,a,u,d];if(m&&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 r=t[3];if(r){var a=e[3];e[3]=a?pi(a,r,t[4]):r,e[4]=a?Vt(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?mi(a,r,t[6]):r,e[6]=a?Vt(e[5],l):t[6]),(r=t[7])&&(e[7]=r),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,m),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:on(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,r=z(o),a=o,u=Yi(i);a--;)r[a]=arguments[a];var d=o<3&&r[0]!==u&&r[o-1]!==u?[]:Vt(r,u);if((o-=d.length)<n)return Li(e,t,Ti,i.placeholder,void 0,r,d,void 0,void 0,n-o);var s=this&&this!==We&&this instanceof i?l:e;return tt(s,this,r)}}(e,t,d):32!=t&&33!=t||r.length?Ti.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var r=-1,a=arguments.length,u=-1,d=l.length,s=z(d+a),c=this&&this!==We&&this instanceof t?o:e;++u<d;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(c,i?n:this,s)}}(e,t,i,o);else var h=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==We&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return yo((m?Ul:go)(h,f),e,t)}function Fi(e,t,n,l){return void 0===e||wr(e,Ee[n])&&!Se.call(l,n)?t:e}function Vi(e,t,n,l,i,o){return Wr(e)&&Wr(t)&&(o.set(t,e),Il(e,t,void 0,Vi,o),o.delete(t)),e}function Ui(e){return Yr(e)?void 0:e}function ji(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,v=!0,p=2&n?new Mn:void 0;for(o.set(e,t),o.set(t,e);++c<a;){var m=e[c],f=t[c];if(l)var h=r?l(f,m,c,t,e,o):l(m,f,c,e,t,o);if(void 0!==h){if(h)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!wt(p,t)&&(m===e||i(m,e,n,l,o)))return p.push(t)})){v=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function Hi(e){return _o(po(e,void 0,Po),e+"")}function Wi(e){return cl(e,ya,Ji)}function zi(e){return cl(e,Sa,Qi)}var Ki=gn?function(e){return gn.get(e)}:Xa;function Gi(e){for(var t=e.name+"",n=En[t],l=Se.call(En,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Yi(e){return(Se.call(Nn,"placeholder")?Nn:e).placeholder}function qi(){var e=Nn.iteratee||Ya;return e=e===Ya?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Zi(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 $i(e){for(var t=ya(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Xi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Ji=Qt?function(e){return null==e?[]:(e=pe(e),rt(Qt(e),function(t){return Ke.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)st(t,Ji(e)),e=He(e);return t}:iu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var r=To(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Hr(i)&&io(r,i)&&(Lr(e)||Rr(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:In(He(e))}function lo(e){return Lr(e)||Rr(e)||!!(qe&&e&&e[qe])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!Wr(n))return!1;var l=typeof t;return!!("number"==l?Mr(n)&&io(t,n.length):"string"==l&&t in n)&&wr(n[t],e)}function ro(e,t){if(Lr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Xr(e))||j.test(e)||!U.test(e)||null!=t&&e in pe(t)}function ao(e){var t=Gi(e),n=Nn[t];if("function"!=typeof n||!(t in xn.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(cn&&eo(new cn(new ArrayBuffer(1)))!=S||vn&&eo(new vn)!=v||pn&&"[object Promise]"!=eo(pn.resolve())||mn&&eo(new mn)!=h||fn&&eo(new fn)!=_)&&(eo=function(e){var t=vl(e),n=t==m?e.constructor:void 0,l=n?No(n):"";if(l)switch(l){case _n:return S;case yn:return v;case Sn:return"[object Promise]";case bn:return h;case An:return _}return t});var uo=_e?Ur:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function co(e){return e==e&&!Wr(e)}function vo(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=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),r=z(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=z(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function mo(e,t){return t.length<2?e:sl(e,Wl(t,0,-1))}function fo(e,t){for(var n=e.length,l=rn(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function ho(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=So(Ul),Eo=$t||function(e,t){return We.setTimeout(e,t)},_o=So(jl);function yo(e,t,n){var l=t+"";return _o(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]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(Z);return t?t[1].split($):[]}(l),n)))}function So(e){var t=0,n=0;return function(){var l=an(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Pl(n,i),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var Ao,Do,Co=(Ao=Ar(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Do.size&&Do.clear(),e}),Do=Ao.cache,Ao);function To(e){if("string"==typeof e||Xr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function No(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Io(e){if(e instanceof xn)return e.clone();var t=new On(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var wo=Bl(function(e,t){return Br(e)?Jn(e,il(t,1,Br,!0)):[]}),Oo=Bl(function(e,t){var n=Vo(t);return Br(n)&&(n=void 0),Br(e)?Jn(e,il(t,1,Br,!0),qi(n,2)):[]}),xo=Bl(function(e,t){var n=Vo(t);return Br(n)&&(n=void 0),Br(e)?Jn(e,il(t,1,Br,!0),void 0,n):[]});function Ro(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:la(n);return i<0&&(i=on(l+i,0)),ht(e,qi(t,3),i)}function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=la(n),i=n<0?on(l+i,0):rn(i,l-1)),ht(e,qi(t,3),i,!0)}function Po(e){return null!=e&&e.length?il(e,1):[]}function Mo(e){return e&&e.length?e[0]:void 0}var Bo=Bl(function(e){var t=dt(e,li);return t.length&&t[0]===e[0]?hl(t):[]}),ko=Bl(function(e){var t=Vo(e),n=dt(e,li);return t===Vo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,qi(t,2)):[]}),Fo=Bl(function(e){var t=Vo(e),n=dt(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hl(n,void 0,t):[]});function Vo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Uo=Bl(jo);function jo(e,t){return e&&e.length&&t&&t.length?Rl(e,t):e}var Ho=Hi(function(e,t){var n=null==e?0:e.length,l=Yn(e,t);return Ll(e,dt(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function Wo(e){return null==e?e:sn.call(e)}var zo=Bl(function(e){return $l(il(e,1,Br,!0))}),Ko=Bl(function(e){var t=Vo(e);return Br(t)&&(t=void 0),$l(il(e,1,Br,!0),qi(t,2))}),Go=Bl(function(e){var t=Vo(e);return t="function"==typeof t?t:void 0,$l(il(e,1,Br,!0),void 0,t)});function Yo(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Br(e))return t=on(e.length,t),!0}),Ct(t,function(t){return dt(e,St(t))})}function qo(e,t){if(!e||!e.length)return[];var n=Yo(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var Zo=Bl(function(e,t){return Br(e)?Jn(e,t):[]}),$o=Bl(function(e){return ti(rt(e,Br))}),Xo=Bl(function(e){var t=Vo(e);return Br(t)&&(t=void 0),ti(rt(e,Br),qi(t,2))}),Jo=Bl(function(e){var t=Vo(e);return t="function"==typeof t?t:void 0,ti(rt(e,Br),void 0,t)}),Qo=Bl(Yo),er=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,qo(e,n)});function tr(e){var t=Nn(e);return t.__chain__=!0,t}function nr(e,t){return t(e)}var lr=Hi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof xn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:nr,args:[i],thisArg:void 0}),new On(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ir=gi(function(e,t,n){Se.call(e,n)?++e[n]:Gn(e,n,1)}),or=Di(Ro),rr=Di(Lo);function ar(e,t){return(Lr(e)?lt:Qn)(e,qi(t,3))}function ur(e,t){return(Lr(e)?it:el)(e,qi(t,3))}var dr=gi(function(e,t,n){Se.call(e,n)?e[n].push(t):Gn(e,n,[t])}),sr=Bl(function(e,t,n){var l=-1,i="function"==typeof t,o=Mr(e)?z(e.length):[];return Qn(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),cr=gi(function(e,t,n){Gn(e,n,t)});function vr(e,t){return(Lr(e)?dt:Cl)(e,qi(t,3))}var pr=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),mr=Bl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Ol(e,il(t,1),[])}),fr=Zt||function(){return We.Date.now()};function hr(e,t,n){return t=n?void 0:t,ki(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gr(e,t){var l;if("function"!=typeof t)throw new he(n);return e=la(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var Er=Bl(function(e,t,n){var l=1;if(n.length){var i=Vt(n,Yi(Er));l|=32}return ki(e,l,t,n,i)}),_r=Bl(function(e,t,n){var l=3;if(n.length){var i=Vt(n,Yi(_r));l|=32}return ki(t,l,e,n,i)});function yr(e,t,l){var i,o,r,a,u,d,s=0,c=!1,v=!1,p=!0;if("function"!=typeof e)throw new he(n);function m(t){var n=i,l=o;return i=o=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=Eo(g,t),c?m(e):a}function h(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-s>=r}function g(){var e=fr();if(h(e))return E(e);u=Eo(g,function(e){var n=t-(e-d);return v?rn(n,r-(e-s)):n}(e))}function E(e){return u=void 0,p&&i?m(e):(i=o=void 0,a)}function _(){var e=fr(),n=h(e);if(i=arguments,o=this,d=e,n){if(void 0===u)return f(d);if(v)return ui(u),u=Eo(g,t),m(d)}return void 0===u&&(u=Eo(g,t)),a}return t=oa(t)||0,Wr(l)&&(c=!!l.leading,r=(v="maxWait"in l)?on(oa(l.maxWait)||0,t):r,p="trailing"in l?!!l.trailing:p),_.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},_.flush=function(){return void 0===u?a:E(fr())},_}var Sr=Bl(function(e,t){return Xn(e,1,t)}),br=Bl(function(e,t,n){return Xn(e,oa(t)||0,n)});function Ar(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(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 r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(Ar.Cache||Pn),l}function Dr(e){if("function"!=typeof e)throw new he(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)}}Ar.Cache=Pn;var Cr=ri(function(e,t){var n=(t=1==t.length&&Lr(t[0])?dt(t[0],Nt(qi())):dt(il(t,1),Nt(qi()))).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)})}),Tr=Bl(function(e,t){return ki(e,32,void 0,t,Vt(t,Yi(Tr)))}),Nr=Bl(function(e,t){return ki(e,64,void 0,t,Vt(t,Yi(Nr)))}),Ir=Hi(function(e,t){return ki(e,256,void 0,void 0,void 0,t)});function wr(e,t){return e===t||e!=e&&t!=t}var Or=Ri(pl),xr=Ri(function(e,t){return e>=t}),Rr=El(function(){return arguments}())?El:function(e){return zr(e)&&Se.call(e,"callee")&&!Ke.call(e,"callee")},Lr=z.isArray,Pr=Ze?Nt(Ze):function(e){return zr(e)&&vl(e)==y};function Mr(e){return null!=e&&Hr(e.length)&&!Ur(e)}function Br(e){return zr(e)&&Mr(e)}var kr=en||ou,Fr=$e?Nt($e):function(e){return zr(e)&&vl(e)==u};function Vr(e){if(!zr(e))return!1;var t=vl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Yr(e)}function Ur(e){if(!Wr(e))return!1;var t=vl(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function jr(e){return"number"==typeof e&&e==la(e)}function Hr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Wr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function zr(e){return null!=e&&"object"==typeof e}var Kr=Xe?Nt(Xe):function(e){return zr(e)&&eo(e)==v};function Gr(e){return"number"==typeof e||zr(e)&&vl(e)==p}function Yr(e){if(!zr(e)||vl(e)!=m)return!1;var t=He(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ye.call(n)==Ce}var qr=Je?Nt(Je):function(e){return zr(e)&&vl(e)==f},Zr=Qe?Nt(Qe):function(e){return zr(e)&&eo(e)==h};function $r(e){return"string"==typeof e||!Lr(e)&&zr(e)&&vl(e)==g}function Xr(e){return"symbol"==typeof e||zr(e)&&vl(e)==E}var Jr=et?Nt(et):function(e){return zr(e)&&Hr(e.length)&&!!Be[vl(e)]},Qr=Ri(Dl),ea=Ri(function(e,t){return e<=t});function ta(e){if(!e)return[];if(Mr(e))return $r(e)?Wt(e):fi(e);if(mt&&e[mt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[mt]());var t=eo(e);return(t==v?kt:t==h?Ut:wa)(e)}function na(e){return e?(e=oa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function la(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?qn(la(e),0,4294967295):0}function oa(e){if("number"==typeof e)return e;if(Xr(e))return NaN;if(Wr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Wr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=le.test(e);return n||oe.test(e)?Ue(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ra(e){return hi(e,Sa(e))}function aa(e){return null==e?"":Zl(e)}var ua=Ei(function(e,t){if(so(t)||Mr(t))hi(t,ya(t),e);else for(var n in t)Se.call(t,n)&&Hn(e,n,t[n])}),da=Ei(function(e,t){hi(t,Sa(t),e)}),sa=Ei(function(e,t,n,l){hi(t,Sa(t),e,l)}),ca=Ei(function(e,t,n,l){hi(t,ya(t),e,l)}),va=Hi(Yn),pa=Bl(function(e,t){e=pe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=Sa(o),a=-1,u=r.length;++a<u;){var d=r[a],s=e[d];(void 0===s||wr(s,Ee[d])&&!Se.call(e,d))&&(e[d]=o[d])}return e}),ma=Bl(function(e){return e.push(void 0,Vi),tt(Aa,void 0,e)});function fa(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function ha(e,t){return null!=e&&to(e,t,fl)}var ga=Ni(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},Wa(Ga)),Ea=Ni(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},qi),_a=Bl(gl);function ya(e){return Mr(e)?kn(e):Al(e)}function Sa(e){return Mr(e)?kn(e,!0):function(e){if(!Wr(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var ba=Ei(function(e,t,n){Il(e,t,n)}),Aa=Ei(function(e,t,n,l){Il(e,t,n,l)}),Da=Hi(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),hi(e,zi(e),n),l&&(n=Zn(n,7,Ui));for(var i=t.length;i--;)Xl(n,t[i]);return n}),Ca=Hi(function(e,t){return null==e?{}:function(e,t){return xl(e,t,function(t,n){return ha(e,n)})}(e,t)});function Ta(e,t){if(null==e)return{};var n=dt(zi(e),function(e){return[e]});return t=qi(t),xl(e,n,function(e,n){return t(e,n[0])})}var Na=Bi(ya),Ia=Bi(Sa);function wa(e){return null==e?[]:It(e,ya(e))}var Oa=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?xa(t):t)});function xa(e){return Va(aa(e).toLowerCase())}function Ra(e){return(e=aa(e))&&e.replace(ae,Lt).replace(we,"")}var La=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Pa=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ma=Si("toLowerCase"),Ba=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),ka=bi(function(e,t,n){return e+(n?" ":"")+Va(t)}),Fa=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Va=Si("toUpperCase");function Ua(e,t,n){return e=aa(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 ja=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Vr(e)?e:new se(e)}}),Ha=Hi(function(e,t){return lt(t,function(t){t=To(t),Gn(e,t,Er(e[t],e))}),e});function Wa(e){return function(){return e}}var za=Ci(),Ka=Ci(!0);function Ga(e){return e}function Ya(e){return bl("function"==typeof e?e:Zn(e,1))}var qa=Bl(function(e,t){return function(n){return gl(n,e,t)}}),Za=Bl(function(e,t){return function(n){return gl(e,n,t)}});function $a(e,t,n){var l=ya(t),i=dl(t,l);null!=n||Wr(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=dl(t,ya(t)));var o=!(Wr(n)&&"chain"in n&&!n.chain),r=Ur(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Xa(){}var Ja=wi(dt),Qa=wi(ot),eu=wi(pt);function tu(e){return ro(e)?St(To(e)):function(e){return function(t){return sl(t,e)}}(e)}var nu=xi(),lu=xi(!0);function iu(){return[]}function ou(){return!1}var ru,au=Ii(function(e,t){return e+t},0),uu=Pi("ceil"),du=Ii(function(e,t){return e/t},1),su=Pi("floor"),cu=Ii(function(e,t){return e*t},1),vu=Pi("round"),pu=Ii(function(e,t){return e-t},0);return Nn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=la(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=hr,Nn.assign=ua,Nn.assignIn=da,Nn.assignInWith=sa,Nn.assignWith=ca,Nn.at=va,Nn.before=gr,Nn.bind=Er,Nn.bindAll=Ha,Nn.bindKey=_r,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lr(e)?e:[e]},Nn.chain=tr,Nn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(la(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=z(Xt(l/t));i<l;)r[o++]=Wl(e,i,i+=t);return r},Nn.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},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=z(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(Lr(n)?fi(n):[n],il(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,l=qi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new he(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)}})},Nn.conforms=function(e){return function(e){var t=ya(e);return function(n){return $n(n,e,t)}}(Zn(e,1))},Nn.constant=Wa,Nn.countBy=ir,Nn.create=function(e,t){var n=In(e);return null==t?n:Kn(n,t)},Nn.curry=function e(t,n,l){var i=ki(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Nn.curryRight=function e(t,n,l){var i=ki(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Nn.debounce=yr,Nn.defaults=pa,Nn.defaultsDeep=ma,Nn.defer=Sr,Nn.delay=br,Nn.difference=wo,Nn.differenceBy=Oo,Nn.differenceWith=xo,Nn.drop=function(e,t,n){var l=null==e?0:e.length;return l?Wl(e,(t=n||void 0===t?1:la(t))<0?0:t,l):[]},Nn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?Wl(e,0,(t=l-(t=n||void 0===t?1:la(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?Ql(e,qi(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?Ql(e,qi(t,3),!0):[]},Nn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=la(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:la(l))<0&&(l+=i),l=n>l?0:ia(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Nn.filter=function(e,t){return(Lr(e)?rt:ll)(e,qi(t,3))},Nn.flatMap=function(e,t){return il(vr(e,t),1)},Nn.flatMapDeep=function(e,t){return il(vr(e,t),1/0)},Nn.flatMapDepth=function(e,t,n){return n=void 0===n?1:la(n),il(vr(e,t),n)},Nn.flatten=Po,Nn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:la(t)):[]},Nn.flip=function(e){return ki(e,512)},Nn.flow=za,Nn.flowRight=Ka,Nn.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},Nn.functions=function(e){return null==e?[]:dl(e,ya(e))},Nn.functionsIn=function(e){return null==e?[]:dl(e,Sa(e))},Nn.groupBy=dr,Nn.initial=function(e){return null!=e&&e.length?Wl(e,0,-1):[]},Nn.intersection=Bo,Nn.intersectionBy=ko,Nn.intersectionWith=Fo,Nn.invert=ga,Nn.invertBy=Ea,Nn.invokeMap=sr,Nn.iteratee=Ya,Nn.keyBy=cr,Nn.keys=ya,Nn.keysIn=Sa,Nn.map=vr,Nn.mapKeys=function(e,t){var n={};return t=qi(t,3),al(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},Nn.mapValues=function(e,t){var n={};return t=qi(t,3),al(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},Nn.matches=function(e){return Tl(Zn(e,1))},Nn.matchesProperty=function(e,t){return Nl(e,Zn(t,1))},Nn.memoize=Ar,Nn.merge=ba,Nn.mergeWith=Aa,Nn.method=qa,Nn.methodOf=Za,Nn.mixin=$a,Nn.negate=Dr,Nn.nthArg=function(e){return e=la(e),Bl(function(t){return wl(t,e)})},Nn.omit=Da,Nn.omitBy=function(e,t){return Ta(e,Dr(qi(t)))},Nn.once=function(e){return gr(2,e)},Nn.orderBy=function(e,t,n,l){return null==e?[]:(Lr(t)||(t=null==t?[]:[t]),Lr(n=l?void 0:n)||(n=null==n?[]:[n]),Ol(e,t,n))},Nn.over=Ja,Nn.overArgs=Cr,Nn.overEvery=Qa,Nn.overSome=eu,Nn.partial=Tr,Nn.partialRight=Nr,Nn.partition=pr,Nn.pick=Ca,Nn.pickBy=Ta,Nn.property=tu,Nn.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Nn.pull=Uo,Nn.pullAll=jo,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,qi(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},Nn.pullAt=Ho,Nn.range=nu,Nn.rangeRight=lu,Nn.rearg=Ir,Nn.reject=function(e,t){return(Lr(e)?rt:ll)(e,Dr(qi(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=qi(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ll(e,i),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Bl(e,t=void 0===t?t:la(t))},Nn.reverse=Wo,Nn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:la(t),(Lr(e)?Vn:Fl)(e,t)},Nn.set=function(e,t,n){return null==e?e:Vl(e,t,n)},Nn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Vl(e,t,n,l)},Nn.shuffle=function(e){return(Lr(e)?Un:Hl)(e)},Nn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:la(t),n=void 0===n?l:la(n)),Wl(e,t,n)):[]},Nn.sortBy=mr,Nn.sortedUniq=function(e){return e&&e.length?Yl(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?Yl(e,qi(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!qr(t))&&!(t=Zl(t))&&Bt(e)?ai(Wt(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:on(la(t),0),Bl(function(n){var l=n[t],i=ai(n,0,t);return l&&st(i,l),tt(e,this,i)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?Wl(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?Wl(e,0,(t=n||void 0===t?1:la(t))<0?0:t):[]},Nn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?Wl(e,(t=l-(t=n||void 0===t?1:la(t)))<0?0:t,l):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?Ql(e,qi(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?Ql(e,qi(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new he(n);return Wr(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),yr(e,t,{leading:i,maxWait:t,trailing:o})},Nn.thru=nr,Nn.toArray=ta,Nn.toPairs=Na,Nn.toPairsIn=Ia,Nn.toPath=function(e){return Lr(e)?dt(e,To):Xr(e)?[e]:fi(Co(aa(e)))},Nn.toPlainObject=ra,Nn.transform=function(e,t,n){var l=Lr(e),i=l||kr(e)||Jr(e);if(t=qi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:Wr(e)&&Ur(o)?In(He(e)):{}}return(i?lt:al)(e,function(e,l,i){return t(n,e,l,i)}),n},Nn.unary=function(e){return hr(e,1)},Nn.union=zo,Nn.unionBy=Ko,Nn.unionWith=Go,Nn.uniq=function(e){return e&&e.length?$l(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?$l(e,qi(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$l(e,void 0,t):[]},Nn.unset=function(e,t){return null==e||Xl(e,t)},Nn.unzip=Yo,Nn.unzipWith=qo,Nn.update=function(e,t,n){return null==e?e:Jl(e,t,ii(n))},Nn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,ii(n),l)},Nn.values=wa,Nn.valuesIn=function(e){return null==e?[]:It(e,Sa(e))},Nn.without=Zo,Nn.words=Ua,Nn.wrap=function(e,t){return Tr(ii(t),e)},Nn.xor=$o,Nn.xorBy=Xo,Nn.xorWith=Jo,Nn.zip=Qo,Nn.zipObject=function(e,t){return ni(e||[],t||[],Hn)},Nn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Vl)},Nn.zipWith=er,Nn.entries=Na,Nn.entriesIn=Ia,Nn.extend=da,Nn.extendWith=sa,$a(Nn,Nn),Nn.add=au,Nn.attempt=ja,Nn.camelCase=Oa,Nn.capitalize=xa,Nn.ceil=uu,Nn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==t&&(t=(t=oa(t))==t?t:0),qn(oa(e),t,n)},Nn.clone=function(e){return Zn(e,4)},Nn.cloneDeep=function(e){return Zn(e,5)},Nn.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},Nn.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},Nn.conformsTo=function(e,t){return null==t||$n(e,t,ya(t))},Nn.deburr=Ra,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=du,Nn.endsWith=function(e,t,n){e=aa(e),t=Zl(t);var l=e.length,i=n=void 0===n?l:qn(la(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Nn.eq=wr,Nn.escape=function(e){return(e=aa(e))&&B.test(e)?e.replace(P,Pt):e},Nn.escapeRegExp=function(e){return(e=aa(e))&&K.test(e)?e.replace(W,"\\$&"):e},Nn.every=function(e,t,n){var l=Lr(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Nn.find=or,Nn.findIndex=Ro,Nn.findKey=function(e,t){return ft(e,qi(t,3),al)},Nn.findLast=rr,Nn.findLastIndex=Lo,Nn.findLastKey=function(e,t){return ft(e,qi(t,3),ul)},Nn.floor=su,Nn.forEach=ar,Nn.forEachRight=ur,Nn.forIn=function(e,t){return null==e?e:ol(e,qi(t,3),Sa)},Nn.forInRight=function(e,t){return null==e?e:rl(e,qi(t,3),Sa)},Nn.forOwn=function(e,t){return e&&al(e,qi(t,3))},Nn.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},Nn.get=fa,Nn.gt=Or,Nn.gte=xr,Nn.has=function(e,t){return null!=e&&to(e,t,ml)},Nn.hasIn=ha,Nn.head=Mo,Nn.identity=Ga,Nn.includes=function(e,t,n,l){e=Mr(e)?e:wa(e),n=n&&!l?la(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),$r(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&gt(e,t,n)>-1},Nn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:la(n);return i<0&&(i=on(l+i,0)),gt(e,t,i)},Nn.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=rn(t,n)&&e<on(t,n)}(e=oa(e),t,n)},Nn.invoke=_a,Nn.isArguments=Rr,Nn.isArray=Lr,Nn.isArrayBuffer=Pr,Nn.isArrayLike=Mr,Nn.isArrayLikeObject=Br,Nn.isBoolean=function(e){return!0===e||!1===e||zr(e)&&vl(e)==a},Nn.isBuffer=kr,Nn.isDate=Fr,Nn.isElement=function(e){return zr(e)&&1===e.nodeType&&!Yr(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Mr(e)&&(Lr(e)||"string"==typeof e||"function"==typeof e.splice||kr(e)||Jr(e)||Rr(e)))return!e.length;var t=eo(e);if(t==v||t==h)return!e.size;if(so(e))return!Al(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return _l(e,t)},Nn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?_l(e,t,void 0,n):!!l},Nn.isError=Vr,Nn.isFinite=function(e){return"number"==typeof e&&tn(e)},Nn.isFunction=Ur,Nn.isInteger=jr,Nn.isLength=Hr,Nn.isMap=Kr,Nn.isMatch=function(e,t){return e===t||yl(e,t,$i(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,yl(e,t,$i(t),n)},Nn.isNaN=function(e){return Gr(e)&&e!=+e},Nn.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=Gr,Nn.isObject=Wr,Nn.isObjectLike=zr,Nn.isPlainObject=Yr,Nn.isRegExp=qr,Nn.isSafeInteger=function(e){return jr(e)&&e>=-9007199254740991&&e<=9007199254740991},Nn.isSet=Zr,Nn.isString=$r,Nn.isSymbol=Xr,Nn.isTypedArray=Jr,Nn.isUndefined=function(e){return void 0===e},Nn.isWeakMap=function(e){return zr(e)&&eo(e)==_},Nn.isWeakSet=function(e){return zr(e)&&"[object WeakSet]"==vl(e)},Nn.join=function(e,t){return null==e?"":nn.call(e,t)},Nn.kebabCase=La,Nn.last=Vo,Nn.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=la(n))<0?on(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):ht(e,_t,i,!0)},Nn.lowerCase=Pa,Nn.lowerFirst=Ma,Nn.lt=Qr,Nn.lte=ea,Nn.max=function(e){return e&&e.length?nl(e,Ga,pl):void 0},Nn.maxBy=function(e,t){return e&&e.length?nl(e,qi(t,2),pl):void 0},Nn.mean=function(e){return yt(e,Ga)},Nn.meanBy=function(e,t){return yt(e,qi(t,2))},Nn.min=function(e){return e&&e.length?nl(e,Ga,Dl):void 0},Nn.minBy=function(e,t){return e&&e.length?nl(e,qi(t,2),Dl):void 0},Nn.stubArray=iu,Nn.stubFalse=ou,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=cu,Nn.nth=function(e,t){return e&&e.length?wl(e,la(t)):void 0},Nn.noConflict=function(){return We._===this&&(We._=Te),this},Nn.noop=Xa,Nn.now=fr,Nn.pad=function(e,t,n){e=aa(e);var l=(t=la(t))?Ht(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Oi(Jt(i),n)+e+Oi(Xt(i),n)},Nn.padEnd=function(e,t,n){e=aa(e);var l=(t=la(t))?Ht(e):0;return t&&l<t?e+Oi(t-l,n):e},Nn.padStart=function(e,t,n){e=aa(e);var l=(t=la(t))?Ht(e):0;return t&&l<t?Oi(t-l,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(aa(e).replace(G,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=na(e),void 0===t?(t=e,e=0):t=na(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=dn();return rn(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Pl(e,t)},Nn.reduce=function(e,t,n){var l=Lr(e)?ct:At,i=arguments.length<3;return l(e,qi(t,4),n,i,Qn)},Nn.reduceRight=function(e,t,n){var l=Lr(e)?vt:At,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},Nn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:la(t),Ml(aa(e),t)},Nn.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[To(t[l])];void 0===o&&(l=i,o=n),e=Ur(o)?o.call(e):o}return e},Nn.round=vu,Nn.runInContext=e,Nn.sample=function(e){return(Lr(e)?Fn:kl)(e)},Nn.size=function(e){if(null==e)return 0;if(Mr(e))return $r(e)?Ht(e):e.length;var t=eo(e);return t==v||t==h?e.size:Al(e).length},Nn.snakeCase=Ba,Nn.some=function(e,t,n){var l=Lr(e)?pt:zl;return n&&oo(e,t,n)&&(t=void 0),l(e,qi(t,3))},Nn.sortedIndex=function(e,t){return Kl(e,t)},Nn.sortedIndexBy=function(e,t,n){return Gl(e,t,qi(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&wr(e[l],t))return l}return-1},Nn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,qi(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(wr(e[n],t))return n}return-1},Nn.startCase=ka,Nn.startsWith=function(e,t,n){return e=aa(e),n=null==n?0:qn(la(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},Nn.subtract=pu,Nn.sum=function(e){return e&&e.length?Dt(e,Ga):0},Nn.sumBy=function(e,t){return e&&e.length?Dt(e,qi(t,2)):0},Nn.template=function(e,t,n){var l=Nn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=aa(e),t=sa({},t,l,Fi);var i,o,r=sa({},t.imports,l.imports,Fi),a=ya(r),u=It(r,a),d=0,s=t.interpolate||ue,c="__p += '",v=me((t.escape||ue).source+"|"+s.source+"|"+(s===V?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,function(t,n,l,r,a,u){return l||(l=r),c+=e.slice(d,u).replace(de,Mt),n&&(i=!0,c+="' +\n__e("+n+") +\n'"),a&&(o=!0,c+="';\n"+a+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=Se.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new se("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("+(m||"obj")+") {\n"+(m?"":"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=ja(function(){return ce(a,p+"return "+c).apply(void 0,u)});if(f.source=c,Vr(f))throw f;return f},Nn.times=function(e,t){if((e=la(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=qi(t));++n<e;)t(n);return i},Nn.toFinite=na,Nn.toInteger=la,Nn.toLength=ia,Nn.toLower=function(e){return aa(e).toLowerCase()},Nn.toNumber=oa,Nn.toSafeInteger=function(e){return e?qn(la(e),-9007199254740991,9007199254740991):0===e?e:0},Nn.toString=aa,Nn.toUpper=function(e){return aa(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=Zl(t)))return e;var l=Wt(e),i=Wt(t);return ai(l,Ot(l,i),xt(l,i)+1).join("")},Nn.trimEnd=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=Zl(t)))return e;var l=Wt(e);return ai(l,0,xt(l,Wt(t))+1).join("")},Nn.trimStart=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Zl(t)))return e;var l=Wt(e);return ai(l,Ot(l,Wt(t))).join("")},Nn.truncate=function(e,t){var n=30,l="...";if(Wr(t)){var i="separator"in t?t.separator:i;n="length"in t?la(t.length):n,l="omission"in t?Zl(t.omission):l}var o=(e=aa(e)).length;if(Bt(e)){var r=Wt(e);o=r.length}if(n>=o)return e;var a=n-Ht(l);if(a<1)return l;var u=r?ai(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),qr(i)){if(e.slice(a).search(i)){var d,s=u;for(i.global||(i=me(i.source,aa(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?a:c)}}else if(e.indexOf(Zl(i),a)!=a){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},Nn.unescape=function(e){return(e=aa(e))&&M.test(e)?e.replace(L,Kt):e},Nn.uniqueId=function(e){var t=++be;return aa(e)+t},Nn.upperCase=Fa,Nn.upperFirst=Va,Nn.each=ar,Nn.eachRight=ur,Nn.first=Mo,$a(Nn,(ru={},al(Nn,function(e,t){Se.call(Nn.prototype,t)||(ru[t]=e)}),ru),{chain:!1}),Nn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),lt(["drop","take"],function(e,t){xn.prototype[e]=function(n){n=void 0===n?1:on(la(n),0);var l=this.__filtered__&&!t?new xn(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},xn.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;xn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xn.prototype[e]=function(){return this.__filtered__?new xn(this):this[n](1)}}),xn.prototype.compact=function(){return this.filter(Ga)},xn.prototype.find=function(e){return this.filter(e).head()},xn.prototype.findLast=function(e){return this.reverse().find(e)},xn.prototype.invokeMap=Bl(function(e,t){return"function"==typeof e?new xn(this):this.map(function(n){return gl(n,e,t)})}),xn.prototype.reject=function(e){return this.filter(Dr(qi(e)))},xn.prototype.slice=function(e,t){e=la(e);var n=this;return n.__filtered__&&(e>0||t<0)?new xn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=la(t))<0?n.dropRight(-t):n.take(t-e)),n)},xn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},al(xn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Nn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Nn.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof xn,u=r[0],d=a||Lr(t),s=function(e){var t=i.apply(Nn,st([e],r));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(a=d=!1);var c=this.__chain__,v=!!this.__actions__.length,p=o&&!c,m=a&&!v;if(!o&&d){t=m?t:new xn(this);var f=e.apply(t,r);return f.__actions__.push({func:nr,args:[s],thisArg:void 0}),new On(f,c)}return p&&m?e.apply(this,r):(f=this.thru(s),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Lr(i)?i:[],e)}return this[n](function(n){return t.apply(Lr(n)?n:[],e)})}}),al(xn.prototype,function(e,t){var n=Nn[t];if(n){var l=n.name+"";Se.call(En,l)||(En[l]=[]),En[l].push({name:t,func:n})}}),En[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var e=new xn(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},xn.prototype.reverse=function(){if(this.__filtered__){var e=new xn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Lr(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],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=rn(t,e+r);break;case"takeRight":e=on(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,d=l?a:r-1,s=this.__iteratees__,c=s.length,v=0,p=rn(u,this.__takeCount__);if(!n||!l&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,h=e[d+=t];++f<c;){var g=s[f],E=g.type,_=(0,g.iteratee)(h);if(2==E)h=_;else if(!_){if(1==E)continue e;break e}}m[v++]=h}return m},Nn.prototype.at=lr,Nn.prototype.chain=function(){return tr(this)},Nn.prototype.commit=function(){return new On(this.value(),this.__chain__)},Nn.prototype.next=function(){void 0===this.__values__&&(this.__values__=ta(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof wn;){var l=Io(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},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xn){var t=e;return this.__actions__.length&&(t=new xn(this)),(t=t.reverse()).__actions__.push({func:nr,args:[Wo],thisArg:void 0}),new On(t,this.__chain__)}return this.thru(Wo)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,mt&&(Nn.prototype[mt]=function(){return this}),Nn}();Ke?((Ke.exports=Gt)._=Gt,ze._=Gt):We._=Gt}).call(z)});const Rn=e=>{var t,i;let{t:o,formData:r,applicationData:a,docs:u,bpaActionsDetails:d}=e;const s=(null==a?void 0:a.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[p,m]=n.useState((null==r||null===(i=r.documents)||void 0===i?void 0:i.documents)||[]),[f,h]=n.useState(null),[g,E]=n.useState([]),[_,y]=n.useState(!0),[S,b]=n.useState(!1),[A,D]=n.useState(!1),{isLoading:C,data:T}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:N,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,r;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==T||null===(o=T.BPA)||void 0===o||null===(r=o.DocTypeMapping)||void 0===r?void 0:r.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.additionalDetails)||void 0===n?void 0:n.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==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==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),E(d)},[!C,!N]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;p.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||!(p.length>0))},[p,S]),n.useEffect(()=>{D("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[a,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Ln,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:m,documents:p,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:A}))))};function Ln(e){var i,o;let{t:r,document:a,setDocuments:d,documents:s,index:c,bpaTaxDocuments:v,checkEnablingDocs:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],f=Digit.ULBService.getStateId(),[h,g]=n.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{}),[E,_]=n.useState(null),[y,S]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,A]=n.useState([]);return n.useEffect(()=>{null!=h&&h.code&&d(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.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==h?void 0:h.code,fileStoreId:y,documentUid:y,fileName:(null==E?void 0:E.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[y,h]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=h&&h.code&&a.newUploadedDocs.push({documentType:null==h?void 0:h.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]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,h]),n.useEffect(()=>{},[E]),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"}},""+r(null==a?void 0:a.code)),(null==a||null===(o=a.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(xn,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:h,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&&A(l),(i=l[l.length-1])&&_(i.file)})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Pn(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,i)=>{var o,a,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+r("BPA_FI_REPORT"):r("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+r("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===(a=e.date)||void 0===a?void 0:a.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(xn,{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 Mn(e){let{t:i,document:o,setNocDocuments:r,setError:a,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=n.useState(),[p,m]=n.useState(null),[f,h]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&r(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==p?void 0:p.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)a(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))a(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=ee(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,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?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):a(i("CS_FILE_UPLOAD_ERROR"))})},function(){a(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)}}()},[p]),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])&&m(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Bn=e=>{var i;let{t:o,noc:r,docs:a,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==d?void 0:d.status)||"",m=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[E,_]=n.useState([]),[y,S]=n.useState([]),[b,A]=n.useState(!1),[D,C]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[T,N]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,a,s,c;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(a=o.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.nocType)):null==h||null===(s=h.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(n=d.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==E||E.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,E]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:I?""+o("BPA_"+(null==r?void 0:r.nocType)+"_HEADER"):o("BPA_"+(null==r?void 0:r.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(xn,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==y?void 0:y.map((e,t)=>l.createElement(Mn,{key:t,document:e,t:o,error:T,setError:N,setNocDocuments:C,nocDocuments:D,checkEnablingDocs:b}))))},kn=e=>{let{permissions:i,t:o}=e;const[r,a,d]=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 p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"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;a(()=>null==r?void 0:r.map((e,t)=>n===t?u({},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:p?"96%":"830px",width:p?"96%":"830px"},style:p?{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:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Fn(e){let{documents:o,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=i.useTranslation(),[d,s]=n.useState(()=>[]),[c,v]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{v(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[d]);const p=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:p?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=c[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:p?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),a?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==o?void 0:o.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)=>{var i;return l.createElement("a",{target:"_",href:null===(i=c[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=r&&r.minWidth?null==r?void 0:r.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"}},""+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")))))})))}function Vn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:r}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("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:r(e.taxHeadCode),label:r(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:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Un(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 jn(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=i.useTranslation(),a=(null==n?void 0:n.length)||1;let d={marginTop:"19px"},s={position:"relative",padding:"8px"},c={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?d={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(d={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(d=u({},d,{maxWidth:"950px"}),d=u({},d,{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:r(null==e?void 0:e.title),style:d,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?r(null==e?void 0:e.title)+" "+(n+1):r(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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:r(e.title),label:""+r(e.title),text:r(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 Hn=e=>{var o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,C,T,N;let{scrutinyDetails:I,paymentsList:w=[],additionalDetails:O,applicationData:x}=e;const R=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==x?void 0:x.status))&&window.location.href.includes("bpa"),[L,P]=n.useState(),[M,B]=n.useState(),[k,F]=n.useState(),V=Digit.ULBService.getStateId(),[U,j]=n.useState(),[H,W]=n.useState(),[z,K]=n.useState([]),[G,Y]=n.useState(),[q,Z]=n.useState(""),[$,X]=n.useState(null),[J,Q]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{X(null);const e=function(){if(G&&null!=G&&G.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==G||null===(t=G.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(G.size>=2e6)X(re("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=ee(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,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?K([...z,{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}]):X(re("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else X(re("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(z))},[z]),n.useEffect(()=>{var e,t,n,l,i,o,r;if(null!=O&&null!==(e=O.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==O?void 0:O.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==O||null===(n=O.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==O||null===(l=O.lessAdjustmentFeeFiles[(null==O||null===(i=O.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,V).then(e=>Q(null==e?void 0:e.data))}P(null==O||null===(t=O.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==O||null===(n=O.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),B(null==O||null===(l=O.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==O||null===(i=O.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),F(null==O||null===(o=O.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==O||null===(r=O.selfCertificationCharges)||void 0===r?void 0:r.BPA_LESS_ADJUSMENT_PLOT),j(null==O?void 0:O.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==O?void 0:O.otherFeesDiscription),K(null==O?void 0:O.lessAdjustmentFeeFiles)},[O]);const{t:re}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},re(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?re(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void re("NA");return l.createElement(n.Fragment,null,!(null!=I&&I.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==I||null===(o=I.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:""+re(""+e.title),text:null!=e&&e.value?ae(e)+" "+re(null==e?void 0:e.isUnit):re("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:""+re(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},re(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},re(null==e?void 0:e.title))),null==I||null===(r=I.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(a=I.values[0])||void 0===a?void 0:a.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},re("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},re("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==O?void 0:O.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:re("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==O?void 0:O.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(u=I.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!0)}},re("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},re("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==O||null===(d=O.selfCertificationCharges)||void 0===d?void 0:d.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==O||null===(s=O.selfCertificationCharges)||void 0===s?void 0:s.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==O||null===(c=O.selfCertificationCharges)||void 0===c?void 0:c.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==O||null===(v=O.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,re("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==O||null===(p=O.selfCertificationCharges)||void 0===p?void 0:p.BPA_DEVELOPMENT_CHARGES)||0,value:L,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(P(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==O||null===(m=O.selfCertificationCharges)||void 0===m?void 0:m.BPA_OTHER_CHARGES)||0,value:M,disabled:!R,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(B(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:re,type:"text",name:"otherChargesDiscription",defaultValue:null==O||null===(f=O.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:U,disabled:!R,onChange:e=>{!function(e){j(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==O||null===(h=O.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:k,disabled:!R,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==O||null===(t=O.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==O||null===(n=O.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==O||null===(l=O.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==O||null===(i=O.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(F(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(k)>0&&R?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){W(e.target.files[0]),Y(e.target.files[0])},disabled:!R,onDelete:()=>{W(null),Y("")},message:H?"1 "+re("FILEUPLOADED"):re("ES_NO_FILE_SELECTED_LABEL"),error:$,uploadMessage:q})):null,(null==J||null===(g=J.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==O||null===(E=O.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},re("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==J||null===(_=J.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==O||null===(y=O.selfCertificationCharges)||void 0===y?void 0:y.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==J||null===(S=J.fileStoreIds[(null==J||null===(b=J.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===S?void 0:S.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:re("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==O||null===(A=O.selfCertificationCharges)||void 0===A?void 0:A.BPA_MALBA_CHARGES)+parseFloat(null==O||null===(D=O.selfCertificationCharges)||void 0===D?void 0:D.BPA_LABOUR_CESS)+parseFloat(null==O||null===(C=O.selfCertificationCharges)||void 0===C?void 0:C.BPA_WATER_CHARGES)+parseFloat(null==O||null===(T=O.selfCertificationCharges)||void 0===T?void 0:T.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(k)?parseFloat(k):0))}))),l.createElement("div",null,null==I||null===(N=I.scruntinyDetails)||void 0===N?void 0:N.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+re(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},re(null==e?void 0:e.text))))))))},Wn=e=>{var o,r,a,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=i.useTranslation(),p=window.Digit.Utils.browser.isMobile(),m=[{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]},h=n.useMemo(()=>m.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,r,a,u,d;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:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function E(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===(r=s.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,n)=>{var i,o,r,a,u;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.value)||void 0===r||null===(a=r.planDetail)||void 0===a||null===(u=a.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:E(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{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:h,getCellProps:e=>({style:{}})})))})))},zn=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Kn=e=>{var o,r,a;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,v]=n.useState(!1),{t:p}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,p("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(zn,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("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"}},p("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"}},p("View Less")))))):null,(null==u||null===(r=u.thumbnailsToShow)||void 0===r||null===(a=r.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Gn(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 Yn(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 qn=e=>{var o,r,a,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation();let v=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var p;const m=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails:g,roadCuttingAddlDetails:E,activationDetails:_}=(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===(r=s.additionalDetails)||void 0===r?void 0:r.plumberDetails)&&"MODIFY"!=m&&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==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:"",privacy:e.privacy}))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=m&&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===(u=s.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Zn=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],$n=[{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"}],Xn=e=>{var o,r,a,d;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[v,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,h,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),E=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,A]=n.useState(v||{}),[D,C]=n.useState(null),[T,N]=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=u({},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,r,a,d,c,m,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(a=v.billDetails)||void 0===a||null===(d=a[0])||void 0===d?void 0:d.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(c=v.billDetails)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.taxAmount)}];w(e),N(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else p(i),A(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=u({},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:""}A(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==T?void 0:T.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(E?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:E?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(r=s.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,y&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{A(v),S(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{A(v),S(!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,r,a,d,v,m,f,g,E,y;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(d=a.appDetails)||void 0===d?void 0:d.tenantId,n=u({},null==s||null===(v=s.additionalDetails)||void 0===v||null===(m=v.appDetails)||void 0===m?void 0:m.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===(E=s.additionalDetails)||void 0===E||null===(y=E.appDetails)||void 0===y?void 0:y.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,r,a,u,d,s,c,v,m,f,g,E;(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===(E=g.taxHeadEstimates)||void 0===E||E.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.taxHeadEstimates,"category");const y=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(a=e.Calculation)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];h(yn(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),w(y),b.billDetails=null==e?void 0:e.Calculation,p(b),S(!1)}).catch(e=>{var t,n,l,i,o,r;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===(r=o.Errors[0])||void 0===r?void 0:r.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:Zn,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===(a=b.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({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,u({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:$n,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===(d=b.adhocRebateReason_data)||void 0===d?void 0:d.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,u({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,u({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")})))))," "),D&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==D?void 0:D.isWarning,error:null==D||!D.isWarning,label:c(null==D?void 0:D.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Jn=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Qn=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(r)+" ",l.createElement(Jn,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},el=e=>{var o,r,a,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=i.useTranslation(),[m,f]=n.useState(!1),[h,g]=n.useState({}),E=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),y=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=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"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(E,{label:p("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"}},p("WS_APPLICATION_FEE_HEADER")),null==h||null===(r=h.billSlabData)||void 0===r||null===(a=r.FEE)||void 0===a?void 0:a.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(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:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(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:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(s=h.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:""+p(""+(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:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},tl={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:{}},nl=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:r=0}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:tl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:tl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},tl.cell,tl.cellLeft,tl.cellHeader)},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},tl.cell,n.length==t+1?tl.cellRight:{},tl.cellHeader),key:t},a(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},tl.cell,tl.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:u({},tl.cell,{textAlign:"left"},n.length==i+1?tl.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},tl.cell,tl.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},tl.cell,tl.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:u({},tl.cell,{textAlign:"left"}),key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:tl.cell,key:t,numeric:!0})))))))},ll={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))"}},il=e=>{var t,o,r;let{bill:a={}}=e;const{t:u}=i.useTranslation();let d={},s=(null==a||null===(t=a.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===(r=c.toFixed)||void 0===r?void 0:r.call(c,0))||Number(0).toFixed(0));s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let p={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{p[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[t]);const[f,h]=n.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:ll.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(nl,{headers:[...m],values:d,arrears:v}),!f&&l.createElement("div",{style:ll.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:ll.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function ol(e){var r,a,u,d,s,c,v,p,m,f,h,g,E,y;let{applicationDetails:S,demandData:b,workflowDetails:A,isDataLoading:D,applicationData:C,totalDemandTax:T,timelineStatusPrefix:N,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:O,oldValue:x,isInfoLabel:R=!1}=e;const{t:L}=i.useTranslation();let P=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",S);const[B,k]=n.useState({}),[F,V]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||F.loading||F.loaded||F.canLoad||V({loading:!1,loaded:!1,canLoad:!0}),null==F||!F.canLoad||F.loading||F.loaded||(V({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(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};const a=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){r=e})}();return a&&a.then?a.then(o):o()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,k,V));const U=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()},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:U(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(Kn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,r,a,u,d,s,c,v,p,m,f,h,g,E,y,b,A,D;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==S?void 0:S.tenantId,businessIds:null==S?void 0:S.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}}},T=n[t-1],N={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==C||null===(s=C.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===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(h=f.assignes)&&void 0!==h&&null!==(g=h[0])&&void 0!==g&&g.mobileNumber?null==C||null===(E=C.processInstance)||void 0===E||null===(y=E.assignes)||void 0===y||null===(b=y[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(A=e.assignes)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.mobileNumber,comment:L(null==e?void 0:e.comment),wfComment:T?T.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Kn,{data:N,OpenImage:M,privacy:i})}{var T,N,I,w,O;const t={date:U(null==C||null===(T=C.auditDetails)||void 0===T?void 0:T.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(w=e.assignes)||void 0===w||null===(O=w[0])||void 0===O?void 0:O.mobileNumber};return l.createElement(Kn,{data:t})}},H=(e,t)=>e?t?e:L(e):L("NA"),W=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),z=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),G=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||W?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),Y={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},q=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?H(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+L(null==e?void 0:e.isUnit):L("N/A"):null!=e&&e.value?H(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):L("N/A"),[Z,$]=n.useState(!1);console.log("demand Data arr",b);const X=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),J=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0);return null==b||b.reduce((e,t)=>e+t.balanceInterest,0),null==b||b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(Qn,{t:L,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==S||null===(r=S.applicationDetails)||void 0===r?void 0:r.map((e,i)=>{var r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,b,D,C,T,N,I,w,R,M,k,F,V,U,j,H,Y,Z,$,X,J,Q,ee,te,ne,le;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"}:W?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&W?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},z?""+L(e.title):L(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},L(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"}},L(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"}},L(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},L(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||W?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(r=e.values)||void 0===r?void 0:r.map((n,i)=>{var r,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:L(n.title),label:L(n.title),text:l.createElement("img",{src:L(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:L(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"}},L(null==n?void 0:n.title)))):z||K?""+L(n.title):L(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:G(),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:""+L(""+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:L(n.title),label:L(n.title),text:q(n),last:i===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:G(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(il,{bill:null===(a=B.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Hn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:O,additionalDetails:null==S||null===(u=S.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==S||null===(d=S.applicationData)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(Pn,{fiReport:null==S||null===(p=S.applicationData)||void 0===p||null===(m=p.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Un,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(jn,{owners:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(Yn,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(Gn,{units:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.accessories}),!P&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==A||null===(T=A.data)||void 0===T||null===(N=T.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(kn,{applicationData:null==S?void 0:S.applicationData,t:L,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(Rn,{t:L,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:A})),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.noc)&&l.createElement(Bn,{t:L,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(M=e.additionalDetails)||void 0===M?void 0:M.data,bpaActionsDetails:A}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.scruntinyDetails)&&l.createElement(Hn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(Hn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.subOccupancyTableDetails)&&l.createElement(Wn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(xn,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documents)&&l.createElement(Fn,{documents:null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.documents}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.taxHeadEstimatesCalculation)&&l.createElement(Vn,{taxHeadEstimatesCalculation:null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(qn,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.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===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Xn,{wsAdditionalDetails:e,workflowDetails:A}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(el,{wsAdditionalDetails:e,workflowDetails:A}))}),I&&(null==A||null===(a=A.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==A?void 0:A.isLoading)||D)&&l.createElement(t.Loader,null),!(null!=A&&A.isLoading)&&!D&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},L("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=A&&null!==(d=A.data)&&void 0!==d&&d.timeline&&1===(null==A||null===(s=A.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:L(""+N+(null==A||null===(v=A.data)||void 0===v||null===(p=v.timeline[0])||void 0===p?void 0:p.state)),customChild:j(null==A||null===(m=A.data)||void 0===m?void 0:m.timeline[0],null==A||null===(f=A.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==A||null===(h=A.data)||void 0===h?void 0:h.timeline)&&(null==A||null===(g=A.data)||void 0===g?void 0:g.timeline.slice(0,Z?null==A?void 0:A.data.timeline.length:2).map((e,n,i)=>{var o;let r="";var a,u,d,s,c,v;return window.location.href.includes("/obps/")&&(r=null!=A&&null!==(a=A.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=A&&null!==(s=A.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:L(""+N+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+r),customChild:j(e,n,null==A||null===(o=A.data)||void 0===o?void 0:o.timeline)}))}))),(null==A||null===(E=A.data)||void 0===E||null===(y=E.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:L(Z?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{$(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:Y.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:Y.th},"Installments"),l.createElement("th",{colSpan:"3",style:Y.th},"Demand"),l.createElement("th",{colSpan:"3",style:Y.th},"Collection"),l.createElement("th",{colSpan:"3",style:Y.th},"Balance"),l.createElement("th",{style:Y.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:Y.th}),l.createElement("th",{style:Y.th},"Tax"),l.createElement("th",{style:Y.th},"Interest"),l.createElement("th",{style:Y.th},"Penalty"),l.createElement("th",{style:Y.th},"Tax"),l.createElement("th",{style:Y.th},"Interest"),l.createElement("th",{style:Y.th},"Penalty"),l.createElement("th",{style:Y.th},"Tax"),l.createElement("th",{style:Y.th},"Interest"),l.createElement("th",{style:Y.th},"Penalty"),l.createElement("th",{style:Y.th},"Advance"))),l.createElement("tbody",null,null==b?void 0:b.map(e=>l.createElement("tr",null,l.createElement("td",{style:Y.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:Y.td},e.demandTax),l.createElement("td",{style:Y.td},e.demandInterest),l.createElement("td",{style:Y.td},e.demandPenality),l.createElement("td",{style:Y.td},e.collectionTax),l.createElement("td",{style:Y.td},e.collectionInterest),l.createElement("td",{style:Y.td},e.collectionPenality),l.createElement("td",{style:Y.td},e.balanceTax),l.createElement("td",{style:Y.td},e.balanceInterest),l.createElement("td",{style:Y.td},e.balancePenality),l.createElement("td",{style:Y.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:Y.th},"Total"),l.createElement("td",{style:Y.td},T),l.createElement("td",{style:Y.td},X),l.createElement("td",{style:Y.td},J),l.createElement("td",{style:Y.td},Q),l.createElement("td",{style:Y.td},ee),l.createElement("td",{style:Y.td},te),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td})),l.createElement("tr",null,l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("th",{style:Y.th},"Total"),l.createElement("td",{style:Y.td},ne),l.createElement("td",{style:Y.td},"0"),l.createElement("td",{style:Y.td},"0"),l.createElement("td",{style:Y.td},"0")),l.createElement("tr",null,l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("td",{style:Y.td}),l.createElement("th",{style:Y.th},"Total Balance"),l.createElement("td",{style:Y.td},ne)))))}function rl(e){var n,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y;let{t:S,showToast:b,closeToast:A,businessService:D}=e;if(null!=D&&D.includes("NewTL")||null!=D&&D.includes("TL")||null!=D&&D.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:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:S("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:S("ES_"+D+"_"+(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:A}))}if(null!=D&&D.includes("BPA")||null!=D&&D.includes("BPA_LOW")||null!=D&&D.includes("BPA_OC")){var T;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=D&&D.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.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===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.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===(h=b.error)||void 0===h?void 0:h.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===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:S("ES_"+D+"_"+(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:A}))}{var N,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:"ES_"+D+"_"+(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:S(e),onClose:A}))}}function al(e){var o,r,a,d,s,c,v,p,m,f,h,g,E,_,y,S;let{workflowDetails:b,displayMenu:A,onActionSelect:D,setDisplayMenu:C,businessService:T,forcedActionPrefix:N,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===(r=o.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let P=!1,M=!1,B=(null==b||null===(d=b.data)||void 0===d||null===(s=d.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===(p=v.nextActions)||void 0===p?void 0:p.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 Digit.Hooks.useClickOutside(R,()=>{C(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==B?void 0:B.length)||null!=B&&null!==(m=B[0])&&void 0!==m&&null!==(f=m.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:u({},I)},A&&(null!=b&&null!==(h=b.data)&&void 0!==h&&null!==(g=h.actionState)&&void 0!==g&&g.nextActions||null!=b&&null!==(E=b.data)&&void 0!==E&&E.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:N||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()),options:B,optionKey:"action",t:O,onSelect:D,style:w}):null,l.createElement(t.SubmitBar,{ref:R,label:O("WF_TAKE_ACTION"),onSubmit:()=>C(!A)})),!(null!=b&&b.isLoading)&&!M&&P&&l.createElement(t.ActionBar,{style:u({},I)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==B||null===(_=B[0])||void 0===_?void 0:_.action,value:null==B||null===(y=B[0])||void 0===y?void 0:y.action,onClick:e=>{D((null==B?void 0:B[0])||{})}},O((N||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()))+"_"+(null==B||null===(S=B[0])||void 0===S?void 0:S.action)))))}const ul=()=>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"})),dl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ul,null));function sl(e){let{action:n,closeWarningPopup:o}=e;const{t:r}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(dl,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("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:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("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 cl=e=>{var a,d;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:m}=i.useTranslation(),f=o.useHistory();let{id:h}=o.useParams();const[g,E]=n.useState(!1),[_,y]=n.useState(null),[S,b]=n.useState(!1),[A,D]=n.useState(!1),[C,T]=n.useState(!1),{data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:I,demandData:w,totalDemandTax:O,totalBalanceTax:x,showToast:R,setShowToast:L,isLoading:P,isDataLoading:M,applicationData:B,mutate:k,nocMutation:F,workflowDetails:V,id:U,businessService:j,closeToast:H,moduleCode:W,timelineStatusPrefix:z,forcedActionPrefix:K,statusAttribute:G,ActionBarStyle:Y,MenuStyle:q,paymentsList:Z,showTimeLine:$=!0,oldValue:X,isInfoLabel:J=!1,clearDataDetails:Q}=e;n.useEffect(()=>{R&&V.revalidate()},[R]);const te=r.useQueryClient(),ne=()=>{y(null),b(!1)};return P||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,P?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(ol,{applicationDetails:I,demandData:w,id:U,workflowDetails:V,isDataLoading:M,applicationData:B,totalDemandTax:O,totalBalanceTax:x,businessService:j,timelineStatusPrefix:z,statusAttribute:G,paymentsList:Z,showTimeLine:$,oldValue:X,isInfoLabel:J}),S?l.createElement(On,{t:m,action:_,tenantId:c,state:v,id:h,applicationDetails:I,applicationData:null==I?void 0:I.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,r,a,d,s,c,v,p,h,g,E){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(r=o.comment)||void 0===r?void 0:r.length)||0==(null==e||null===(a=e.Licenses)||void 0===a||null===(d=a[0])||void 0===d||null===(s=d.comment)||void 0===s?void 0:s.length)||0==(null==e||null===(c=e.WaterConnection)||void 0===c||null===(v=c.comment)||void 0===v?void 0:v.length)||0==(null==e||null===(p=e.SewerageConnection)||void 0===p||null===(h=p.comment)||void 0===h?void 0:h.length)||0==(null==e||null===(g=e.BPA)||void 0===g||null===(E=g.comment)||void 0===E?void 0:E.length))alert(m("Please fill in the comments before submitting"));else{const i=function(i,o,r,a,d){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!==(r=o.additionalDetails)&&void 0!==r&&r.blockingReason||"BLOCK"!=(null==e||null===(a=e.BPA)||void 0===a||null===(d=a.workflow)||void 0===d?void 0:d.action)){function s(t){if(l)return t;k&&(D(!0),k(e,{onError:(e,t)=>{D(!1),L({key:"error",error:e}),setTimeout(H,5e3)},onSuccess:(e,t)=>{var l,i,o,r,a,u,d,s,c,v,p,h;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),D(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=_,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=_,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===(r=e.Amendments)||void 0===r?void 0:r.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("APPROVE")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(h=p.workflow)&&void 0!==h&&h.action.includes("REJECT")&&L({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(L({key:"success",action:_}),Q&&setTimeout(Q,3e3),setTimeout(H,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH"))}})),ne()}D(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&F){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==F?void 0:F.mutateAsync(e)),i=ee(function(){return D(!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,r,a,u,d,s,c,v,p;D(!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?m(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.Errors)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.message)||e;ne(),L({key:"error",error:{message:f}}),setTimeout(H,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(m("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==V||null===(a=V.data)||void 0===a?void 0:a.timeline,businessService:j,workflowDetails:V,moduleCode:W,blockReason:null==p||null===(d=p.BPA)||void 0===d?void 0:d.BlockReason}):null,C?l.createElement(sl,{action:_,workflowDetails:V,businessService:j,isWarningPop:C,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(rl,{t:m,showToast:R,closeToast:H,businessService:j}),s?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,i,o,r;const a=Digit.Utils.obps.calculateRiskType(null==N||null===(t=N.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==I||null===(n=I.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==I||null===(o=I.edcrDetails)||void 0===o||null===(r=o.planDetail)||void 0===r?void 0:r.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=a,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const d=function(e,t,n,l,i,o,r,a,d,s,v,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(r=u.BPA)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(d=a.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(s=u.BPA)||void 0===s||null===(v=s.additionalDetails)||void 0===v||null===(p=v.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(al,{workflowDetails:V,displayMenu:g,onActionSelect:function(e){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]),null!=e&&e.isToast)L({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(H,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))f.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.state,url:""+(null===(o=location)||void 0===o?void 0:o.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var r,a;f.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var d;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action)){var s,c;f.push({pathname:null===(s=e.redirectionUrl)||void 0===s?void 0:s.pathname,state:u({},null===(c=e.redirectionUrl)||void 0===c?void 0:c.state)})}else b(!0);y(e),E(!1)},setDisplayMenu:E,businessService:j,forcedActionPrefix:K,ActionBarStyle:Y,MenuStyle:q})))},vl=["tenantId","payments"];var pl=l.memo(()=>{var e,r,a,s,c,v,p,m,f,h,g,E;const{t:_}=i.useTranslation(),{data:y}=Digit.Hooks.useStore.getInitData(),S=Digit.ULBService.getCurrentTenantId(),{tenants:b}=y||{},{id:A}=o.useParams(),[D,C]=n.useState(null),[T,N]=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(_,S,A,!1),{mutate:L}=Digit.Hooks.sv.useSVApplicationAction(S);let P=Digit.Hooks.useWorkflowDetails({tenantId:(null==R||null===(e=R.applicationData)||void 0===e?void 0:e.tenantId)||S,id:null==R||null===(r=R.applicationData)||void 0===r||null===(a=r.applicationData)||void 0===a?void 0:a.applicationNo,moduleCode:"street-vending",role:"SV_CEMP"});var M,B;n.useEffect(()=>{R&&N(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===(p=v.nextActions)||void 0===p||!p.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==T||null===(t=T.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNo)}}:e}));let k=[{order:1,label:_("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=null==T?void 0:T.applicationData,t=b.find(t=>t.code===e.tenantId);return Promise.resolve($(e.applicationData,t,_)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:F,isLoading:V}=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"sv-services",consumerCodes:null==T||null===(m=T.applicationData)||void 0===m||null===(f=m.applicationData)||void 0===f?void 0:f.applicationNo,isEmployee:!1},{enabled:!(null==T||null===(h=T.applicationData)||void 0===h||null===(g=h.applicationData)||void 0===g||!g.applicationNo)});return F&&(null==F?void 0:F.Payments.length)>0&&0==V&&k.push({label:_("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,vl);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},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:_("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{SVDetail:[null==R||null===(e=R.applicationData)||void 0===e?void 0:e.applicationData]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(S,{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:_("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{SVDetail:[null==R||null===(e=R.applicationData)||void 0===e?void 0:e.applicationData]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(S,{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"}},_("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(cl,{isAction:O,applicationDetails:null==T?void 0:T.applicationData,isLoading:x,isDataLoading:x,applicationData:null==T||null===(E=T.applicationData)||void 0===E?void 0:E.applicationData,mutate:L,workflowDetails:P,businessService:"street-vending",moduleCode:"sv-services",showToast:D,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"SV_",forcedActionPrefix:"SV",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const ml=e=>{var r,a,u;let{application:d,buttonLabel:s,previousDraftId:c,onDiscard:v}=e;const{t:p}=i.useTranslation(),m=o.useHistory(),[f,h]=n.useState(null);n.useEffect(()=>{if(f){const e=setTimeout(()=>{h(null)},2e3);return()=>clearTimeout(e)}},[f]);const g=!(null!=d&&null!==(r=d.applicationNo)&&void 0!==r&&r.length);return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:p("SV_APPLICATION_NUMBER"),note:null==d?void 0:d.applicationNo}),l.createElement(t.KeyNote,{keyValue:p("SV_VENDOR_NAME"),note:null==d||null===(a=d.vendorDetail)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.name}),l.createElement(t.KeyNote,{keyValue:p("SV_VENDING_TYPE"),note:null==d?void 0:d.vendingActivity}),l.createElement(t.KeyNote,{keyValue:p("SV_VENDING_ZONES"),note:null==d?void 0:d.vendingZone}),"STATIONARY"===(null==d?void 0:d.vendingActivity)&&l.createElement(t.KeyNote,{keyValue:p("SV_AREA_REQUIRED"),note:null==d?void 0:d.vendingArea}),"CITIZENACTIONREQUIRED"==(null==d?void 0:d.applicationStatus)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:p("SV_EDIT"),onSubmit:()=>{var e,t,n,l,i,o,r,a,u;sessionStorage.setItem("vendingApplicationID",null==d?void 0:d.applicationNo),sessionStorage.setItem("ApplicationId",null==d?void 0:d.applicationId),sessionStorage.setItem("applicationStatus",null==d?void 0:d.applicationStatus),sessionStorage.setItem("addressIdOne",null==d||null===(e=d.addressDetails)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.addressId),sessionStorage.setItem("addressIdTwo",null==d||null===(n=d.addressDetails)||void 0===n||null===(l=n[1])||void 0===l?void 0:l.addressId),sessionStorage.setItem("vendorIds",null==d||null===(i=d.addressDetails)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.vendorId),sessionStorage.setItem("bankIds",null==d||null===(r=d.bankDetail)||void 0===r?void 0:r.id),sessionStorage.setItem("venId",null==d||null===(a=d.vendorDetail)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.id),m.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==d?void 0:d.applicationNo)+"/"+(null==d?void 0:d.tenantId)},l.createElement(t.SubmitBar,{label:g?p("SV_CONTINUE"):s})),g&&l.createElement(t.SubmitBar,{label:p("SV_DISCARD"),onSubmit:function(){try{const e=A(function(){return Promise.resolve(Digit.SVService.deleteDraft({filters:{draftId:c}})).then(function(){h({error:!1,label:p("SV_DISCARD_MESSAGE")}),v&&v(d)})},function(e){console.error("Error discarding application:",e),h({error:!0,label:p("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:p(f.label),onClose:()=>{h(null)}})))},fl=e=>{var n,o,r;let{data:a,OpenImage:u}=e;const{t:d}=i.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,d("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(Reason,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(o=a.thumbnailsToShow)||void 0===o||null===(r=o.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)},hl=e=>{var r,a,u,d,s,c;const{t:v}=i.useTranslation(),p=null==e||null===(r=e.application)||void 0===r||null===(a=r.workflow)||void 0===a?void 0:a.businessService,{isLoading:m,data:f}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:e.id,moduleCode:p});function h(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(fl,{data:o})}if(t.state){var o,r,a,u,d;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(r=t.assignes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(fl,{data:e,OpenImage:h})}{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(fl,{data:n})}};return m?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!m&&l.createElement(n.Fragment,null,(null==f||null===(d=f.timeline)||void 0===d?void 0:d.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_"+p+"_"+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,r,a;let u=n[0];const d=n.map(e=>e.action);if(d.includes("PAY")||d.includes("EDIT")){let e=d.indexOf("EDIT")||d.indexOf("PAY");e=-1!=e?e:d.indexOf("PAY"),u=n[e]}switch(null===(i=u)||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===(r=e.application)||void 0===r?void 0:r.applicationNo),state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNo}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==f?void 0:f.nextActions))};var gl=Array.isArray,El="object"==typeof self&&self&&self.Object===Object&&self,_l="object"==typeof z&&z&&z.Object===Object&&z||El||Function("return this")(),yl=_l.Symbol,Sl=Object.prototype,bl=Sl.hasOwnProperty,Al=Sl.toString,Dl=yl?yl.toStringTag:void 0,Cl=Object.prototype.toString,Tl=yl?yl.toStringTag:void 0,Nl=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Tl&&Tl in Object(e)?function(e){var t=bl.call(e,Dl),n=e[Dl];try{e[Dl]=void 0;var l=!0}catch(e){}var i=Al.call(e);return l&&(t?e[Dl]=n:delete e[Dl]),i}(e):function(e){return Cl.call(e)}(e)},Il=function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==Nl(e)},wl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ol=/^\w*$/,xl=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Rl=_l["__core-js_shared__"],Ll=function(){var e=/[^.]+$/.exec(Rl&&Rl.keys&&Rl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pl=Function.prototype.toString,Ml=/^\[object .+?Constructor\]$/,Bl=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kl=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!xl(e)||(t=e,Ll&&Ll in t))&&(function(e){if(!xl(e))return!1;var t=Nl(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?Bl:Ml).test(function(e){if(null!=e){try{return Pl.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0},Fl=kl(Object,"create"),Vl=Object.prototype.hasOwnProperty,Ul=Object.prototype.hasOwnProperty;function jl(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])}}jl.prototype.clear=function(){this.__data__=Fl?Fl(null):{},this.size=0},jl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},jl.prototype.get=function(e){var t=this.__data__;if(Fl){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Vl.call(t,e)?t[e]:void 0},jl.prototype.has=function(e){var t=this.__data__;return Fl?void 0!==t[e]:Ul.call(t,e)},jl.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fl&&void 0===t?"__lodash_hash_undefined__":t,this};var Hl=jl,Wl=function(e,t){return e===t||e!=e&&t!=t},zl=function(e,t){for(var n=e.length;n--;)if(Wl(e[n][0],t))return n;return-1},Kl=Array.prototype.splice;function Gl(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])}}Gl.prototype.clear=function(){this.__data__=[],this.size=0},Gl.prototype.delete=function(e){var t=this.__data__,n=zl(t,e);return!(n<0||(n==t.length-1?t.pop():Kl.call(t,n,1),--this.size,0))},Gl.prototype.get=function(e){var t=this.__data__,n=zl(t,e);return n<0?void 0:t[n][1]},Gl.prototype.has=function(e){return zl(this.__data__,e)>-1},Gl.prototype.set=function(e,t){var n=this.__data__,l=zl(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Yl=Gl,ql=kl(_l,"Map"),Zl=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 $l(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])}}$l.prototype.clear=function(){this.size=0,this.__data__={hash:new Hl,map:new(ql||Yl),string:new Hl}},$l.prototype.delete=function(e){var t=Zl(this,e).delete(e);return this.size-=t?1:0,t},$l.prototype.get=function(e){return Zl(this,e).get(e)},$l.prototype.has=function(e){return Zl(this,e).has(e)},$l.prototype.set=function(e,t){var n=Zl(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Xl=$l;function Jl(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 r=e.apply(this,l);return n.cache=o.set(i,r)||o,r};return n.cache=new(Jl.Cache||Xl),n}Jl.Cache=Xl;var Ql,ei,ti=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ni=/\\(\\)?/g,li=(Ql=Jl(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ti,function(e,n,l,i){t.push(l?i.replace(ni,"$1"):n||e)}),t},function(e){return 500===ei.size&&ei.clear(),e}),ei=Ql.cache,Ql),ii=yl?yl.prototype:void 0,oi=ii?ii.toString:void 0,ri=function(e){if("string"==typeof e||Il(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const ai=["tenantId","payments"],ui={Create:e=>{var t,n,a,d,c,v;const p=r.useQueryClient(),m=o.useRouteMatch(),{t:f}=i.useTranslation(),{pathname:h}=o.useLocation(),g=o.useHistory();Digit.ULBService.getStateId();let E=[];const[_,y,S]=Digit.Hooks.useSessionStorage("SV_CREATES",{}),b=sessionStorage.getItem("vendingApplicationID")?sessionStorage.getItem("vendingApplicationID"):null,{data:A}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{applicationNumber:b,isDraftApplication:!1},enabled:!!b}),D=null==A||null===(t=A.SVDetail)||void 0===t?void 0:t[0],{data:C}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{isDraftApplication:!0}}),T=null==C||null===(n=C.SVDetail)||void 0===n?void 0:n[0];function N(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=_.owners||[];n[l]=t,y(u({},_,{[e]:[...n]}))}else if("units"===e){let e=_.units||[];e=t,y(u({},_,{units:e}))}else y(u({},_,{[e]:u({},_[e],t)}));((e,t,n,l)=>{let i,o=h.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=h.slice(0,-3),o=o.split("/").pop(),a=!0):(o=h.slice(0,-2),o=o.split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let{nextStep:u={}}=E.find(e=>e.route===o),d=g.push;if(e&&(d=g.replace),n&&(u=l),null===u)return d(m.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?m.path+"/"+u+"/"+t:m.path+"/"+u,d(i)})(n,l,i,e)}_&&Object.keys(_).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(S(),p.invalidateQueries("SV_CREATES"));const I=()=>{},w=()=>{};s.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const O=null===(a=Digit)||void 0===a||null===(d=a.ComponentRegistryService)||void 0===d?void 0:d.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,E.map((e,t)=>{const{component:n,texts:i,inputs:r,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n,d=Digit.UserService.getUser().info.type;return l.createElement(o.Route,{path:m.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:r,key:a},onSelect:N,onSkip:I,t:f,formData:_,onAdd:w,userType:d,editdata:h.includes("apply")?{}:D,previousData:T}))}),l.createElement(o.Route,{path:m.path+"/check"},l.createElement(O,{onSubmit:function(){try{return g.replace(m.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_,editdata:h.includes("apply")?{}:D})),l.createElement(o.Route,{path:m.path+"/acknowledgement"},l.createElement(x,{data:_,onSuccess:()=>{S(),p.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:m.path+"/"+E.indexRoute})))},SVApplicantDetails:e=>{var i,o,r,d,s,c,v,p,f,h,g,E,_,y,S,b,A,D,C,T,N,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,re,ae,ue,de,se,ce,ve,pe,me,fe,he,ge,Ee,_e,ye,Se,be,Ae,De,Ce,Te,Ne,Ie,we,Oe,xe,Re,Le,Pe,Me,Be,ke,Fe,Ve,Ue,je,He,We,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===(r=Je.owner)||void 0===r?void 0:r.vendorName)||""),[rt,at]=n.useState((null==Je||null===(d=Je.owner)||void 0===d||null===(s=d.units)||void 0===s?void 0:s.userCategory)||(null==Je||null===(c=Je.owner)||void 0===c?void 0:c.userCategory)||""),[ut,dt]=n.useState((null==Je||null===(v=Je.owner)||void 0===v||null===(p=v.units)||void 0===p?void 0:p.vendorDateOfBirth)||(null==Je||null===(f=Je.owner)||void 0===f?void 0:f.vendorDateOfBirth)||""),[st,ct]=n.useState((null==Je||null===(h=Je.owner)||void 0===h||null===(g=h.units)||void 0===g?void 0:g.gender)||(null==Je||null===(E=Je.owner)||void 0===E?void 0:E.gender)||""),[vt,pt]=n.useState((null==Qe||null===(_=Qe.vendorDetail)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.fatherName)||(null==Je||null===(S=Je.owner)||void 0===S||null===(b=S.units)||void 0===b?void 0:b.fatherName)||(null==Je||null===(A=Je.owner)||void 0===A?void 0:A.fatherName)||""),[mt,ft]=n.useState((null==Je||null===(D=Je.owner)||void 0===D||null===(C=D.units)||void 0===C?void 0:C.spouseName)||(null==Je||null===(T=Je.owner)||void 0===T?void 0:T.spouseName)||""),[ht,gt]=n.useState(!1),[Et,_t]=n.useState((null==Je||null===(N=Je.owner)||void 0===N||null===(I=N.units)||void 0===I?void 0:I.mobileNumber)||(null==Je||null===(w=Je.owner)||void 0===w?void 0:w.mobileNumber)||""),[yt,St]=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,At]=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)||""),[Dt,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)||""),[Tt,Nt]=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===(j=Je.owner)||void 0===j?void 0:j.dependentGender)||""),[It,wt]=n.useState((null==Je||null===(H=Je.owner)||void 0===H||null===(W=H.units)||void 0===W?void 0:W.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:jt}=a.useForm(),[Ht,Wt]=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===(re=oe[0])||void 0===re?void 0:re.dob)||(null==Qe||null===(ae=Qe.vendorDetail)||void 0===ae||null===(ue=ae[0])||void 0===ue?void 0:ue.dob)||"",gender:lt((null==et||null===(de=et.vendorDetail)||void 0===de||null===(se=de[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===(pe=et.vendorDetail)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.fatherName)||(null==Qe||null===(fe=Qe.vendorDetail)||void 0===fe||null===(he=fe[0])||void 0===he?void 0:he.fatherName)||"",spouseName:(null==et||null===(ge=et.vendorDetail)||void 0===ge||null===(Ee=ge[1])||void 0===Ee?void 0:Ee.name)||(null==Qe||null===(_e=Qe.vendorDetail)||void 0===_e||null===(ye=_e[1])||void 0===ye?void 0:ye.name)||"",mobileNumber:(null==et||null===(Se=et.vendorDetail)||void 0===Se||null===(be=Se[0])||void 0===be?void 0:be.mobileNo)||(null==Qe||null===(Ae=Qe.vendorDetail)||void 0===Ae||null===(De=Ae[0])||void 0===De?void 0:De.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===(Te=Ce[1])||void 0===Te?void 0:Te.dob)||(null==Qe||null===(Ne=Qe.vendorDetail)||void 0===Ne||null===(Ie=Ne[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===(je=et.vendorDetail)||void 0===je||null===(He=je[0])||void 0===He?void 0:He.emailId)||(null==Qe||null===(We=Qe.vendorDetail)||void 0===We||null===(ze=We[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(m,{currentStep:1}),l.createElement(t.FormStep,{config:$e,onSelect:()=>{const e=Yt(Ht[0].vendorDateOfBirth,"vendor"),t=!Pt||Yt(Ht[0].spouseDateBirth,"spouse"),n=!Bt||Yt(Ht[0].dependentDateBirth,"dependent");if(!e||!t||!n)return;let l=u({},Je.owner||{},{units:Ht,spouseDependentChecked:Pt,dependentNameChecked:Bt});Xe($e.key,u({},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,r,a,u,d;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===(r=e[0])||void 0===r||null===(a=r.gender)||void 0===a?void 0:a.code.charAt(0),id:"",mobileNo:null==e||null===(u=e[0])||void 0===u?void 0:u.mobileNumber,name:null==e||null===(d=e[0])||void 0===d?void 0:d.vendorName,relationshipType:"VENDOR",vendorId:null}},r=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}},a=e=>{var t,n,l,i,o,r;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===(r=e[2])||void 0===r?void 0:r.dependentName,relationshipType:"DEPENDENT",vendorId:null}},u=e=>!e||""===e.trim();if(!u(null==Ht||null===(e=Ht[0])||void 0===e?void 0:e.vendorName)){var d,s;const e=null==Ht||null===(d=Ht[0])||void 0===d?void 0:d.spouseName,t=null==Ht||null===(s=Ht[0])||void 0===s?void 0:s.dependentName;u(e)&&u(t)?l=[o(Ht)]:!u(e)&&u(t)?l=[o(Ht),r(Ht)]:u(e)||u(t)||(l=[o(Ht),r(Ht),a(Ht)])}const c=sessionStorage.getItem("Response"),v=c?JSON.parse(c):null;let p={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==Ht||null===(n=Ht[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:p,draftApplication:!0},i).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()},onSkip:()=>Xe(),t:Ze,isDisabled:!Ht[0].vendorName||!Ht[0].userCategory||!Ht[0].vendorDateOfBirth||!Ht[0].gender||!Ht[0].fatherName||Pt&&!Ht[0].spouseName||Bt&&!Ht[0].dependentName},Ht.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!=Ht.length?"#494848":"#FAFAFA"})))),style:{width:"100px",display:"inline"},onClick:e=>function(e){const t=[...Ht];1!=t.length&&(t.splice(e,1),Wt(t))}(n)}),l.createElement(t.TextInput,u({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=[...Ht];n[e].vendorName=t.target.value,ot(t.target.value),Wt(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(a.Controller,{control:jt,name:"userCategory-"+n,defaultValue:rt,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=[...Ht];n[e].userCategory=t,at(t),Wt(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=[...Ht];n[e].mobileNumber=t,_t(t),Wt(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=[...Ht];n[e].email=t.target.value;const l=t.target.value;wt(t.target.value),zt(l),Wt(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=[...Ht];n[e].vendorDateOfBirth=t.target.value,dt(t.target.value),Wt(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=[...Ht];n[e].gender=t,ct(t),Wt(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,u({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=[...Ht];n[e].fatherName=t.target.value,pt(t.target.value),Wt(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,u({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=[...Ht];n[e].spouseName=t.target.value,ft(t.target.value),Wt(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=[...Ht];n[e].spouseDateBirth=t.target.value,St(t.target.value),Wt(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,u({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=[...Ht];n[e].dependentName=t.target.value,At(t.target.value),Wt(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=[...Ht];n[e].dependentDateBirth=t.target.value,Ct(t.target.value),Wt(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=[...Ht];n[e].dependentGender=t,Nt(t),Wt(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,u({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=[...Ht];n[e].tradeNumber=t.target.value,xt(t.target.value),Wt(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=[...Ht];e.push({vendorName:"",userCategory:"",vendorDateOfBirth:"",gender:"",fatherName:"",spouseName:"",mobileNumber:"",spouseDateBirth:"",dependentName:"",dependentDateBirth:"",dependentGender:"",email:"",tradeNumber:""}),Wt(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,r,d,s,c,v,p,f,h,g,E,_,y,A,D,C,T,N,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,re,ae,ue,de,se,ce,ve,pe,me,fe,he,ge,Ee,_e,ye,Se,be;let{t:Ae,config:De,onSelect:Ce,userType:Te,formData:Ne,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==Ne||null===(i=Ne.businessDetails)||void 0===i?void 0:i.vendingType)||Re((null==we?void 0:we.vendingActivity)||(null==Ie?void 0:Ie.vendingActivity))||(null==Ne||null===(o=Ne.businessDetails)||void 0===o?void 0:o.vendingType)||""),[Me,Be]=n.useState((null==Ne||null===(r=Ne.businessDetails)||void 0===r?void 0:r.vendingZones)||Re((null==we?void 0:we.vendingZone)||(null==Ie?void 0:Ie.vendingZone))||""),[ke,Fe]=n.useState((null==Ne||null===(d=Ne.businessDetails)||void 0===d?void 0:d.location)||""),[Ve,Ue]=n.useState((null==Ne||null===(s=Ne.businessDetails)||void 0===s?void 0:s.areaRequired)||(null==we?void 0:we.vendingArea)||(null==Ie?void 0:Ie.vendingArea)||""),[je,He]=n.useState((null==Ne||null===(c=Ne.businessDetails)||void 0===c?void 0:c.nameOfAuthority)||(null==we?void 0:we.localAuthorityName)||(null==Ie?void 0:Ie.localAuthorityName)||""),[We,ze]=n.useState((null==Ne||null===(v=Ne.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===(p=we.vendingOperationTimeDetails)||void 0===p?void 0:p.length)||7===(null==Ie||null===(f=Ie.vendingOperationTimeDetails)||void 0===f?void 0:f.length)||(null==Ne||null===(h=Ne.businessDetails)||void 0===h?void 0:h.isSameForAll)),[$e,Xe]=n.useState((null==Ne||null===(g=Ne.businessDetails)||void 0===g?void 0:g.daysOfOperation)||[{name:"Monday",isSelected:!1,startTime:(null==we||null===(E=we.vendingOperationTimeDetails)||void 0===E||null===(_=E[0])||void 0===_?void 0:_.fromTime)||(null==Ie||null===(y=Ie.vendingOperationTimeDetails)||void 0===y||null===(A=y[0])||void 0===A?void 0:A.fromTime)||"",endTime:(null==we||null===(D=we.vendingOperationTimeDetails)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.toTime)||(null==Ie||null===(T=Ie.vendingOperationTimeDetails)||void 0===T||null===(N=T[0])||void 0===N?void 0:N.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===(j=U[2])||void 0===j?void 0:j.toTime)||(null==Ie||null===(H=Ie.vendingOperationTimeDetails)||void 0===H||null===(W=H[2])||void 0===W?void 0:W.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===(re=we.vendingOperationTimeDetails)||void 0===re||null===(ae=re[5])||void 0===ae?void 0:ae.fromTime)||(null==Ie||null===(ue=Ie.vendingOperationTimeDetails)||void 0===ue||null===(de=ue[5])||void 0===de?void 0:de.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===(pe=ve[5])||void 0===pe?void 0:pe.toTime)||""},{name:"Sunday",isSelected:!1,startTime:(null==we||null===(me=we.vendingOperationTimeDetails)||void 0===me||null===(fe=me[6])||void 0===fe?void 0:fe.fromTime)||(null==Ie||null===(he=Ie.vendingOperationTimeDetails)||void 0===he||null===(ge=he[6])||void 0===ge?void 0:ge.fromTime)||"",endTime:(null==we||null===(Ee=we.vendingOperationTimeDetails)||void 0===Ee||null===(_e=Ee[6])||void 0===_e?void 0:_e.toTime)||(null==Ie||null===(ye=Ie.vendingOperationTimeDetails)||void 0===ye||null===(Se=ye[6])||void 0===Se?void 0:Se.toTime)||""}]),[Je,Qe]=n.useState((null==Ne||null===(be=Ne.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=>u({},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=>u({},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"}},Ae("SV_SELECT_ALL"))),Cell:()=>l.createElement("div",{className:"SVTableCells"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:qe,disabled:!0}))},{Header:Ae("SV_DAY"),accessor:"name"},{Header:Ae("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:Ae("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}=a.useForm(),[ot,rt]=n.useState(!1),{data:at}=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 ut=[];at&&at.map(e=>{ut.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:dt}=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=[];dt&&dt.map(e=>{st.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const ct=()=>{if(!et())return void Ye({error:!0,label:Ae("SV_TIME_OPERATIONS_VALIDATION")});let e;e=u({},Ne.businessDetails,{vendingType:Le,vendingZones:Me,location:ke,areaRequired:Ve,nameOfAuthority:je,vendingLiscence:We,daysOfOperation:$e,isSameForAll:qe,backupDays:Je}),Ce(De.key,e,!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,r;let a=[],u=Digit.ULBService.getCitizenCurrentTenant(!0);const d=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,gender:null==e||null===(m=e.owner)||void 0===m||null===(f=m.units)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(E=e.owner)||void 0===E||null===(_=E.units)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(S=e.owner)||void 0===S||null===(b=S.units)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.vendorName,relationshipType:"VENDOR",vendorId:null}},s=e=>{var t,n,l,i,o,r,a,u,d,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===(r=o[1])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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,r,a,u,d,s,c,v,p,m,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===(r=o[2])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,fatherName:"",gender:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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===(p=e.owner)||void 0===p||null===(m=p.units)||void 0===m||null===(f=m[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},v=e=>!e||""===e.trim();if(!v(null==Ne||null===(e=Ne.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var p,m,f,h,g,E;const e=null==Ne||null===(p=Ne.owner)||void 0===p||null===(m=p.units)||void 0===m||null===(f=m[0])||void 0===f?void 0:f.spouseName,t=null==Ne||null===(h=Ne.owner)||void 0===h||null===(g=h.units)||void 0===g||null===(E=g[0])||void 0===E?void 0:E.dependentName;v(e)&&v(t)?a=[d(Ne)]:!v(e)&&v(t)?a=[d(Ne),s(Ne)]:v(e)||v(t)||(a=[d(Ne),s(Ne),c(Ne)])}const _=$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"),S=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==S||null===(l=S.SVDetail)||void 0===l?void 0:l.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:je,tenantId:u,termsAndCondition:"Y",tradeLicenseNo:null==Ne||null===(i=Ne.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.tradeNumber,vendingActivity:null==Le?void 0:Le.code,vendingArea:Ve||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:_,vendingZone:null==Me?void 0:Me.code,vendorDetail:[...a],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},u).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"===Te&&ct()},[Le,Me,ke,Ve,je,We,$e]),l.createElement(l.Fragment,null,l.createElement(m,{currentStep:2}),l.createElement("div",null,ot&&l.createElement(S,{t:Ae,onSelect:Ce,formData:Ne,handleRemove:()=>{rt(!ot)},onSave:function(e){Fe(e),rt(!1)}}),!ot&&l.createElement(t.FormStep,{config:De,onSelect:ct,onSkip:()=>Ce(),t:Ae,isDisabled:!Le||!Me||("STATIONARY"===(null==Le?void 0:Le.code)?!Ve:null)||!je||!$e},l.createElement("div",null,l.createElement(t.CardLabel,null,""+Ae("SV_VENDING_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:it,name:"vendingType",defaultValue:Le,rules:{required:Ae("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Le,select:Pe,option:ut,optionKey:"i18nKey",t:Ae,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Ae("SV_VENDING_ZONES")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:it,name:"vendingZones",defaultValue:Me,rules:{required:Ae("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Me,select:Be,option:st,optionKey:"i18nKey",t:Ae,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+Ae("SV_LOCATION")),l.createElement("div",null,l.createElement(t.TextInput,{isMandatory:!1,optionKey:"i18nKey",t:Ae,style:Ke,name:"location",value:ke,onChange:function(e){Ne.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=>{rt(!ot)}})),l.createElement(t.CardLabel,null,Ae("SV_DAY_HOUR_OPERATION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(b,{t:Ae,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,""+Ae("SV_AREA_REQUIRED")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:Ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"areaRequired",value:Ve,onChange:function(e){/[a-zA-Z]/.test(e.target.value)&&Ye({error:!0,label:Ae("SV_CITIZEN_AREA_VALIDATION")}),Ue(e.target.value)},style:Ke,ValidationRequired:!1},Oe={isRequired:!0,pattern:"^[0-9. ]{1,3}$",type:"tel",title:Ae("SV_INVALID_AREA")}))),l.createElement(t.CardLabel,null,""+Ae("SV_LOCAL_AUTHORITY_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:Ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"nameOfAuthority",value:je,onChange:function(e){He(e.target.value)},style:Ke,ValidationRequired:!1},Oe={isRequired:!0,pattern:"^[a-zA-Z-/ ]*$",type:"text",title:Ae("SV_INPUT_DID_NOT_MATCH")})),l.createElement(t.CardLabel,null,""+Ae("SV_VENDING_LISCENCE")),l.createElement(t.TextInput,u({t:Ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vendingLiscence",value:We,onChange:function(e){ze(e.target.value)},style:Ke,ValidationRequired:!1},Oe={isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]+$",type:"text",title:Ae("PT_NAME_ERROR_MESSAGE")})))),Ge&&l.createElement(t.Toast,{error:Ge.error,warning:Ge.warning,label:Ae(Ge.label),onClose:()=>{Ye(null)}})))},GIS:S,SVRequiredDoc:e=>{var n;let{t:i,onSelect:o}=e;Digit.ULBService.getCurrentTenantId();const r=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:a,data:u={}}=Digit.Hooks.sv.useSVDoc(r,"StreetVending","Documents");let d=null==u||null===(n=u.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,a&&l.createElement(t.Loader,null),Array.isArray(d)?d.map((e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(f(o,".","_"))),r.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("COMMON_NEXT"),onSubmit:o}))))},SVDayAndTimeSlot:e=>{let{day:n,onDayToggle:i,onSameForAllChange:o,isSameForAll:r,onTimeChange:a}=e,d={};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,u({style:{width:"100%",marginLeft:"80px"},type:"time",name:"startTime",value:(null==n?void 0:n.startTime)||"",onChange:e=>a("startTime",e.target.value),placeholder:"Start Time"},d={isRequired:!!n.isSelecte})),l.createElement(t.TextInput,u({style:{width:"100%",marginLeft:"15px"},type:"time",name:"endTime",value:(null==n?void 0:n.endTime)||"",onChange:e=>a("endTime",e.target.value),placeholder:"End Time"},d={isRequired:!!n.isSelecte})),(null==n?void 0:n.startTime)&&(null==n?void 0:n.endTime)&&l.createElement(t.CheckBox,{style:{width:"100%"},checked:!r,onChange:()=>o(null==n?void 0:n.startTime,null==n?void 0:n.endTime),label:"Same for All Fields"}))))},SVAdrressDetails:e=>{var i,r,d,s,c,v,p,f,h,g,E,_,y,S,b,A,D,C,T,N,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,re,ae,ue,de,se,ce,ve,pe,me,fe,he,ge,Ee,_e,ye,Se,be,Ae,De,Ce,Te,Ne,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,[je,He]=n.useState((null==Le||null===(i=Le.address)||void 0===i?void 0:i.pincode)||(null==Me||null===(r=Me.addressDetails)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.pincode)||(null==Pe||null===(s=Pe.addressDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.pincode)||""),[We,ze]=n.useState((null==Le||null===(v=Le.address)||void 0===v?void 0:v.city)||ke((null==Me||null===(p=Me.addressDetails)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.city)||(null==Pe||null===(h=Pe.addressDetails)||void 0===h||null===(g=h[0])||void 0===g?void 0:g.city))||""),[Ke,Ge]=n.useState((null==Le||null===(E=Le.address)||void 0===E?void 0:E.locality)||ke((null==Me||null===(_=Me.addressDetails)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.locality)||(null==Pe||null===(S=Pe.addressDetails)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.locality))||""),[Ye,qe]=n.useState((null==Le||null===(A=Le.address)||void 0===A?void 0:A.houseNo)||(null==Me||null===(D=Me.addressDetails)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.houseNo)||(null==Pe||null===(T=Pe.addressDetails)||void 0===T||null===(N=T[0])||void 0===N?void 0:N.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===(j=Pe.addressDetails)||void 0===j||null===(H=j[0])||void 0===H?void 0:H.addressLine2)||""),[tt,nt]=n.useState((null==Le||null===(W=Le.correspondenceAddress)||void 0===W?void 0:W.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,rt]=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))||""),[at,ut]=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===(re=oe[1])||void 0===re?void 0:re.houseNo)||(null==Pe||null===(ae=Pe.addressDetails)||void 0===ae||null===(ue=ae[1])||void 0===ue?void 0:ue.houseNo)||""),[dt,st]=n.useState((null==Le||null===(de=Le.correspondenceAddress)||void 0===de?void 0:de.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===(pe=ve[1])||void 0===pe?void 0:pe.landmark)||""),[ct,vt]=n.useState((null==Le||null===(me=Le.correspondenceAddress)||void 0===me?void 0:me.caddressline1)||(null==Me||null===(fe=Me.addressDetails)||void 0===fe||null===(he=fe[1])||void 0===he?void 0:he.addressLine1)||(null==Pe||null===(ge=Pe.addressDetails)||void 0===ge||null===(Ee=ge[1])||void 0===Ee?void 0:Ee.addressLine1)||""),[pt,mt]=n.useState((null==Le||null===(_e=Le.correspondenceAddress)||void 0===_e?void 0:_e.caddressline2)||(null==Me||null===(ye=Me.addressDetails)||void 0===ye||null===(Se=ye[1])||void 0===Se?void 0:Se.addressLine2)||(null==Pe||null===(be=Pe.addressDetails)||void 0===be||null===(Ae=be[1])||void 0===Ae?void 0:Ae.addressLine2)||""),[ft,ht]=n.useState((null==Le||null===(De=Le.correspondenceAddress)||void 0===De?void 0:De.isAddressSame)||(null==Me||null===(Ce=Me.addressDetails)||void 0===Ce||null===(Te=Ce[1])||void 0===Te?void 0:Te.isAddressSame)||(null==Pe||null===(Ne=Pe.addressDetails)||void 0===Ne||null===(Ie=Ne[1])||void 0===Ie?void 0:Ie.isAddressSame)||!1),{control:gt}=a.useForm(),Et={width:"EMPLOYEE"===Ue.type?"50%":"86%"},{data:_t}=Digit.Hooks.useBoundaryLocalities(null==We?void 0:We.code,"revenue",{enabled:!!We},we);let yt=[];_t&&_t.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 St=()=>{var e,t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,C,T,N,I,w,O,x,R,L,P;let M=[],B=Digit.ULBService.getCitizenCurrentTenant(!0);const k=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,gender:null==e||null===(m=e.owner)||void 0===m||null===(f=m.units)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(E=e.owner)||void 0===E||null===(_=E.units)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(S=e.owner)||void 0===S||null===(b=S.units)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.vendorName,relationshipType:"VENDOR",vendorId:null}},F=e=>{var t,n,l,i,o,r,a,u,d,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===(r=o[1])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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,r,a,u,d,s,c,v,p,m,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===(r=o[2])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,fatherName:"",gender:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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===(p=e.owner)||void 0===p||null===(m=p.units)||void 0===m||null===(f=m[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 j,H,W,z,K,G;const e=null==Le||null===(j=Le.owner)||void 0===j||null===(H=j.units)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.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===(r=Me.addressDetails)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.city)||(null==Le||null===(u=Le.address)||void 0===u||null===(d=u.city)||void 0===d?void 0:d.name)||(null==We?void 0:We.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===(p=v.city)||void 0===p?void 0:p.code)||(null==We?void 0:We.code),doorNo:"",houseNo:(null==Le||null===(m=Le.address)||void 0===m?void 0:m.houseNo)||Ye,landmark:(null==Le||null===(f=Le.address)||void 0===f?void 0:f.landmark)||Ze,locality:(null==Le||null===(h=Le.address)||void 0===h||null===(g=h.locality)||void 0===g?void 0:g.i18nKey)||(null==Ke?void 0:Ke.i18nKey),localityCode:(null==Le||null===(E=Le.address)||void 0===E||null===(_=E.locality)||void 0===_?void 0:_.code)||(null==Ke?void 0:Ke.code),pincode:(null==Le||null===(y=Le.address)||void 0===y?void 0:y.pincode)||je,streetName:"",vendorId:""},{addressId:"",addressLine1:ct,addressLine2:pt,addressType:"",city:(null==Me||null===(S=Me.addressDetails)||void 0===S||null===(b=S[1])||void 0===b?void 0:b.city)||(null==lt?void 0:lt.name),cityCode:(null==Me||null===(A=Me.addressDetails)||void 0===A||null===(D=A[1])||void 0===D?void 0:D.cityCode)||(null==lt?void 0:lt.code),doorNo:"",houseNo:at,landmark:dt,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===(T=Le.businessDetails)||void 0===T?void 0:T.nameOfAuthority,tenantId:B,termsAndCondition:"Y",tradeLicenseNo:null==Le||null===(N=Le.owner)||void 0===N||null===(I=N.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=u({},e,{cpincode:tt,ccity:lt,clocality:ot,chouseNo:at,clandmark:dt,caddressline1:ct,caddressline2:pt,isAddressSame:ft});xe(Oe.key,u({},Le[Oe.key],t),!1),!window.location.href.includes("edit")&&St()}else{let t=u({},e,{pincode:je,city:We,locality:Ke,houseNo:Ye,landmark:Ze,addressline1:Xe,addressline2:Qe});xe(Oe.key,u({},Le[Oe.key],t),!1),!window.location.href.includes("edit")&&St()}},At=()=>xe();return n.useEffect(()=>{"citizen"===Re&&bt()},[je,We,Ke,Ye,Ze,Xe,Qe,lt,at,ot,ct,pt]),Fe.includes("correspondence")?l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(m,{currentStep:3}):null,l.createElement(t.FormStep,{config:Oe,onSelect:bt,onSkip:At,t:we,isDisabled:!(lt&&at&&ot&&ct&&pt&&tt)},l.createElement("div",null,l.createElement(t.CheckBox,{label:we("SV_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{0==ft?(ht(!0),nt(je),it(We),rt(Ke),ut(Ye),st(Ze),vt(Xe),mt(Qe)):(ht(!1),nt(""),it(""),rt(""),ut(""),st(""),vt(""),mt(""))},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,u({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"chouseNo",value:at,placeholder:"Enter House No",onChange:e=>{ut(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,u({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,u({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"caddressline2",value:pt,placeholder:"Enter Address",onChange:e=>{mt(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,u({t:we,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"clandmark",value:dt,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(a.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(a.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:rt,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(m,{currentStep:3}):null,l.createElement(t.FormStep,{config:Oe,onSelect:bt,onSkip:At,t:we,isDisabled:!(We&&Ye&&Ke&&Xe&&Qe&&je)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+we("SV_HOUSE_NO")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:Ye,placeholder:"Enter House No",onChange:e=>{qe(e.target.value)},style:Et,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,u({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:Xe,placeholder:"Enter Address",onChange:e=>{Je(e.target.value)},style:Et,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,u({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:Qe,placeholder:"Enter Address",onChange:e=>{et(e.target.value)},style:Et,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,u({t:we,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:Ze,placeholder:"Enter Landmark",onChange:e=>{$e(e.target.value)},style:Et,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(a.Controller,{control:gt,name:"city",defaultValue:We,rules:{required:we("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:We,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(a.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:je,onChange:e=>{He(e.target.value)},placeholder:"Enter Pincode",style:Et,ValidationRequired:!0,validation:{required:!0,pattern:"^[0-9]{6}$",type:"tel",title:we("SV_ADDRESS_PINCODE_INVALID")},maxLength:6}))))},SVBankDetails:e=>{var i,o,r,a,d,s,c,v,p,f,h,g,E,_,y,S,b,D;let{t:C,config:T,onSelect:N,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===(r=O.bankDetail)||void 0===r?void 0:r.accountNumber)||"",confirmAccountNumber:(null==w||null===(a=w.bankdetails)||void 0===a?void 0:a.confirmAccountNumber)||(null==x||null===(d=x.bankDetail)||void 0===d?void 0:d.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===(p=O.bankDetail)||void 0===p?void 0:p.ifscCode)||"",bankName:(null==w||null===(f=w.bankdetails)||void 0===f?void 0:f.bankName)||(null==x||null===(h=x.bankDetail)||void 0===h?void 0:h.bankName)||(null==O||null===(g=O.bankDetail)||void 0===g?void 0:g.bankName)||"",bankBranchName:(null==w||null===(E=w.bankdetails)||void 0===E?void 0:E.bankBranchName)||(null==x||null===(_=x.bankDetail)||void 0===_?void 0:_.bankBranchName)||(null==O||null===(y=O.bankDetail)||void 0===y?void 0:y.bankBranchName)||"",accountHolderName:(null==w||null===(S=w.bankdetails)||void 0===S?void 0:S.accountHolderName)||(null==x||null===(b=x.bankDetail)||void 0===b?void 0:b.accountHolderName)||(null==O||null===(D=O.bankDetail)||void 0===D?void 0:D.accountHolderName)||""}),[P,M]=n.useState(null),B=Digit.UserService.getUser().info,k=n.useCallback(function(){try{const e=A(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=>u({},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?(N(T.key,u({},w.bankdetails,R),!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,C,T,N,I,O,L,P,M,B,k,F,V,U,j,H,W;let z=[],K=Digit.ULBService.getCitizenCurrentTenant(!0);const G=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,gender:null==e||null===(m=e.owner)||void 0===m||null===(f=m.units)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(E=e.owner)||void 0===E||null===(_=E.units)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(S=e.owner)||void 0===S||null===(b=S.units)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.vendorName,relationshipType:"VENDOR",vendorId:null}},Y=e=>{var t,n,l,i,o,r,a,u,d,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===(r=o[1])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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,r,a,u,d,s,c,v,p,m,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===(r=o[2])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,fatherName:"",gender:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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===(p=e.owner)||void 0===p||null===(m=p.units)||void 0===m||null===(f=m[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===(r=w.address)||void 0===r||null===(a=r.city)||void 0===a?void 0:a.name,cityCode:null==w||null===(u=w.address)||void 0===u||null===(d=u.city)||void 0===d?void 0:d.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===(p=v.locality)||void 0===p?void 0:p.i18nKey,localityCode:null==w||null===(m=w.address)||void 0===m||null===(f=m.locality)||void 0===f?void 0:f.code,pincode:null==w||null===(h=w.address)||void 0===h?void 0:h.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==w||null===(g=w.correspondenceAddress)||void 0===g?void 0:g.caddressline1,addressLine2:null==w||null===(E=w.correspondenceAddress)||void 0===E?void 0:E.caddressline2,addressType:"",city:null==w||null===(_=w.correspondenceAddress)||void 0===_||null===(y=_.ccity)||void 0===y?void 0:y.name,cityCode:null==w||null===(S=w.correspondenceAddress)||void 0===S||null===(b=S.ccity)||void 0===b?void 0:b.code,doorNo:"",houseNo:null==w||null===(A=w.correspondenceAddress)||void 0===A?void 0:A.chouseNo,landmark:null==w||null===(D=w.correspondenceAddress)||void 0===D?void 0:D.clandmark,locality:null==w||null===(C=w.correspondenceAddress)||void 0===C||null===(T=C.clocality)||void 0===T?void 0:T.i18nKey,localityCode:null==w||null===(N=w.correspondenceAddress)||void 0===N||null===(I=N.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===(j=w.businessDetails)||void 0===j?void 0:j.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:ne,vendingZone:null==w||null===(H=w.businessDetails)||void 0===H||null===(W=H.vendingZones)||void 0===W?void 0:W.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(m,{currentStep:4}),l.createElement(t.FormStep,{config:T,onSelect:F,onSkip:()=>N(),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:r,disabled:a}=e;return l.createElement("div",{key:i},l.createElement(t.CardLabel,null,C(n)),l.createElement(t.TextInput,u({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=>u({},n,{[e]:t}))}(i,e.target.value,o,r),style:V,disabled:a||!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,r;let{t:a,config:d,onSelect:s,formData:c,editdata:v,previousData:p}=e;const[f,h]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[g,E]=n.useState(null),[_,y]=n.useState(!0),[S,b]=n.useState(!0),A=Digit.ULBService.getStateId(),{isLoading:C,data:T}=Digit.Hooks.sv.useSVDoc(A,"StreetVending","Documents"),N=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==T||null===(e=T.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,S,T]),l.createElement("div",null,l.createElement(m,{currentStep:5}),C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:d,onSelect:()=>{let e=u({},c.documents,{documents:f});s(d.key,e),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,r,a,u,d,s,v,m,h,g,E,_,y,S,b,A,D,C,T,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z;let $=[],X=Digit.ULBService.getCitizenCurrentTenant(!0);const J=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,gender:null==e||null===(m=e.owner)||void 0===m||null===(f=m.units)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(E=e.owner)||void 0===E||null===(_=E.units)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(S=e.owner)||void 0===S||null===(b=S.units)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.vendorName,relationshipType:"VENDOR",vendorId:null}},Q=e=>{var t,n,l,i,o,r,a,u,d,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===(r=o[1])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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,r,a,u,d,s,c,v,p,m,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===(r=o[2])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,fatherName:"",gender:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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===(p=e.owner)||void 0===p||null===(m=p.units)||void 0===m||null===(f=m[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,re,ae;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===(re=oe.units)||void 0===re||null===(ae=re[0])||void 0===ae?void 0:ae.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 ue=(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:""})),de=sessionStorage.getItem("Response"),se=JSON.parse(de);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===(r=c.address)||void 0===r||null===(a=r.city)||void 0===a?void 0:a.name,cityCode:null==c||null===(u=c.address)||void 0===u||null===(d=u.city)||void 0===d?void 0:d.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===(m=c.address)||void 0===m||null===(h=m.locality)||void 0===h?void 0:h.i18nKey,localityCode:null==c||null===(g=c.address)||void 0===g||null===(E=g.locality)||void 0===E?void 0:E.code,pincode:null==c||null===(_=c.address)||void 0===_?void 0:_.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==c||null===(y=c.correspondenceAddress)||void 0===y?void 0:y.caddressline1,addressLine2:null==c||null===(S=c.correspondenceAddress)||void 0===S?void 0:S.caddressline2,addressType:"",city:null==c||null===(b=c.correspondenceAddress)||void 0===b||null===(A=b.ccity)||void 0===A?void 0:A.name,cityCode:null==c||null===(D=c.correspondenceAddress)||void 0===D||null===(C=D.ccity)||void 0===C?void 0:C.code,doorNo:"",houseNo:null==c||null===(T=c.correspondenceAddress)||void 0===T?void 0:T.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==p?void 0:p.draftId)||(null==se||null===(U=se.SVDetail)||void 0===U?void 0:U.draftId),documentDetails:N(f),localAuthorityName:null==c||null===(j=c.businessDetails)||void 0===j?void 0:j.nameOfAuthority,tenantId:X,termsAndCondition:"Y",tradeLicenseNo:null==c||null===(H=c.owner)||void 0===H||null===(W=H.units)||void 0===W||null===(z=W[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:ue,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:_},null==T||null===(o=T.StreetVending)||void 0===o||null===(r=o.Documents)||void 0===r?void 0:r.map((e,t)=>l.createElement(D,{key:t,document:e,t:a,error:g,setError:E,setDocuments:h,documents:f,setCheckRequiredFields:b,formData:c,editdata:v,previousData:p})),g&&l.createElement(t.Toast,{label:g,onClose:()=>E(null),error:!0})))},CheckPage:e=>{var o,r,a,d,s,c,v,p,f,E,S,A,D,T,N,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,re,ae;let{onSubmit:ue,editdata:de,value:se={}}=e;const{t:ce}=i.useTranslation(),{owner:ve,businessDetails:pe,address:me,bankdetails:fe,documents:he,specialCategoryData:ge}=se,[Ee,_e]=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"}],Se=(null==pe||null===(o=pe.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!=de&&de.documentDetails&&Array.isArray(null==de?void 0:de.documentDetails)&&(null==de||de.documentDetails.map(e=>{be.push(u({},e,{module:"StreetVending"}))})),_.isEmpty(de)&&null!=he&&he.documents&&he.documents.forEach(e=>{be.some(t=>t.documentType===e.documentType)||be.push(u({},e,{module:"StreetVending"}))}),_.isEmpty(de)){const e=JSON.parse(sessionStorage.getItem("CategoryDocument"));e&&Array.isArray(e)&&e.forEach(e=>{be.some(t=>t.documentType===e.documentType)||be.push(u({},e,{module:"StreetVending"}))})}const{data:Ae}=Digit.Hooks.useDocumentSearch(be,{enabled:(null==be?void 0:be.length)>0});let De=[];var Ce;return(null==Ae||null===(r=Ae.pdfFiles)||void 0===r?void 0:r.length)>0&&(null==Ae||null===(Ce=Ae.pdfFiles)||void 0===Ce||Ce.map(e=>{"StreetVending"==(null==e?void 0:e.module)&&De.push(e)})),l.createElement(l.Fragment,null,l.createElement(m,{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(h(null==ve||null===(a=ve.units)||void 0===a||null===(d=a[0])||void 0===d?void 0:d.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(h(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(h(null==ve||null===(v=ve.units)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.vendorDateOfBirth))}),l.createElement(t.Row,{label:ce("SV_GENDER"),text:""+ce(h(null==ve||null===(f=ve.units)||void 0===f||null===(E=f[0])||void 0===E||null===(S=E.gender)||void 0===S?void 0:S.code))}),l.createElement(t.Row,{label:ce("SV_FATHER_NAME"),text:""+ce(h(null==ve||null===(A=ve.units)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.fatherName))}),null!=ve&&null!==(T=ve.units)&&void 0!==T&&null!==(N=T[0])&&void 0!==N&&N.email?l.createElement(t.Row,{label:ce("SV_EMAIL"),text:""+ce(h(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(h(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(h(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(h(null==ve||null===(U=ve.units)||void 0===U||null===(j=U[0])||void 0===j?void 0:j.dependentName))," ",l.createElement("span",{className:"astericColor"},"(",ce(null!=ve&&ve.dependentNameChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ve&&null!==(H=ve.units)&&void 0!==H&&null!==(W=H[0])&&void 0!==W&&W.dependentDateBirth?l.createElement(t.Row,{label:ce("SV_DEPENDENT_DATE_OF_BIRTH"),text:""+ce(h(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(h(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(h(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(h(null==pe||null===(te=pe.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(h(null==pe||null===(ne=pe.vendingZones)||void 0===ne?void 0:ne.value))}),l.createElement(t.Row,{label:ce("SV_AREA_REQUIRED"),text:""+ce(h(null==pe?void 0:pe.areaRequired))}),l.createElement(t.Row,{label:ce("SV_LOCAL_AUTHORITY_NAME"),text:""+ce(h(null==pe?void 0:pe.nameOfAuthority))}),null!=pe&&pe.vendingLiscence?l.createElement(t.Row,{label:ce("SV_VENDING_LISCENCE"),text:""+ce(h(null==pe?void 0:pe.vendingLiscence))}):null,l.createElement("span",{style:{marginTop:"5px",fontSize:"18px",fontWeight:"bold"}},ce("SV_DAY_HOUR_OPERATION")),l.createElement(b,{t:ce,data:Se,columns:ye,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:Se.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(h(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(h(null==fe?void 0:fe.ifscCode))}),l.createElement(t.Row,{label:ce("SV_BANK_NAME"),text:""+ce(h(null==fe?void 0:fe.bankName))}),l.createElement(t.Row,{label:ce("SV_BANK_BRANCH_NAME"),text:""+ce(h(null==fe?void 0:fe.bankBranchName))}),l.createElement(t.Row,{label:ce("SV_ACCOUNT_HOLDER_NAME"),text:""+ce(h(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(h(null==me?void 0:me.addressline1)),actionButton:l.createElement(C,{jumpTo:"/digit-ui/citizen/sv/apply/address-details"})}),l.createElement(t.Row,{label:ce("SV_ADDRESS_LINE2"),text:""+ce(h(null==me?void 0:me.addressline2))}),l.createElement(t.Row,{label:ce("SV_CITY"),text:""+ce(h(null==me||null===(le=me.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(h(null==me||null===(oe=me.locality)||void 0===oe?void 0:oe.i18nKey))}),null!=me&&me.pincode?l.createElement(t.Row,{label:ce("SV_ADDRESS_PINCODE"),text:""+ce(h(null==me?void 0:me.pincode))}):null,null!=me&&me.landmark?l.createElement(t.Row,{label:ce("SV_LANDMARK"),text:""+ce(h(null==me?void 0:me.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(h(null==ge||null===(re=ge.ownerCategory)||void 0===re?void 0:re.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(h(null==ge||null===(ae=ge.beneficiary)||void 0===ae?void 0:ae.value))}):null,null!==(null==ge?void 0:ge.enrollmentId)?l.createElement(t.Row,{label:ce("SV_ENROLLMENT_APPLICATION_NUMBER"),text:""+ce(h(null==ge?void 0:ge.enrollmentId))}):null),l.createElement(t.CardSubHeader,null,ce("SV_DOCUMENT_DETAILS_LABEL")),l.createElement(y,{documents:g(De),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:()=>{_e(!Ee)},styles:{height:"auto",marginBottom:"30px",marginTop:"10px"}})),l.createElement(t.SubmitBar,{label:ce("SV_COMMON_BUTTON_SUBMIT"),onSubmit:ue,disabled:!Ee})))},SVEmpCreate:e=>{var t,n,a,d;const c=r.useQueryClient(),v=o.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let h=[];const[g,E,_]=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,E(u({},g,{[e]:[...n]}))}else if("units"===e){let e=g.units||[];e=t,E(u({},g,{units:e}))}else E(u({},g,{[e]:u({},g[e],t)}));((e,t,n,l)=>{let i,o=m.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),a=!0):(o=m.slice(0,-2),o=o.split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let{nextStep:u={}}=h.find(e=>e.route===o),d=f.push;if(e&&(d=f.replace),n&&(u=l),null===u)return d(v.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?v.path+"/"+u+"/"+t:v.path+"/"+u,d(i)})(n,l,i,e)}g&&Object.keys(g).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(_(),c.invalidateQueries("SV_EMP_CREATE"));const S=()=>{},b=()=>{};s.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="info";const A=null===(t=Digit)||void 0===t||null===(n=t.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CheckPage"),D=null===(a=Digit)||void 0===a||null===(d=a.ComponentRegistryService)||void 0===d?void 0:d.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,h.map((e,t)=>{const{component:n,texts:i,inputs:r,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n,d=Digit.UserService.getUser().info.type;return l.createElement(o.Route,{path:v.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:r,key:a},onSelect:y,onSkip:S,t:p,formData:g,onAdd:b,userType:d}))}),l.createElement(o.Route,{path:v.path+"/check"},l.createElement(A,{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(D,{data:g,onSuccess:()=>{_(),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+"/"+h.indexRoute})))},SVAcknowledgement:e=>{let{data:r,onSuccess:a}=e;const{t:d}=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:p}=Digit.Hooks.useStore.getInitData(),{tenants:m}=p||{};return n.useEffect(()=>{try{r.tenantId=s;let e=window.location.href.includes("edit")?(e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,_,y,S,b,A,D,C,T,N,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne;let le=[];const ie=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,specialCategory:null==e||null===(m=e.specialCategoryData)||void 0===m||null===(f=m.ownerCategory)||void 0===f?void 0:f.code,gender:null==e||null===(h=e.owner)||void 0===h||null===(g=h.units)||void 0===g||null===(E=g[0])||void 0===E||null===(_=E.gender)||void 0===_?void 0:_.code.charAt(0),id:sessionStorage.getItem("venId"),mobileNo:null==e||null===(y=e.owner)||void 0===y||null===(S=y.units)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber,name:null==e||null===(A=e.owner)||void 0===A||null===(D=A.units)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},oe=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.spouseDependentChecked,fatherName:"",specialCategory:null==e||null===(d=e.specialCategoryData)||void 0===d||null===(s=d.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===(p=v[0])||void 0===p?void 0:p.spouseName,relationshipType:"SPOUSE",vendorId:null}},re=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,fatherName:"",specialCategory:null==e||null===(d=e.specialCategoryData)||void 0===d||null===(s=d.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===(p=v[0])||void 0===p||null===(m=p.dependentGender)||void 0===m?void 0:m.code.charAt(0),id:sessionStorage.getItem("venId"),mobileNo:"",name:null==e||null===(f=e.owner)||void 0===f||null===(h=f.units)||void 0===h||null===(g=h[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 ue,de,se,ce,ve,pe;const t=null==e||null===(ue=e.owner)||void 0===ue||null===(de=ue.units)||void 0===de||null===(se=de[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===(pe=ve[0])||void 0===pe?void 0:pe.dependentName;ae(t)&&ae(n)?le=[ie(e)]:!ae(t)&&ae(n)?le=[ie(e),oe(e)]:ae(t)||ae(n)||(le=[ie(e),oe(e),re(e)])}const me=(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===(r=e.address)||void 0===r?void 0:r.addressline2,addressType:"PERMANENT",city:(null==e||null===(a=e.address)||void 0===a||null===(u=a.city)||void 0===u?void 0:u.name)||(null==e||null===(d=e.address)||void 0===d||null===(s=d.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===(p=e.address)||void 0===p?void 0:p.houseNo,landmark:null==e||null===(m=e.address)||void 0===m?void 0:m.landmark,locality:null==e||null===(f=e.address)||void 0===f||null===(h=f.locality)||void 0===h?void 0:h.i18nKey,localityCode:null==e||null===(g=e.address)||void 0===g||null===(_=g.locality)||void 0===_?void 0:_.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===(S=e.correspondenceAddress)||void 0===S?void 0:S.caddressline1,addressLine2:null==e||null===(b=e.correspondenceAddress)||void 0===b?void 0:b.caddressline2,addressType:"CORRESPONDENCE",city:(null==e||null===(A=e.correspondenceAddress)||void 0===A||null===(D=A.ccity)||void 0===D?void 0:D.name)||(null==e||null===(C=e.correspondenceAddress)||void 0===C||null===(T=C.ccity)||void 0===T?void 0:T.code),cityCode:null==e||null===(N=e.correspondenceAddress)||void 0===N||null===(I=N.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===(j=e.bankdetails)||void 0===j?void 0:j.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==e||null===(H=e.specialCategoryData)||void 0===H||null===(W=H.beneficiary)||void 0===W?void 0:W.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:E(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:me,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:""}]}}}})(r):(e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,_,y,S,b,A,D,C,T,N,I,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J,Q,ee,te,ne,le,ie,oe,re,ae,ue,de,se,ce,ve,pe,me,fe,he,ge,Ee,_e;let ye=[];const Se=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,specialCategory:null==e||null===(m=e.specialCategoryData)||void 0===m||null===(f=m.ownerCategory)||void 0===f?void 0:f.code,gender:null==e||null===(h=e.owner)||void 0===h||null===(g=h.units)||void 0===g||null===(E=g[0])||void 0===E||null===(_=E.gender)||void 0===_?void 0:_.code.charAt(0),id:"",isInvolved:!0,mobileNo:null==e||null===(y=e.owner)||void 0===y||null===(S=y.units)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber,name:null==e||null===(A=e.owner)||void 0===A||null===(D=A.units)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},be=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",specialCategory:null==e||null===(u=e.specialCategoryData)||void 0===u||null===(d=u.ownerCategory)||void 0===d?void 0:d.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===(p=v[0])||void 0===p?void 0:p.spouseName,relationshipType:"SPOUSE",vendorId:null}},Ae=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,specialCategory:null==e||null===(d=e.specialCategoryData)||void 0===d||null===(s=d.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===(p=v[0])||void 0===p||null===(m=p.dependentGender)||void 0===m?void 0:m.code.charAt(0),id:"",mobileNo:"",name:null==e||null===(f=e.owner)||void 0===f||null===(h=f.units)||void 0===h||null===(g=h[0])||void 0===g?void 0:g.dependentName,relationshipType:"DEPENDENT",vendorId:null}},De=e=>!e||""===e.trim();if(!De(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,Te,Ne,Ie,we,Oe;const t=null==e||null===(Ce=e.owner)||void 0===Ce||null===(Te=Ce.units)||void 0===Te||null===(Ne=Te[0])||void 0===Ne?void 0:Ne.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;De(t)&&De(n)?ye=[Se(e)]:!De(t)&&De(n)?ye=[Se(e),be(e)]:De(t)||De(n)||(ye=[Se(e),be(e),Ae(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===(r=e.address)||void 0===r?void 0:r.addressline2,addressType:"",city:(null==e||null===(a=e.address)||void 0===a||null===(u=a.city)||void 0===u?void 0:u.name)||(null==e||null===(d=e.address)||void 0===d||null===(s=d.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===(p=e.address)||void 0===p?void 0:p.houseNo,landmark:null==e||null===(m=e.address)||void 0===m?void 0:m.landmark,locality:(null==Le||null===(f=Le.SVDetail)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.addressDetails)||void 0===g||null===(_=g[0])||void 0===_?void 0:_.locality)||(null==e||null===(y=e.address)||void 0===y||null===(S=y.locality)||void 0===S?void 0:S.i18nKey),localityCode:(null==Le||null===(b=Le.SVDetail)||void 0===b||null===(A=b[0])||void 0===A||null===(D=A.addressDetails)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.localityCode)||(null==e||null===(T=e.address)||void 0===T||null===(N=T.locality)||void 0===N?void 0:N.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===(j=U.addressDetails)||void 0===j||null===(H=j[1])||void 0===H?void 0:H.locality)||(null==e||null===(W=e.correspondenceAddress)||void 0===W||null===(z=W.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===(re=e.specialCategoryData)||void 0===re?void 0:re.enrollmentId,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==e||null===(ae=e.specialCategoryData)||void 0===ae||null===(ue=ae.ownerCategory)||void 0===ue?void 0:ue.code,draftId:(null==Le||null===(de=Le.SVDetail)||void 0===de?void 0:de.draftId)||"",documentDetails:E(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===(pe=ve.units)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.tradeNumber,vendingActivity:null==e||null===(fe=e.businessDetails)||void 0===fe||null===(he=fe.vendingType)||void 0===he?void 0:he.code,vendingArea:(null==e||null===(ge=e.businessDetails)||void 0===ge?void 0:ge.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:xe,vendingZone:null==e||null===(Ee=e.businessDetails)||void 0===Ee||null===(_e=Ee.vendingZones)||void 0===_e?void 0:_e.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}})(r);c.mutate(e,{onSuccess:a})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(Q,{t:d,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:d("SV_ACKNOWLEDGEMENT"),onSubmit:function(){try{const{SVDetail:e=[]}=c.data;let t=e||{};const n=m.find(e=>e.code===t.tenantId);return Promise.resolve($(u({},t),n,d)).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:d("CORE_COMMON_GO_TO_HOME")})))},SVApplicationDetails:pl,SVMyApplications:()=>{var e,r;const{t:a}=i.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.UserService.getUser().info,[c,v]=n.useState(""),[p,m]=n.useState(""),[f,h]=n.useState(null),[g,E]=n.useState([]);let _,y=window.location.href.split("/").pop();_=isNaN(parseInt(y))?4:parseInt(y)+50;let S={limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:d,isDraftApplication:!1,mobileNumber:null==s?void 0:s.mobileNumber};n.useEffect(()=>{h(S)},[y]);const{isLoading:b,data:A}=Digit.Hooks.sv.useSvSearchApplication({filters:u({},f,{isDraftApplication:!1})}),{isLoading:D,data:C}=Digit.Hooks.sv.useSvSearchApplication({filters:u({},f,{isDraftApplication:!0,sortOrder:"DESC"})}),T=null==C||null===(e=C.SVDetail)||void 0===e||null===(r=e[0])||void 0===r?void 0:r.draftId;n.useEffect(()=>{null!=C&&C.SVDetail&&null!=A&&A.SVDetail&&E([...C.SVDetail||[],...A.SVDetail||[]])},[C,A]);const N=e=>{E(t=>t.filter(t=>t!==e))};return b||D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,a("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,a("SV_APPLICATION_NUMBER")),l.createElement(t.TextInput,{placeholder:a("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,a("SV_REGISTERED_MOB_NUMBER")),l.createElement(t.TextInput,{placeholder:a("Enter Mobile No."),value:p,onChange:e=>m(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:a("ES_COMMON_SEARCH"),onSubmit:()=>{const e=c.trim(),t=u({},S,{applicationNumber:e||null,mobileNumber:p||null});h(t)}}),l.createElement("p",{className:"link svclearall",onClick:()=>{v(""),m("")}},a("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(ml,{application:e,tenantId:null==s?void 0:s.permanentCity,buttonLabel:a("SV_TRACK"),previousDraftId:T,onDiscard:N}))),!(null!=g&&g.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},a("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/"+_},a("SV_LOAD_MORE_MSG")))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},a("SV_NO_APPLICATION_FOUND")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(o.Link,{to:"/digit-ui/citizen/sv/apply/info"},a("SV_CLICK_TO_APPLY_NEW_APPLICATION")))))},SvApplicationDetails:()=>{var e,r,a,s,c,v,p,m,f,h,g,E,_,y,S,b,A,D,C,T,N,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:j}=Digit.Hooks.sv.useSvSearchApplication({tenantId:x,filters:{applicationNumber:O,isDraftApplication:!1}}),[H,W]=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 gl(e)?e:function(e,t){if(gl(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Il(e))||Ol.test(e)||!wl.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:li(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(gl(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(Il(t))return oi?oi.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[ri(t[n++])];return n&&n==l?e:void 0}(e,"SVDetail");return void 0===l?[]:l}(j);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){W(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($(u({},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;d(e,ai);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},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==j||null===(e=j.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==j||null===(e=j.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===(r=e[0])||void 0===r?void 0:r.name)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_FATHER_NAME"),text:(null==K||null===(a=K.vendorDetail)||void 0===a||null===(s=a[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===(p=K.vendorDetail)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.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===(h=f[0])||void 0===h?void 0:h.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===(E=g[0])||void 0===E?void 0:E.houseNo)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_ADDRESS_LINE1"),text:(null==K||null===(_=K.addressDetails)||void 0===_||null===(y=_[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===(S=K.addressDetails)||void 0===S||null===(b=S[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===(A=K.addressDetails)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.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===(T=C[0])||void 0===T?void 0:T.city)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("SV_LOCALITY"),text:(null==K||null===(N=K.addressDetails)||void 0===N||null===(I=N[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(hl,{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:j})))},Caption:fl,ViewTimeline:hl,SVSpecialCategory:e=>{var i,o,r,d,s,c,v;let{t:p,config:f,onSelect:h,userType:g,formData:_,editdata:y,previousData:S}=e;const b=Digit.UserService.getUser().info,A=e=>e?{i18nKey:e,code:e,value:e}:null,[D,C]=n.useState((null==_||null===(i=_.specialCategoryData)||void 0===i?void 0:i.ownerCategory)||A((null==S?void 0:S.disabilityStatus)||(null==y?void 0:y.disabilityStatus))||""),[T,N]=n.useState((null==_||null===(o=_.specialCategoryData)||void 0===o?void 0:o.enrollmentId)||(null==S?void 0:S.enrollmentId)||(null==y?void 0:y.enrollmentId)||""),[I,w]=n.useState((null==_||null===(r=_.specialCategoryData)||void 0===r?void 0:r.beneficiary)||A((null==S?void 0:S.benificiaryOfSocialSchemes)||(null==y?void 0:y.benificiaryOfSocialSchemes))||""),O={width:"EMPLOYEE"===b.type?"50%":"100%"},[x,R]=n.useState(null),L=null==S||null===(d=S.documentDetails)||void 0===d?void 0:d.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==D?void 0:D.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==D?void 0:D.code)}),[M,B]=n.useState((null==L?void 0:L.fileStoreId)||(null==P?void 0:P.fileStoreId)||(null==_||null===(c=_.specialCategoryData)||void 0===c?void 0:c.uploadedFile)||null),[k,F]=n.useState(!1);((null==S||null===(v=S.draftId)||void 0===v?void 0:v.length)>0||null!=y&&y.applicationNo)&&sessionStorage.setItem("CategoryDocument",JSON.stringify([{documentType:(null==S?void 0:S.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:j}=a.useForm(),{data:H}=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 W=[];H&&H.map(e=>{W.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(p("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==D?void 0:D.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(p("CS_FILE_UPLOAD_ERROR"))}).catch(()=>setError(p("CS_FILE_UPLOAD_ERROR"))).finally(()=>{F(!1)})))},[x,p]);const G=()=>{let e=u({},_.specialCategoryData,{ownerCategory:D,beneficiary:I,uploadedFile:M,enrollmentId:T});h(f.key,e,!1),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,y,b,A,C,N,w,O,x,R,L,P,M,B,k,F,V,U,j,H,W,z,K,G,Y,q,Z,$,X,J;let Q=[],ee=Digit.ULBService.getCitizenCurrentTenant(!0);const te=e=>{var t,n,l,i,o,r,a,u,d,s,c,v,p,m,f,h,g,E,_,y,S,b,A;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===(r=o[0])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:null==e||null===(u=e.owner)||void 0===u||null===(d=u.units)||void 0===d||null===(s=d[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===(p=v[0])||void 0===p?void 0:p.fatherName,gender:null==e||null===(m=e.owner)||void 0===m||null===(f=m.units)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.gender)||void 0===g?void 0:g.code.charAt(0),id:"",mobileNo:null==e||null===(E=e.owner)||void 0===E||null===(_=E.units)||void 0===_||null===(y=_[0])||void 0===y?void 0:y.mobileNumber,name:null==e||null===(S=e.owner)||void 0===S||null===(b=S.units)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.vendorName,relationshipType:"VENDOR",vendorId:null}},ne=e=>{var t,n,l,i,o,r,a,u,d,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===(r=o[1])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.spouseDependentChecked,fatherName:"",gender:"O",id:"",mobileNo:"",name:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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,r,a,u,d,s,c,v,p,m,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===(r=o[2])||void 0===r||null===(a=r.userCategory)||void 0===a?void 0:a.code,emailId:"",isInvolved:null==e||null===(u=e.owner)||void 0===u?void 0:u.dependentNameChecked,fatherName:"",gender:null==e||null===(d=e.owner)||void 0===d||null===(s=d.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===(p=e.owner)||void 0===p||null===(m=p.units)||void 0===m||null===(f=m[2])||void 0===f?void 0:f.dependentName,relationshipType:"DEPENDENT",vendorId:null}},ie=e=>!e||""===e.trim();if(!ie(null==_||null===(e=_.owner)||void 0===e||null===(t=e.units)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.vendorName)){var oe,re,ae,ue,de,se;const e=null==_||null===(oe=_.owner)||void 0===oe||null===(re=oe.units)||void 0===re||null===(ae=re[0])||void 0===ae?void 0:ae.spouseName,t=null==_||null===(ue=_.owner)||void 0===ue||null===(de=ue.units)||void 0===de||null===(se=de[0])||void 0===se?void 0:se.dependentName;ie(e)&&ie(t)?Q=[te(_)]:!ie(e)&&ie(t)?Q=[te(_),ne(_)]:ie(e)||ie(t)||(Q=[te(_),ne(_),le(_)])}const ce=(null==_||null===(l=_.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"),pe=JSON.parse(ve);let me={addressDetails:[{addressId:"",addressLine1:null==_||null===(i=_.address)||void 0===i?void 0:i.addressline1,addressLine2:null==_||null===(o=_.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==_||null===(r=_.address)||void 0===r||null===(a=r.city)||void 0===a?void 0:a.name,cityCode:null==_||null===(u=_.address)||void 0===u||null===(d=u.city)||void 0===d?void 0:d.code,doorNo:"",houseNo:null==_||null===(s=_.address)||void 0===s?void 0:s.houseNo,landmark:null==_||null===(c=_.address)||void 0===c?void 0:c.landmark,locality:null==_||null===(v=_.address)||void 0===v||null===(p=v.locality)||void 0===p?void 0:p.i18nKey,localityCode:null==_||null===(m=_.address)||void 0===m||null===(f=m.locality)||void 0===f?void 0:f.code,pincode:null==_||null===(h=_.address)||void 0===h?void 0:h.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==_||null===(g=_.correspondenceAddress)||void 0===g?void 0:g.caddressline1,addressLine2:null==_||null===(y=_.correspondenceAddress)||void 0===y?void 0:y.caddressline2,addressType:"",city:null==_||null===(b=_.correspondenceAddress)||void 0===b||null===(A=b.ccity)||void 0===A?void 0:A.name,cityCode:null==_||null===(C=_.correspondenceAddress)||void 0===C||null===(N=C.ccity)||void 0===N?void 0:N.code,doorNo:"",houseNo:null==_||null===(w=_.correspondenceAddress)||void 0===w?void 0:w.chouseNo,landmark:null==_||null===(O=_.correspondenceAddress)||void 0===O?void 0:O.clandmark,locality:null==_||null===(x=_.correspondenceAddress)||void 0===x||null===(R=x.clocality)||void 0===R?void 0:R.i18nKey,localityCode:null==_||null===(L=_.correspondenceAddress)||void 0===L||null===(P=L.clocality)||void 0===P?void 0:P.code,pincode:null==_||null===(M=_.correspondenceAddress)||void 0===M?void 0:M.cpincode,streetName:"",vendorId:"",isAddressSame:null==_||null===(B=_.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==_||null===(k=_.bankDetails)||void 0===k?void 0:k.accountHolderName,accountNumber:null==_||null===(F=_.bankDetails)||void 0===F?void 0:F.accountNumber,applicationId:"",bankBranchName:null==_||null===(V=_.bankDetails)||void 0===V?void 0:V.bankBranchName,bankName:null==_||null===(U=_.bankDetails)||void 0===U?void 0:U.bankName,id:"",ifscCode:null==_||null===(j=_.bankDetails)||void 0===j?void 0:j.ifscCode,refundStatus:"",refundType:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0}},benificiaryOfSocialSchemes:null==I?void 0:I.value,enrollmentId:T,cartLatitude:0,cartLongitude:0,certificateNo:null,disabilityStatus:null==D?void 0:D.code,draftId:(null==S?void 0:S.draftId)||(null==pe||null===(H=pe.SVDetail)||void 0===H?void 0:H.draftId),documentDetails:E(null==_||null===(W=_.documents)||void 0===W?void 0:W.documents),localAuthorityName:null==_||null===(z=_.businessDetails)||void 0===z?void 0:z.nameOfAuthority,tenantId:ee,termsAndCondition:"Y",tradeLicenseNo:null==_||null===(K=_.owner)||void 0===K||null===(G=K.units)||void 0===G||null===(Y=G[0])||void 0===Y?void 0:Y.tradeNumber,vendingActivity:null==_||null===(q=_.businessDetails)||void 0===q||null===(Z=q.vendingType)||void 0===Z?void 0:Z.code,vendingArea:(null==_||null===($=_.businessDetails)||void 0===$?void 0:$.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:ce,vendingZone:null==_||null===(X=_.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:me,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()},[D,I]);const Y=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement(l.Fragment,null,l.createElement(m,{currentStep:6}),l.createElement("div",null,l.createElement(t.FormStep,{config:f,onSelect:G,onSkip:()=>h(),t:p,isDisabled:!D},l.createElement("div",null,l.createElement(t.CardLabel,null,""+p("SV_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:j,name:"ownerCategory",defaultValue:D,rules:{required:p("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:D,select:C,option:W,style:O,optionKey:"i18nKey",t:p,placeholder:"Select"})}),D&&"NONE"!==(null==D?void 0:D.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,""+p("SV_BENEFICIARY_SCHEMES")),l.createElement(a.Controller,{control:j,name:"beneficiary",defaultValue:I,rules:{required:p("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:p,placeholder:"Select"})}),I&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+p("SV_ENROLLMENT_APPLICATION_NUMBER")),l.createElement(t.TextInput,u({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"enrollmentId",value:T,onChange:function(e){N(e.target.value)},style:O,ValidationRequired:!1},{isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]*$",type:"text",title:p("SV_INPUT_DID_NOT_MATCH")}))))),V&&l.createElement(t.Toast,{error:V.error,warning:V.warning,label:p(V.label),onClose:()=>{U(null)}})))}},di=e=>{let{stateCode:t,userType:i,tenants:r}=e;const{path:a,url:u}=o.useRouteMatch(),d=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"SV",language:d}),Object.entries(ui).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("SV_TENANTS",r),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:a,url:u,userType:i}):l.createElement(v,null)},si=e=>{let{matchPath:o}=e;const{t:r}=i.useTranslation(),[a,u,d]=Digit.Hooks.useSessionStorage("SV",{});n.useEffect(()=>{d()},[]);const s=[{link:o+"/sv/apply",i18nKey:r("sv_APPLY")},{link:o+"/sv/my-applications",i18nKey:r("sv_MY_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:r("STREET_VENDING_SERVICES"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.SVComponents={SVModule:di,SVLinks:si,SVCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("0"),{data:a,isLoading:u,isFetching:d,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(()=>{!d&&s&&r(a)},[d]),!Digit.Utils.svAccess())return null;const c=[{count:u?"-":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,p={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,p)},SV_INBOX_FILTER:e=>l.createElement(q,e),SVInboxTableConfig:e=>({SV:{inboxColumns:t=>[{Header:e("SV_APPLICATION_NUMBER"),Cell:e=>{var n,i,r,a;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/application-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.applicationNo)},null===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.applicationNo)))},mobileCell:e=>{var t;return j(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 j(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 j(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 j(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 j(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=si,exports.SVModule=di;
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");const d=[{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"}}]}],u=()=>{var e,n,i,a,r,d;const{path:u,...s}=o.useRouteMatch(),c=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("Create"),v=null===(i=Digit)||void 0===i||null===(a=i.ComponentRegistryService)||void 0===a?void 0:a.getComponent("SVMyApplications"),m=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:u+"/apply",component:c}),l.createElement(t.PrivateRoute,{path:u+"/edit",component:c}),l.createElement(t.PrivateRoute,{path:u+"/my-applications",component:v}),l.createElement(t.PrivateRoute,{path:u+"/application/:applicationNo/:tenantId",component:m}))))};function s(){return(s=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)}let c=["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 v=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"}},c.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")}))))},m=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},p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},f=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},E=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 g(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 S=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}))))},h=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 y(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function D(e){var i,o,a;let{t:r,document:d,setDocuments:u,setError:s,documents:c,id:v,editdata:m,previousData:p}=e;const f=null==c?void 0:c.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)}),E=null==p||null===(i=p.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==d?void 0:d.code)}),g=null==m||null===(o=m.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==d?void 0:d.code)}),S=Digit.UserService.getUser().info,h=e=>e?{...e,active:!0===(null==d?void 0:d.active),code:null==e?void 0:e.documentType,i18nKey:null==e?void 0:e.documentType}:null,y=h(E)||h(g)||h(f)||(1===(null==d||null===(a=d.dropdownData)||void 0===a?void 0:a.length)?null==d?void 0:d.dropdownData[0]:{}),[_,D]=n.useState(y),[b,A]=n.useState(null),[C,T]=n.useState((null==y?void 0:y.fileStoreId)||null),[N,I]=n.useState(!1);n.useEffect(()=>{var e;const t=(null==p?void 0:p.documentDetails)||(null==m?void 0:m.documentDetails)||[];null==t||null===(e=t.documentDetails)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==d?void 0:d.code)&&T(e)})},[null==m?void 0:m.documentDetails,null==p?void 0:p.documentDetails,null==d?void 0:d.code]),n.useEffect(()=>{b&&(b.size>=5242880?s(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")):(T(null),I(!0),Digit.UploadServices.Filestorage("StreetVending",b,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):s(r("CS_FILE_UPLOAD_ERROR"))}).catch(()=>s(r("CS_FILE_UPLOAD_ERROR"))).finally(()=>{I(!1)})))},[b,r]),n.useEffect(()=>{var e;null!=_&&_.code&&(null==p||null===(e=p.draftId)||void 0===e?void 0:e.length)>1?u(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==_?void 0:_.code));return C?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==_?void 0:_.code,fileStoreId:C,documentUid:C}]:t}):null!=_&&_.code&&null!=m&&m.applicationNo?u(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==_?void 0:_.code));return C?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==_?void 0:_.code,fileStoreId:C,documentUid:C}]:t}):null!=_&&_.code&&u(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==_?void 0:_.code));return C?[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==_?void 0:_.code,fileStoreId:C,documentUid:C}]:t})},[C,_,u]);const{dropdownData:O}=d;let w=O;const x=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement("div",{style:{marginBottom:"24px"}},(null==d?void 0:d.hasDropdown)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},r(null==d?void 0:d.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:_,select:e=>{D(e)},style:{width:"EMPLOYEE"===(null==S?void 0:S.type)?"50%":"100%"},option:w.map(e=>{var t;return{...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==S?void 0:S.type)?"30%":null}},l.createElement(t.UploadFile,{onUpload:e=>{A(e.target.files[0])},onDelete:()=>{T(null)},id:v,message:N?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(x,null),l.createElement("span",null,"Uploading...")):C?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!C}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const b=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)}})},A={date:t.DatePicker,mobileNumber:t.MobileNumber},C=e=>{var n;let{onSearch:o,type:a,onClose:d,searchFields:u,searchParams:s,isInboxPage:c,clearSearch:v}=e;const{t:m}=i.useTranslation(),{handleSubmit:p,reset:f,watch:E,control:g,formState:S,setValue:h}=r.useForm({defaultValues:c?s:{locality:null,city:null,...s}}),y=E(),_=innerWidth<=640;function D(){const e=u.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(f(e),c){const e={...s};e.delete=[],u.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o({...e})}else v()}const b=e=>l.createElement(t.LinkLabel,{style:{display:"inline",margin:"10px",...e?{margin:0}:{}},onClick:D},m("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:p(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],u.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===a&&d()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:c?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===a||_)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,m("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:d},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(c?"":"for-search"),style:{width:"100%",display:"grid"}},null==u||null===(n=u.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,m(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(r.Controller,e.type?{render:t=>l.createElement(null==A?void 0:A[e.type],{formValue:y,setValue:h,onChange:t.onChange,value:t.value}),name:e.name,control:g,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:g,defaultValue:""})),null!=S&&null!==(i=S.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==S||null===(o=S.errors)||void 0===o||null===(a=o[e.name])||void 0===a?void 0:a.message):null)}),c&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,b())),"desktop"===a&&!_&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:m("ES_COMMON_SEARCH"),disabled:!!Object.keys(S.errors).length||(()=>{var e;let t=!0;return Object.keys(y).forEach(e=>{!["locality","city"].includes(e)&&y[e]&&(t=!1)}),null==u||!u.find(e=>"locality"===e.name)||null!=y&&null!==(e=y.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!c&&l.createElement("div",null,b()))))),("mobile"===a||_)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},b(_)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(S.errors).length,label:m("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},T=e=>{let{tableConfig:o,filterComponent:a,...r}=e;const{data:d,useNewInboxAPI:u}=r,{t:s}=i.useTranslation(),[c,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[m,p]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r.EmptyResultInboxComp)}),[f,E]=n.useState(!1),g=l.useMemo(()=>r.isSearch?o.searchColumns(r):o.inboxColumns(r)||[],[]);let S;return r.isLoading?S=l.createElement(t.Loader,null):f?S=null:!d||0===(null==d?void 0:d.length)||u&&null!=d&&d[0].dataEmpty?S=m&&l.createElement(m,{data:d})||(0===(null==d?void 0:d.length)||u&&null!=d&&d[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},s("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&&(S=l.createElement(h,{t:s,data:d,columns:g,getCellProps:e=>({style:{minWidth:e.column.Header===s("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(c,{defaultSearchParams:r.defaultSearchParams,onFilterChange:r.onFilterChange,searchParams:r.searchParams,type:"desktop",useNewInboxAPI:u,statusMap:u?null==d?void 0:d[0].statusMap:null,moduleCode:r.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(C,{defaultSearchParams:r.defaultSearchParams,onSearch:e=>{r.onSearch(e),E(!1)},type:"desktop",searchFields:r.searchFields,isInboxPage:!(null!=r&&r.isSearch),searchParams:r.searchParams,clearSearch:()=>E(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=r&&r.isSearch?"":"24px",flex:1}},S)))},N=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")}]})))))},I=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),[D,b]=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 T=()=>{_(!1),h(""),b(f)};if(c)return l.createElement(t.Loader,null);let I;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(I=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:u,linkPrefix:E||"/digit-ui/employee/sv/"})):I=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)}})),I,y&&l.createElement(t.PopUp,null,"FILTER"===S&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{a(e),_(!1)},Close:T,type:"mobile",searchParams:m})),"SORT"===S&&l.createElement("div",{className:"popup-module"},l.createElement(N,{type:"mobile",sortParams:f,onClose:T,onSort:d})),"SEARCH"===S&&l.createElement("div",{className:"popup-module"},l.createElement(C,{type:"mobile",onClose:T,onSearch:r,isFstpOperator:s,searchParams:m,searchFields:p}))))},O=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))}))))},w=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(O,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(I,{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}))))},x=e=>{var o,a,r,d,u;let{useNewInboxAPI:s,parentRoute:c,moduleCode:v="SV",initialStates:m={},filterComponent:p,isInbox:f,rawWfHandler:E,rawSearchHandler:g,combineResponse:S,wfConfig:h,searchConfig:y,middlewaresWf:_,middlewareSearch:D,EmptyResultInboxComp:b}=e;const A=Digit.ULBService.getCurrentTenantId(),{t:C}=i.useTranslation(),[N,I]=n.useState(()=>f?{}:{enabled:!1}),[O,x]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("SVInboxTableConfig")}),[L,R]=n.useState(m.pageOffset||0),[P,M]=n.useState(m.pageSize||10),[B,k]=n.useState(m.sortParams||[{id:"createdTime",desc:!0}]),[F,V]=n.useState(m.searchParams||{});let U=window.Digit.Utils.browser.isMobile(),H=U?{limit:100,offset:0,sortBy:null==B||null===(o=B[0])||void 0===o?void 0:o.id,sortOrder:null!=B&&null!==(a=B[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:P,offset:L,sortBy:null==B||null===(r=B[0])||void 0===r?void 0:r.id,sortOrder:null!=B&&null!==(d=B[0])&&void 0!==d&&d.desc?"DESC":"ASC"};const{isLoading:W,data:j,searchFields:z,...K}=s?Digit.Hooks.useNewInboxGeneral({tenantId:A,ModuleCode:v,filters:{...F,...H,sortParams:B}}):Digit.Hooks.useInboxGeneral({tenantId:A,businessService:v,isInbox:f,filters:{...F,...H,sortParams:B},rawWfHandler:E,rawSearchHandler:g,combineResponse:S,wfConfig:h,searchConfig:{...N,...y},middlewaresWf:_,middlewareSearch:D});n.useEffect(()=>{R(0)},[F]);const G=e=>{let t=e.delete,n={...F,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,V({...n}),I({enabled:!0})},$=n.useCallback(e=>{0!==e.length&&k(e)},[]);var Y;if(null!==(null==K||null===(u=K.data)||void 0===u?void 0:u.length))return U?l.createElement(w,{data:j,isLoading:W,isSearch:!f,searchFields:z,onFilterChange:G,onSearch:G,onSort:$,parentRoute:c,searchParams:F,sortParams:B,linkPrefix:c+"/application-details/",tableConfig:null!=K&&K.tableConfig?null==K?void 0:K.tableConfig:O(C).SV,filterComponent:p,EmptyResultInboxComp:b,useNewInboxAPI:s}):l.createElement("div",null,f&&l.createElement(t.Header,null,C("ES_COMMON_INBOX")),l.createElement(T,{moduleCode:v,data:j,tableConfig:O(C).SV,isLoading:W,defaultSearchParams:m.searchParams,isSearch:!f,onFilterChange:G,searchFields:z,onSearch:G,onSort:$,onNextPage:()=>{R(e=>e+P)},onPrevPage:()=>{R(e=>e-P)},currentPage:Math.floor(L/P),pageSizeLimit:P,disableSort:!1,onPageSizeChange:e=>{M(Number(e.target.value))},parentRoute:c,searchParams:F,sortParams:B,totalRecords:Number(null==j||null===(Y=j[0])||void 0===Y?void 0:Y.totalCount),filterComponent:p,EmptyResultInboxComp:b,useNewInboxAPI:s}))},L=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:D}=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:b}=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=[];b&&b.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 T=[];C&&C.map(e=>{T.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Digit.ULBService.getStateId();const N=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 N(""+(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 N(""+(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 N(""+(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 N(""+(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 N(""+(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:T,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==D||null===(i=D.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")}]})))},R=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[d,u]=n.useState({}),[s,c]=n.useState(null),v={enabled:!!(d&&Object.keys(d).length>0)},{isLoading:m,isSuccess:p,data:{SVDetail:f,count:E}={}}=Digit.Hooks.sv.useSvSearchApplication({tenantId:r,filters:d},v);return l.createElement(l.Fragment,null,l.createElement(L,{t:a,isLoading:m,tenantId:r,setShowToast:c,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={...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)=>({...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?c({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):u(i):c({warning:!0,label:"ERR_SV_FILL_VALID_FIELDS"})},data:p&&!m?f.length>0?f:{display:"ES_COMMON_NO_DATA"}:"",count:E}),s&&l.createElement(t.Toast,{error:s.error,warning:s.warning,label:a(s.label),isDleteBtn:!0,onClose:()=>{c(null)}}))},P=()=>{var e,n,a,r;console.log("coming here");const{path:d,...u}=o.useRouteMatch(),c=(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}}),v=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("SVEmpCreate"),m=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:d+"/apply",component:v}),l.createElement(t.PrivateRoute,{path:d+"/inbox",component:()=>l.createElement(x,{useNewInboxAPI:!0,parentRoute:d,businessService:"sv",filterComponent:"SV_INBOX_FILTER",initialStates:c,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:d+"/application-details/:id",component:()=>l.createElement(m,{parentRoute:d})}),l.createElement(t.PrivateRoute,{path:d+"/applicationsearch/application-details/:id",component:()=>l.createElement(m,{parentRoute:d})}),l.createElement(t.PrivateRoute,{path:d+"/my-applications",component:e=>l.createElement(R,s({},e,{parentRoute:d}))}))))},M=e=>l.createElement("span",{className:"cell-text"},e),B=e=>l.createElement("span",{className:"sla-cell"},e),k=e=>{var n;let{status:o,searchParams:a,onAssignmentChange:r,statusMap:d}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>r({...e,state:o.state},o),checked:null==a?void 0:a.applicationStatus.some(e=>e.uuid===o.uuid),label:`${o.name} (${(null==d||null===(n=d.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-"})`})},F=e=>{var o,a,r,d,u;let{onAssignmentChange:s,searchParams:c,businessServices:v,statusMap:m}=e;const{t:p}=i.useTranslation(),[f,E]=n.useState(!1),{data:g,isLoading:S}=Digit.Hooks.useApplicationStatusGeneral({businessServices:v},{}),{userRoleStates:h}=g||{},y=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_SV_COMMON_STATUS_"+(e.state||"CREATED"));return S?l.createElement(t.Loader,null):null!=h&&h.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},p("ES_INBOX_STATUS")),null==h||null===(o=h.filter(e=>!e.isTerminateState))||void 0===o||null===(a=o.slice(0,4))||void 0===a?void 0:a.map((e,t)=>l.createElement(k,{businessServices:v,key:t,onAssignmentChange:s,status:{name:y(e,p),code:e.applicationStatus,...e},searchParams:c,statusMap:m})),(null==h||null===(r=h.filter(e=>!e.isTerminateState))||void 0===r?void 0:r.slice(4).length)>0?l.createElement(l.Fragment,null,f&&(null==h||null===(d=h.filter(e=>!e.isTerminateState))||void 0===d||null===(u=d.slice(4))||void 0===u?void 0:u.map((e,t)=>l.createElement(k,{businessServices:v,key:e.uuid,onAssignmentChange:s,status:{name:y(e,p),code:e.applicationStatus,...e},searchParams:c,statusMap:m}))),l.createElement("div",{className:"filter-button",onClick:()=>E(!f)}," ",p(f?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function U(e,t){return e(t={exports:{}},t.exports),t.exports}var H=U(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]",D="[object Float32Array]",b="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",T="[object Int32Array]",N="[object Uint8Array]",I="[object Uint16Array]",O="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(R.source),B=RegExp(P.source),k=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,K=RegExp(z.source),G=/^\s+/,$=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,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]",De="(?:"+fe+"|"+Ee+")",be="(?:"+_e+"|"+Ee+")",Ae="(?:"+me+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[Se,he,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",Te="(?:"+["[\\u2700-\\u27bf]",he,ye].join("|")+")"+Ce,Ne="(?:"+[Se+me+"?",me,he,ye,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(me,"g"),we=RegExp(ge+"(?="+ge+")|"+Ne+Ce,"g"),xe=RegExp([_e+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,_e,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,_e+De,"$"].join("|")+")",_e+"?"+De+"+(?:['’](?: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,Te].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Re=/[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[D]=Be[b]=Be[A]=Be[C]=Be[T]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[I]=Be[O]=!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[D]=ke[b]=ke[A]=ke[C]=ke[T]=ke[v]=ke[m]=ke[p]=ke[f]=ke[E]=ke[g]=ke[S]=ke[N]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[O]=!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 V&&V&&V.Object===Object&&V,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,$e=Ge&&He.process,Ye=function(){try{return Ke&&Ke.require&&Ke.require("util").types||$e&&$e.binding&&$e.binding("util")}catch(e){}}(),qe=Ye&&Ye.isArrayBuffer,Ze=Ye&&Ye.isDate,Xe=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.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 Dt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function 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 Tt(e){return e?e.slice(0,zt(e)+1).replace(G,""):e}function Nt(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 Lt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Rt=Dt({"À":"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=Dt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Fe[e]}function Bt(e){return Le.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=we.lastIndex=0;we.test(e);)++t;return t}(e):pt(e)}function jt(e){return Bt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&$.test(e.charAt(t)););return t}var Kt=Dt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var V,$=(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=$.prototype,he=pe.prototype,ye=t["__core-js_shared__"],_e=ve.prototype.toString,De=he.hasOwnProperty,be=0,Ae=(V=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Ce=he.toString,Te=_e.call(pe),Ne=je._,we=fe("^"+_e.call(De).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ge?t.Buffer:void 0,Fe=t.Symbol,He=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,ze=Ft(pe.getPrototypeOf,pe),Ke=pe.create,$e=he.propertyIsEnumerable,Ye=Se.splice,pt=Fe?Fe.isConcatSpreadable:void 0,Dt=Fe?Fe.iterator:void 0,$t=Fe?Fe.toStringTag:void 0,Yt=function(){try{var e=Ji(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,Zt=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=Le?Le.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),Dn=Io(pn),bn=Io(fn),An=Io(En),Cn=Fe?Fe.prototype:void 0,Tn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function In(e){if(Ka(e)&&!Pa(e)&&!(e instanceof Ln)){if(e instanceof xn)return e;if(De.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 Ln(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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&&Ra(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&&!De.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 bo(Ei(e),qn(t,0,e.length))}function Hn(e){return bo(Ei(e))}function Wn(e,t,n){(void 0!==n&&!wa(e[t],n)||void 0===n&&!(t in e))&&$n(e,t,n)}function jn(e,t,n){var l=e[t];De.call(e,t)&&wa(l,n)&&(void 0!==n||t in e)||$n(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 $n(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,l=t.length,i=$(l),o=null==e;++n<l;)i[n]=o?void 0:Er(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Zn(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 L=Pa(e);if(L){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return Ei(e,u)}else{var R=to(e),P=R==s||R==c;if(Fa(e))return si(e,h);if(R==p||R==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,Dr(t),e)}(u,e)):function(e,t){return gi(e,Qi(e),t)}(e,Gn(u,e))}else{if(!ke[R])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 D:case b:case A:case C:case T:case N: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 Tn?pe(Tn.call(e)):{}}}(e,R,h)}}a||(a=new kn);var M=a.get(e);if(M)return M;a.set(e,u),Za(e)?e.forEach(function(l){u.add(Zn(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,i){u.set(i,Zn(l,t,n,i,e,a))});var B=L?void 0:(x?w?Ki:zi:w?Dr:_r)(e);return lt(B||e,function(l,i){B&&(l=e[i=l]),jn(u,i,Zn(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,Nt(n))),l?(o=dt,a=!1):t.length>=200&&(o=Ot,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:U,variable:"",imports:{_:In}},(In.prototype=wn.prototype).constructor=In,(xn.prototype=On(wn.prototype)).constructor=xn,(Ln.prototype=On(wn.prototype)).constructor=Ln,Rn.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return De.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:De.call(t,e)},Rn.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():Ye.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 Rn,map:new(mn||Pn),string:new Rn}},Mn.prototype.delete=function(e){var t=Zi(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Zi(this,e).get(e)},Mn.prototype.has=function(e){return Zi(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Zi(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[No(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]":$t&&$t in pe(e)?function(e){var t=De.call(e,$t),n=e[$t];try{e[$t]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[$t]=n:delete e[$t]),i}(e):function(e){return Ce.call(e)}(e)}function pl(e,t){return e>t}function fl(e,t){return null!=e&&De.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=$(o),d=Infinity,u=[];a--;){var s=e[a];a&&t&&(s=ut(s,Nt(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?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[No(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),D=c?a:to(e),b=h?a:to(t),A=(D=D==o?p:D)==p,C=(b=b==o?p:b)==p,T=D==b;if(T&&Fa(e)){if(!Fa(t))return!1;c=!0,A=!1}if(T&&!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 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=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(Tn)return Tn.call(e)==Tn.call(t)}return!1}(e,t,D,n,l,i,s);if(!(1&n)){var N=A&&De.call(e,"__wrapped__"),I=C&&De.call(t,"__wrapped__");if(N||I){var O=N?e.value():e,w=I?t.value():t;return s||(s=new kn),i(O,w,n,l,s)}}return!!T&&(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:De.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 Dl(e){return!(!za(e)||(t=e,Ae&&Ae in t))&&(Ha(e)?we:ie).test(Io(e));var t}function bl(e){return"function"==typeof e?e:null==e?$r:"object"==typeof e?Pa(e)?Il(e[0],e[1]):Nl(e):nd(e)}function Al(e){if(!co(e))return on(e);var t=[];for(var n in pe(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Tl(e,t){var n=-1,l=Ba(e)?$(e.length):[];return el(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(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(No(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 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=[]:Ya(d)||Ra(d)?(s=r,Ra(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)}},Dr)}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}):[$r];var l=-1;return t=ut(t,Nt(qi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var 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}(Tl(e,function(e,n,i){return{criteria:ut(t,function(t){return t(e)}),index:++l,value:e}}))}function Ll(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 Rl(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,Nt(n)));++o<a;)for(var d=0,u=t[o],s=n?n(u):u;(d=i(r,s,d,l))>-1;)r!==e&&Ye.call(r,d,1),Ye.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)?Ye.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,$r),e+"")}function Fl(e){return Vn(wr(e))}function Vl(e,t){var n=wr(e);return bo(n,qn(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=No(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}:$r,Wl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:$r;function jl(e){return bo(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=$(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 $l(e,t,$r,n)}function $l(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 Yl(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 ql(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(Pa(e))return ut(e,Zl)+"";if(Ja(e))return Nn?Nn.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=Ot,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[No(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 Ln&&(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=$(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:$r}function ai(e,t){return Pa(e)?e:ro(e,t)?[e]:To(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=qt||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=$(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=$(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=$(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?$n(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,qi(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 Di(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 bi(e){return function(t){return ct(Hr(Rr(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(!Ba(t)){var o=qi(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 Ti(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"==$i(a))var r=new xn([],!0)}for(i=r?i:l;++i<l;){var d=$i(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[$i(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 Ni(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=$(g),h=g;h--;)S[h]=arguments[h];if(m)var y=Yi(E),_=Lt(S,y);if(l&&(S=pi(S,l,i,m)),o&&(S=fi(S,o,a,m)),g-=_,m&&g<u){var D=Vt(S,y);return Pi(e,t,Ni,E.placeholder,n,S,D,r,d,u-g)}var b=c?n:this,A=v?b[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(b,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=Zl(n),l=Zl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function wi(e){return ji(function(t){return t=ut(t,Nt(qi())),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?" ":Zl(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 Li(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=$(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 Ri(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=$(o),r=o,d=Yi(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,Ni,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?Ni.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=$(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])&&!De.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 Ya(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(!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,Dr,eo)}var Gi=Sn?function(e){return Sn.get(e)}:Jr;function $i(e){for(var t=e.name+"",n=hn[t],l=De.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 Yi(e){return(De.call(In,"placeholder")?In:e).placeholder}function qi(){var e=In.iteratee||Yr;return e=e===Yr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Zi(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 Dl(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=pe(e),at(en(e),function(t){return $e.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=No(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)||Ra(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:On(ze(e))}function io(e){return Pa(e)||Ra(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)&&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))||W.test(e)||!H.test(e)||null!=t&&e in pe(t)}function uo(e){var t=$i(e),n=In[t];if("function"!=typeof n||!(t in Ln.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 Dn:return"[object Promise]";case bn: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=$(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=$(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=Do(Hl),ho=Xt||function(e,t){return je.setTimeout(e,t)},yo=Do(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(Y,"{\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(q);return t?t[1].split(Z):[]}(l),n)))}function Do(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 bo(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,To=(Ao=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,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 No(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 Ln)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=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),qi(n,2)):[]}),Lo=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 Ro(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,qi(t,3),i)}function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ir(n),i=n<0?an(l+i,0):rn(i,l-1)),Et(e,qi(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,qi(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?Rl(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=Yn(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),qi(t,2))}),$o=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 Yo(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 qo(e,t){if(!e||!e.length)return[];var n=Yo(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var Zo=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),qi(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(Yo),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,qo(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 Yn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Ln&&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){De.call(e,n)?++e[n]:$n(e,n,1)}),aa=Ci(Ro),ra=Ci(Po);function da(e,t){return(Pa(e)?lt:el)(e,qi(t,3))}function ua(e,t){return(Pa(e)?it:tl)(e,qi(t,3))}var sa=Si(function(e,t,n){De.call(e,n)?e[n].push(t):$n(e,n,[t])}),ca=kl(function(e,t,n){var l=-1,i="function"==typeof t,o=Ba(e)?$(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){$n(e,n,t)});function ma(e,t){return(Pa(e)?ut:Tl)(e,qi(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=Zt||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,Yi(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,Yi(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 Da=kl(function(e,t){return Jn(e,1,t)}),ba=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 Ta=ri(function(e,t){var n=(t=1==t.length&&Pa(t[0])?ut(t[0],Nt(qi())):ut(ol(t,1),Nt(qi()))).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)})}),Na=kl(function(e,t){return Fi(e,32,void 0,t,Vt(t,Yi(Na)))}),Ia=kl(function(e,t){return Fi(e,64,void 0,t,Vt(t,Yi(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=Ri(pl),La=Ri(function(e,t){return e>=t}),Ra=hl(function(){return arguments}())?hl:function(e){return Ka(e)&&De.call(e,"callee")&&!$e.call(e,"callee")},Pa=$.isArray,Ma=qe?Nt(qe):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=Ze?Nt(Ze):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&&!Ya(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?Nt(Xe):function(e){return Ka(e)&&to(e)==v};function $a(e){return"number"==typeof e||Ka(e)&&ml(e)==m}function Ya(e){if(!Ka(e)||ml(e)!=p)return!1;var t=ze(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_e.call(n)==Te}var qa=Je?Nt(Je):function(e){return Ka(e)&&ml(e)==f},Za=Qe?Nt(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?Nt(et):function(e){return Ka(e)&&ja(e.length)&&!!Be[ml(e)]},er=Ri(Cl),tr=Ri(function(e,t){return e<=t});function nr(e){if(!e)return[];if(Ba(e))return Xa(e)?jt(e):Ei(e);if(Dt&&e[Dt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Dt]());var t=to(e);return(t==v?kt: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?qn(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=Tt(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,Dr(e))}function dr(e){return null==e?"":Zl(e)}var ur=hi(function(e,t){if(co(t)||Ba(t))gi(t,_r(t),e);else for(var n in t)De.call(t,n)&&jn(e,n,t[n])}),sr=hi(function(e,t){gi(t,Dr(t),e)}),cr=hi(function(e,t,n,l){gi(t,Dr(t),e,l)}),vr=hi(function(e,t,n,l){gi(t,_r(t),e,l)}),mr=ji(Yn),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=Dr(o),r=-1,d=a.length;++r<d;){var u=a[r],s=e[u];(void 0===s||wa(s,he[u])&&!De.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($r)),hr=Ii(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]},qi),yr=kl(Sl);function _r(e){return Ba(e)?Fn(e):Al(e)}function Dr(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&&De.call(e,l))&&n.push(l);return n}(e)}var br=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=Zn(n,7,Hi));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Tr=ji(function(e,t){return null==e?{}:function(e,t){return Ll(e,t,function(t,n){return gr(e,n)})}(e,t)});function Nr(e,t){if(null==e)return{};var n=ut(Ki(e),function(e){return[e]});return t=qi(t),Ll(e,n,function(e,n){return t(e,n[0])})}var Ir=ki(_r),Or=ki(Dr);function wr(e){return null==e?[]:It(e,_r(e))}var xr=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?Lr(t):t)});function Lr(e){return Ur(dr(e).toLowerCase())}function Rr(e){return(e=dr(e))&&e.replace(re,Rt).replace(Oe,"")}var Pr=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Mr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Br=Di("toLowerCase"),kr=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fr=bi(function(e,t,n){return e+(n?" ":"")+Ur(t)}),Vr=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ur=Di("toUpperCase");function Hr(e,t,n){return e=dr(e),void 0===(t=n?void 0:t)?function(e){return Re.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=No(t),$n(e,t,ha(e[t],e))}),e});function zr(e){return function(){return e}}var Kr=Ti(),Gr=Ti(!0);function $r(e){return e}function Yr(e){return bl("function"==typeof e?e:Zn(e,1))}var qr=kl(function(e,t){return function(n){return Sl(n,e,t)}}),Zr=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=wi(ut),ed=wi(ot),td=wi(mt);function nd(e){return ro(e)?_t(No(e)):function(e){return function(t){return cl(t,e)}}(e)}var ld=Li(),id=Li(!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=$(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=$(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=qi();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)}}(Zn(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=Da,In.delay=ba,In.difference=wo,In.differenceBy=xo,In.differenceWith=Lo,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,qi(t,3),!0,!0):[]},In.dropWhile=function(e,t){return e&&e.length?ei(e,qi(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,qi(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,Dr(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=Yr,In.keyBy=va,In.keys=_r,In.keysIn=Dr,In.map=ma,In.mapKeys=function(e,t){var n={};return t=qi(t,3),dl(e,function(e,l,i){$n(n,t(e,l,i),e)}),n},In.mapValues=function(e,t){var n={};return t=qi(t,3),dl(e,function(e,l,i){$n(n,l,t(e,l,i))}),n},In.matches=function(e){return Nl(Zn(e,1))},In.matchesProperty=function(e,t){return Il(e,Zn(t,1))},In.memoize=Aa,In.merge=br,In.mergeWith=Ar,In.method=qr,In.methodOf=Zr,In.mixin=Xr,In.negate=Ca,In.nthArg=function(e){return e=ir(e),kl(function(t){return wl(t,e)})},In.omit=Cr,In.omitBy=function(e,t){return Nr(e,Ca(qi(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=Ta,In.overEvery=ed,In.overSome=td,In.partial=Na,In.partialRight=Ia,In.partition=pa,In.pick=Tr,In.pickBy=Nr,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?Rl(e,t,qi(n,2)):e},In.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(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(qi(t,3)))},In.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=qi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},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?Yl(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?Yl(e,qi(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&&!qa(t))&&!(t=Zl(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,qi(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?ei(e,qi(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,No):Ja(e)?[e]:Ei(To(dr(e)))},In.toPlainObject=rr,In.transform=function(e,t,n){var l=Pa(e),i=l||Fa(e)||Qa(e);if(t=qi(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=$o,In.uniq=function(e){return e&&e.length?Xl(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xl(e,qi(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=Yo,In.unzipWith=qo,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,Dr(e))},In.without=Zo,In.words=Hr,In.wrap=function(e,t){return Na(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=Lr,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),qn(ar(e),t,n)},In.clone=function(e){return Zn(e,4)},In.cloneDeep=function(e){return Zn(e,5)},In.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,_r(t))},In.deburr=Rr,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=Zl(t);var l=e.length,i=n=void 0===n?l:qn(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))&&B.test(e)?e.replace(P,Pt):e},In.escapeRegExp=function(e){return(e=dr(e))&&K.test(e)?e.replace(z,"\\$&"):e},In.every=function(e,t,n){var l=Pa(e)?ot:nl;return n&&ao(e,t,n)&&(t=void 0),l(e,qi(t,3))},In.find=aa,In.findIndex=Ro,In.findKey=function(e,t){return ft(e,qi(t,3),dl)},In.findLast=ra,In.findLastIndex=Po,In.findLastKey=function(e,t){return ft(e,qi(t,3),ul)},In.floor=cd,In.forEach=da,In.forEachRight=ua,In.forIn=function(e,t){return null==e?e:al(e,qi(t,3),Dr)},In.forInRight=function(e,t){return null==e?e:rl(e,qi(t,3),Dr)},In.forOwn=function(e,t){return e&&dl(e,qi(t,3))},In.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},In.get=Er,In.gt=xa,In.gte=La,In.has=function(e,t){return null!=e&&no(e,t,fl)},In.hasIn=gr,In.head=Bo,In.identity=$r,In.includes=function(e,t,n,l){e=Ba(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=Ra,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&&!Ya(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)||Ra(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(De.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 $a(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 Dl(e)},In.isNil=function(e){return null==e},In.isNull=function(e){return null===e},In.isNumber=$a,In.isObject=za,In.isObjectLike=Ka,In.isPlainObject=Ya,In.isRegExp=qa,In.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},In.isSet=Za,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,$r,pl):void 0},In.maxBy=function(e,t){return e&&e.length?ll(e,qi(t,2),pl):void 0},In.mean=function(e){return yt(e,$r)},In.meanBy=function(e,t){return yt(e,qi(t,2))},In.min=function(e){return e&&e.length?ll(e,$r,Cl):void 0},In.minBy=function(e,t){return e&&e.length?ll(e,qi(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._=Ne),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:bt,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},In.reduceRight=function(e,t,n){var l=Pa(e)?vt:bt,i=arguments.length<3;return l(e,qi(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[No(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,qi(t,3))},In.sortedIndex=function(e,t){return Gl(e,t)},In.sortedIndexBy=function(e,t,n){return $l(e,t,qi(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 $l(e,t,qi(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:qn(ir(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},In.subtract=pd,In.sum=function(e){return e&&e.length?At(e,$r):0},In.sumBy=function(e,t){return e&&e.length?At(e,qi(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===U?ee:de).source+"|"+(t.evaluate||de).source+"|$","g"),m="//# sourceURL="+(De.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=De.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(L,"$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=qi(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?qn(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 Tt(e);if(!e||!(t=Zl(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=Zl(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=Zl(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?Zl(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),qa(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(Zl(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(R,Kt):e},In.uniqueId=function(e){var t=++be;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){De.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){Ln.prototype[e]=function(n){n=void 0===n?1:an(ir(n),0);var l=this.__filtered__&&!t?new Ln(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},Ln.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;Ln.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Ln.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Ln.prototype[e]=function(){return this.__filtered__?new Ln(this):this[n](1)}}),Ln.prototype.compact=function(){return this.filter($r)},Ln.prototype.find=function(e){return this.filter(e).head()},Ln.prototype.findLast=function(e){return this.reverse().find(e)},Ln.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new Ln(this):this.map(function(n){return Sl(n,e,t)})}),Ln.prototype.reject=function(e){return this.filter(Ca(qi(e)))},Ln.prototype.slice=function(e,t){e=ir(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ln(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)},Ln.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295)},dl(Ln.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 Ln,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 Ln(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(Ln.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";De.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],Ln.prototype.clone=function(){var e=new Ln(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},Ln.prototype.reverse=function(){if(this.__filtered__){var e=new Ln(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ln.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 Ln){var t=e;return this.__actions__.length&&(t=new Ln(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,Dt&&(In.prototype[Dt]=function(){return this}),In}();Ke?((Ke.exports=Gt)._=Gt,ze._=Gt):je._=Gt}).call(V)});const W=e=>{let{searchParams:o,onFilterChange:r,defaultSearchParams:d,statusMap:u,moduleCode:s,...c}=e;const{t:v}=i.useTranslation(),m=a.useQueryClient(),[p,f]=n.useState(()=>({...o,services:[]})),[E,g]=n.useState(),[S,h]=n.useState(),[y,_]=n.useState(),D=[{label:"SV_NEW_REGISTRATION",value:"street-vending"}],{data:b}=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=[];b&&b.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 T=[];C&&C.map(e=>{T.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const N=e=>{let t=e.delete,n={...p,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,f({...n})},I=()=>{f({...d,services:[]}),r({...d}),g(null),h(null),_(null)};return n.useEffect(()=>{S&&N({vendingZone:(null==S?void 0:S.code)||""}),E&&N({vendingType:(null==E?void 0:E.code)||""}),y&&N({status:(null==y?void 0:y.i18nKey)||""})},[S,E,y]),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"}},v("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:I},v("ES_COMMON_CLEAR_ALL")),"desktop"===c.type&&l.createElement("span",{className:"clear-search",onClick:I,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"===c.type&&l.createElement("span",{onClick:c.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("SV_VENDING_ZONES"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:S,select:h,option:T,optionKey:"i18nKey",t:v,placeholder:"Select"})),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("SV_VENDING_TYPE"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:E,select:g,option:A,optionKey:"i18nKey",t:v,placeholder:"Select"})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("SV_APPLICATION_STATUS"),":"),l.createElement("div",null,l.createElement(t.Dropdown,{selected:y,select:_,option:[{i18nKey:"APPLIED"},{i18nKey:"APPROVED"},{i18nKey:"REGISTRATIONCOMPLETED"},{i18nKey:"INSPECTIONPENDING"},{i18nKey:"REJECTED"}],optionKey:"i18nKey",t:v,placeholder:"Select"}))),l.createElement("div",null,l.createElement(F,{searchParams:p,businessServices:p.services,statusMap:u||m.getQueryData("INBOX_STATUS_MAP_"+s),moduleCode:s,onAssignmentChange:(e,t)=>{if(e.target.checked)N({applicationStatus:[...null==p?void 0:p.applicationStatus,t]});else{let e=null==p?void 0:p.applicationStatus.filter(e=>e.state!==t.state);N({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{r(0===p.services.length?{...p,services:D.map(e=>e.value)}:p)},label:v("ES_COMMON_APPLY")}))))))},j=e=>e.substr(0,1).toUpperCase()+e.substr(1),z=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,_,D,b,A,C,T,N;const I=e=>e.filter(e=>e.value);let O,w;var x,L,R;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===(L=e.vendorDetail[0])||void 0===L?void 0:L.dependentGender)?"Male":"Female"),{t:n,tenantId:null==t?void 0:t.code,name:`${n(null==t?void 0:t.i18nKey)} ${R=n("ULBGRADE_"+(null==t||null===(a=t.city)||void 0===a?void 0:a.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),R.toLowerCase().split(" ").map(j).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===(D=e.addressDetails[0])||void 0===D?void 0:D.addressLine1},{title:n("SV_ADDRESS_LINE2"),value:null==e||null===(b=e.addressDetails[0])||void 0===b?void 0:b.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===(T=e.addressDetails[0])||void 0===T?void 0:T.pincode},{title:n("SV_LANDMARK"),value:null==e||null===(N=e.addressDetails[0])||void 0===N?void 0:N.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)}},K=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")},G={padding:"4px 0px",justifyContent:"space-between"},$=e=>{var n,i;return l.createElement(t.Banner,{message:K(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%"}})},Y=e=>l.createElement("h1",{className:"heading-m"},e.label),q=()=>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"})),Z=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(q,null)),X=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(d,{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:E,data:g}=Digit.Hooks.pt.useMDMS(d,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[S,h]=n.useState({}),[_,D]=n.useState({}),[b,A]=n.useState([]),[C,T]=n.useState(null),[N,I]=n.useState(null),[O,w]=n.useState(null),[x,L]=n.useState(null),[R,P]=n.useState([]),[M,B]=n.useState(null),[k,F]=n.useState(!1);function V(e){I(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&P(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;A(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(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):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)}}()},[N]),n.useEffect(()=>{r&&h(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:R,selectedFinancialYear:M,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:b,selectedApprover:C,setSelectedApprover:T,selectFile:V,uploadedFile:O,setUploadedFile:w,businessService:v}))},[r,b,R,M,O]),r&&S.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Y,{label:a(S.label.heading)}),headerBarEnd:l.createElement(Z,{onClick:u}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!M:f||(null==r?void 0:r.docUploadRequired)&&!O,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:S.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"};c.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==c?void 0:c.propertyId,tenantId:d,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!C?[]:[C],O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:O}]),s({Property:{...c,workflow:t}})}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},J=e=>l.createElement("h1",{className:"heading-m"},e.label),Q=()=>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"})),ee=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Q,null)),te=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(d,{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:p,data:f}=Digit.Hooks.pt.useMDMS(d,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,g]=n.useState({}),[S,h]=n.useState({}),[_,D]=n.useState([]),[b,A]=n.useState({}),[C,T]=n.useState(null),[N,I]=n.useState(null),[O,w]=n.useState(null),[x,L]=n.useState([]),[R,P]=n.useState(null);n.useEffect(()=>{var e;f&&f["egf-master"]&&L(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:M}=Digit.Hooks.useCustomMDMS(d,"common-masters",[{name:"Department"}]);function B(e){T(e.target.files[0])}return n.useEffect(()=>{if(m&&M){var e;const t=M["common-masters"].Department;D(null==m||null===(e=m.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}`}}))}},[m]),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=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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,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:b,setSelectedApprover:A,selectFile:B,uploadedFile:N,setUploadedFile:I,businessService:v}))},[r,_,x,R,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(J,{label:a(E.label.heading)}),headerBarEnd:l.createElement(ee,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},p?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,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:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null},s({Licenses:[c]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},ne=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),le=()=>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"})),ie=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(le,null)),oe=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v}=e;const{data:m,isLoading:p}=Digit.Hooks.useEmployeeSearch(d,{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)}),[f,E]=n.useState({}),[g,S]=n.useState({}),[h,_]=n.useState([]),[D,b]=n.useState({}),[A,C]=n.useState(null),[T,N]=n.useState(null),[I,O]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function x(e){C(e.target.files[0])}return n.useEffect(()=>{var e;_(null==m||null===(e=m.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}}))},[m]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",A,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(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)}}()},[A]),n.useEffect(()=>{r&&E((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:h,selectedApprover:D,setSelectedApprover:b,selectFile:x,uploadedFile:T,setUploadedFile:N,businessService:v,error:I}))},[r,h,T,I]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ne,{label:a(f.label.heading)}),headerBarEnd:l.createElement(ie,{onClick:u}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},p?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},ae=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),re=()=>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"})),de=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(re,null)),ue=e=>{var i,o,r,d,u,s,c,v,m,p,f,E;let{t:g,action:S,tenantId:h,closeModal:_,submitAction:D,applicationDetails:b,applicationData:A,businessService:C,workflowDetails:T,blockReason:N}=e;console.log("applicationData",A),console.log("workflowDetails",T),Digit.Hooks.obps.useObpsAPI(null!==(i=A)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(d=A)||void 0===d||null===(u=d.landInfo)||void 0===u||null===(s=u.address)||void 0===s?void 0:s.city:h,!1);const{data:I,isLoading:O}=Digit.Hooks.useEmployeeSearch(h,{roles:null==T||null===(c=T.data)||void 0===c||null===(v=c.initialActionState)||void 0===v||null===(m=v.nextActions)||void 0===m||null===(p=m.filter(e=>(null==e?void 0:e.action)==(null==S?void 0:S.action)))||void 0===p||null===(f=p[0])||void 0===f||null===(E=f.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=S&&S.isTerminateState)}),[w,x]=(a.useQueryClient(),n.useState({})),[L,R]=n.useState({}),[P,M]=n.useState([]),[B,k]=n.useState([]),[F,V]=n.useState({}),[U,H]=n.useState({}),[W,j]=n.useState(null),[z,K]=n.useState(null),[G,$]=n.useState(null),[Y,q]=n.useState(null),Z=!!Digit.Utils.browser.isMobile();function X(e){j(e.target.files[0])}n.useEffect(()=>{var e;M(null==I||null===(e=I.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}}))},[I]),n.useEffect(()=>{!function(){try{$(null);const e=function(){if(W){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(W.size>=5242880)$(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=W&&W.type&&!e.test(null==W?void 0:W.type))$(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",W,Digit.ULBService.getStateId()||(null==h?void 0:h.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?K(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):$(g("CS_FILE_UPLOAD_ERROR"))})},function(){$(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[W]);const J=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},Q=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],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:J(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},ne=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{k(null==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),S&&x((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:D,blockReasonFiltered:b}=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:b,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{h(null)},message:S?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:D})}]}]}})({t:g,action:S,approvers:P,selectedApprover:F,setSelectedApprover:V,selectedBlockReason:U,setBlockReason:H,selectFile:X,uploadedFile:z,setUploadedFile:K,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:B}))},[S,P,Y,z,G]),S&&w.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ae,{label:g(w.label.heading)}),headerBarEnd:l.createElement(de,{onClick:_}),actionCancelLabel:g(w.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:g(w.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Z?{width:"720px"}:{},style:Z?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Z?{paddingLeft:"5px"}:{}},O?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:w.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,d,u,s,c,v,m,p,f,E,y,C,N,I,O,w,x,L,R,P,M;A={...A,documents:te(),additionalDetails:{...null===(t=A)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(A),pendingapproval:ne(),blockingReason:null==U?void 0:U.name},workflow:{action:null==S?void 0:S.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(i=T.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==T||null===(d=T.data)||void 0===d||null===(u=d.processInstances)||void 0===u||null===(s=u[0])||void 0===s||null===(c=s.assigner)||void 0===c?void 0:c.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(v=T.data)||void 0===v||null===(m=v.processInstances)||void 0===m||null===(p=m[0])||void 0===p||null===(f=p.state)||void 0===f?void 0:f.applicationStatus)?[null==T||null===(E=T.data)||void 0===E||null===(y=E.processInstances)||void 0===y||null===(C=y[0])||void 0===C||null===(N=C.assigner)||void 0===N?void 0:N.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,varificationDocuments:z?[{documentType:(null==S?void 0:S.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:z}]:null},action:null==S?void 0:S.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(I=T.data)||void 0===I||null===(O=I.processInstances)||void 0===O||null===(w=O[0])||void 0===w||null===(x=w.state)||void 0===x?void 0:x.applicationStatus)?[null==T||null===(L=T.data)||void 0===L||null===(R=L.processInstances)||void 0===R||null===(P=R[0])||void 0===P||null===(M=P.assigner)||void 0===M?void 0:M.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,wfDocuments:z?[{documentType:(null==S?void 0:S.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:z}]:null};const B=function(e,t,n,l,i,o,a,r,d,u,s,c){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=A)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=A)||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===(a=A)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null===(u=A)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(c=s.selfCertificationCharges)||void 0===c?void 0:c.BPA_GAUSHALA_CHARGES_CESS))){var v,m,p;A.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",A.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",A.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",A.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),A.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==b||null===(v=b.nocData)||void 0===v?void 0:v.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(m=e[0])||void 0===m||null===(p=m.Noc)||void 0===p?void 0:p.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(h,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(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!=l&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,n,a,r,d,u,s,c,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(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)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==A.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?D({BPA:A},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(_(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else D({BPA:A},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}_(),alert(g("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},se=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ce=()=>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"})),ve=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ce,null)),me=e=>{var i,r;let{t:d,action:u,tenantId:s,closeModal:c,submitAction:v,applicationData:m,businessService:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==u||null===(i=u.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=u&&u.isTerminateState)}),[g,S]=(a.useQueryClient(),n.useState({})),[h,_]=n.useState({}),[D,b]=n.useState([]),[A,C]=n.useState({}),[T,N]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function R(e){N(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)x(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))x(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(d("CS_FILE_UPLOAD_ERROR"))})},function(){x(d("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{u&&S((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:d,action:u,approvers:D,selectedApprover:A,setSelectedApprover:C,selectFile:R,uploadedFile:I,setUploadedFile:O,businessService:p,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[u,D,I,w]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(se,{label:d(g.label.heading)}),headerBarEnd:l.createElement(ve,{onClick:c}),actionCancelLabel:d(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:d(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==u?void 0:u.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,documents:I?[{documentType:(null==u?void 0:u.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:I}]:null},documents:o},v({Noc:m},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)};var pe=function(e,t){return e===t||e!=e&&t!=t},fe=function(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1},Ee=Array.prototype.splice;function ge(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])}}ge.prototype.clear=function(){this.__data__=[],this.size=0},ge.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0||(n==t.length-1?t.pop():Ee.call(t,n,1),--this.size,0))},ge.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},ge.prototype.has=function(e){return fe(this.__data__,e)>-1},ge.prototype.set=function(e,t){var n=this.__data__,l=fe(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Se,he=ge,ye="object"==typeof V&&V&&V.Object===Object&&V,_e="object"==typeof self&&self&&self.Object===Object&&self,De=ye||_e||Function("return this")(),be=De.Symbol,Ae=Object.prototype,Ce=Ae.hasOwnProperty,Te=Ae.toString,Ne=be?be.toStringTag:void 0,Ie=Object.prototype.toString,Oe=be?be.toStringTag:void 0,we=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Oe&&Oe in Object(e)?function(e){var t=Ce.call(e,Ne),n=e[Ne];try{e[Ne]=void 0;var l=!0}catch(e){}var i=Te.call(e);return l&&(t?e[Ne]=n:delete e[Ne]),i}(e):function(e){return Ie.call(e)}(e)},xe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Le=function(e){if(!xe(e))return!1;var t=we(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Re=De["__core-js_shared__"],Pe=(Se=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+Se:"",Me=Function.prototype.toString,Be=function(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ke=/^\[object .+?Constructor\]$/,Fe=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!xe(e)||(t=e,Pe&&Pe in t))&&(Le(e)?Fe:ke).test(Be(e));var t}(n)?n:void 0},Ue=Ve(De,"Map"),He=Ve(Object,"create"),We=Object.prototype.hasOwnProperty,je=Object.prototype.hasOwnProperty;function ze(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])}}ze.prototype.clear=function(){this.__data__=He?He(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(He){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return We.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return He?void 0!==t[e]:je.call(t,e)},ze.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=He&&void 0===t?"__lodash_hash_undefined__":t,this};var Ke=ze,Ge=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 $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.size=0,this.__data__={hash:new Ke,map:new(Ue||he),string:new Ke}},$e.prototype.delete=function(e){var t=Ge(this,e).delete(e);return this.size-=t?1:0,t},$e.prototype.get=function(e){return Ge(this,e).get(e)},$e.prototype.has=function(e){return Ge(this,e).has(e)},$e.prototype.set=function(e,t){var n=Ge(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Ye=$e;function qe(e){var t=this.__data__=new he(e);this.size=t.size}qe.prototype.clear=function(){this.__data__=new he,this.size=0},qe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},qe.prototype.get=function(e){return this.__data__.get(e)},qe.prototype.has=function(e){return this.__data__.has(e)},qe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof he){var l=n.__data__;if(!Ue||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ye(l)}return n.set(e,t),this.size=n.size,this};var Ze=qe,Xe=function(){try{var e=Ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Je=function(e,t,n){"__proto__"==t&&Xe?Xe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Qe=Object.prototype.hasOwnProperty,et=function(e,t,n){var l=e[t];Qe.call(e,t)&&pe(l,n)&&(void 0!==n||t in e)||Je(e,t,n)},tt=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?Je(n,r,d):et(n,r,d)}return n},nt=function(e){return null!=e&&"object"==typeof e},lt=function(e){return nt(e)&&"[object Arguments]"==we(e)},it=Object.prototype,ot=it.hasOwnProperty,at=it.propertyIsEnumerable,rt=lt(function(){return arguments}())?lt:function(e){return nt(e)&&ot.call(e,"callee")&&!at.call(e,"callee")},dt=Array.isArray,ut=function(){return!1},st=U(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?De.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ut}),ct=/^(?:0|[1-9]\d*)$/,vt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ct.test(e))&&e>-1&&e%1==0&&e<t},mt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},pt={};pt["[object Float32Array]"]=pt["[object Float64Array]"]=pt["[object Int8Array]"]=pt["[object Int16Array]"]=pt["[object Int32Array]"]=pt["[object Uint8Array]"]=pt["[object Uint8ClampedArray]"]=pt["[object Uint16Array]"]=pt["[object Uint32Array]"]=!0,pt["[object Arguments]"]=pt["[object Array]"]=pt["[object ArrayBuffer]"]=pt["[object Boolean]"]=pt["[object DataView]"]=pt["[object Date]"]=pt["[object Error]"]=pt["[object Function]"]=pt["[object Map]"]=pt["[object Number]"]=pt["[object Object]"]=pt["[object RegExp]"]=pt["[object Set]"]=pt["[object String]"]=pt["[object WeakMap]"]=!1;var ft=function(e){return function(t){return e(t)}},Et=U(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&ye.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),gt=Et&&Et.isTypedArray,St=gt?ft(gt):function(e){return nt(e)&&mt(e.length)&&!!pt[we(e)]},ht=Object.prototype.hasOwnProperty,yt=function(e,t){var n=dt(e),l=!n&&rt(e),i=!n&&!l&&st(e),o=!n&&!l&&!i&&St(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&&!ht.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||vt(u,d))||r.push(u);return r},_t=Object.prototype,Dt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_t)},bt=function(e,t){return function(n){return e(t(n))}},At=bt(Object.keys,Object),Ct=Object.prototype.hasOwnProperty,Tt=function(e){return null!=e&&mt(e.length)&&!Le(e)},Nt=function(e){return Tt(e)?yt(e):function(e){if(!Dt(e))return At(e);var t=[];for(var n in Object(e))Ct.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},It=Object.prototype.hasOwnProperty,Ot=function(e){return Tt(e)?yt(e,!0):function(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Dt(e),n=[];for(var l in e)("constructor"!=l||!t&&It.call(e,l))&&n.push(l);return n}(e)},wt=U(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?De.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}}),xt=function(){return[]},Lt=Object.prototype.propertyIsEnumerable,Rt=Object.getOwnPropertySymbols,Pt=Rt?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];Lt.call(e,r)&&(a[o++]=r)}return a}(Rt(e)))}:xt,Mt=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Bt=bt(Object.getPrototypeOf,Object),kt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Mt(t,Pt(e)),e=Bt(e);return t}:xt,Ft=function(e,t,n){var l=t(e);return dt(e)?l:Mt(l,n(e))},Vt=function(e){return Ft(e,Nt,Pt)},Ut=function(e){return Ft(e,Ot,kt)},Ht=Ve(De,"DataView"),Wt=Ve(De,"Promise"),jt=Ve(De,"Set"),zt=Ve(De,"WeakMap"),Kt=Be(Ht),Gt=Be(Ue),$t=Be(Wt),Yt=Be(jt),qt=Be(zt),Zt=we;(Ht&&"[object DataView]"!=Zt(new Ht(new ArrayBuffer(1)))||Ue&&"[object Map]"!=Zt(new Ue)||Wt&&"[object Promise]"!=Zt(Wt.resolve())||jt&&"[object Set]"!=Zt(new jt)||zt&&"[object WeakMap]"!=Zt(new zt))&&(Zt=function(e){var t=we(e),n="[object Object]"==t?e.constructor:void 0,l=n?Be(n):"";if(l)switch(l){case Kt:return"[object DataView]";case Gt:return"[object Map]";case $t:return"[object Promise]";case Yt:return"[object Set]";case qt:return"[object WeakMap]"}return t});var Xt=Zt,Jt=Object.prototype.hasOwnProperty,Qt=De.Uint8Array,en=function(e){var t=new e.constructor(e.byteLength);return new Qt(t).set(new Qt(e)),t},tn=/\w*$/,nn=be?be.prototype:void 0,ln=nn?nn.valueOf:void 0,on=Object.create,an=function(){function e(){}return function(t){if(!xe(t))return{};if(on)return on(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),rn=Et&&Et.isMap,dn=rn?ft(rn):function(e){return nt(e)&&"[object Map]"==Xt(e)},un=Et&&Et.isSet,sn=un?ft(un):function(e){return nt(e)&&"[object Set]"==Xt(e)},cn={};cn["[object Arguments]"]=cn["[object Array]"]=cn["[object ArrayBuffer]"]=cn["[object DataView]"]=cn["[object Boolean]"]=cn["[object Date]"]=cn["[object Float32Array]"]=cn["[object Float64Array]"]=cn["[object Int8Array]"]=cn["[object Int16Array]"]=cn["[object Int32Array]"]=cn["[object Map]"]=cn["[object Number]"]=cn["[object Object]"]=cn["[object RegExp]"]=cn["[object Set]"]=cn["[object String]"]=cn["[object Symbol]"]=cn["[object Uint8Array]"]=cn["[object Uint8ClampedArray]"]=cn["[object Uint16Array]"]=cn["[object Uint32Array]"]=!0,cn["[object Error]"]=cn["[object Function]"]=cn["[object WeakMap]"]=!1;var vn=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(!xe(t))return t;var c=dt(t);if(c){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Jt.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=Xt(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(st(t))return wt(t,d);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=u||m?{}:function(e){return"function"!=typeof e.constructor||Dt(e)?{}:an(Bt(e))}(t),!d)return u?function(e,t){return tt(e,kt(e),t)}(t,function(e,t){return e&&tt(t,Ot(t),e)}(r,t)):function(e,t){return tt(e,Pt(e),t)}(t,function(e,t){return e&&tt(t,Nt(t),e)}(r,t))}else{if(!cn[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return en(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?en(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?en(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,tn.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return ln?Object(ln.call(e)):{}}}(t,v,d)}}a||(a=new Ze);var p=a.get(t);if(p)return p;a.set(t,r),sn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):dn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=c?void 0:(s?u?Ut:Vt:u?Ot:Nt)(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]),et(r,o,e(i,n,l,o,t,a))}),r},mn=function(e){return vn(e,5)};const pn=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"})),En=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(fn,null)),gn=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}},Sn=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(d,{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({}),[_,D]=n.useState([]),[b,A]=n.useState({}),[C,T]=n.useState(null),[N,I]=n.useState(null),[O,w]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),L=window.location.href.includes("/employee");function R(e){T(e.target.files[0])}return n.useEffect(()=>{var e;D(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=y(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:d,selectFile:u,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:d,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,s({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:u,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:_,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:N,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:_,selectedApprover:b,setSelectedApprover:A,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:m,error:O}))},[r,_,N,O]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(pn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(En,{onClick:u}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&L?{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,u,s,m,p;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var f,E,g,S,h,y,_,D,A;const t={...null===(f=v)||void 0===f||null===(E=f.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(g=v)||void 0===g?void 0:g.billAmendmentDetails,workflow:{businessId:null===(S=v)||void 0===S||null===(h=S.billAmendmentDetails)||void 0===h?void 0:h.amendmentId,action:null==r?void 0:r.action,tenantId:d,businessService:null!==(y=v)&&void 0!==y&&null!==(_=y.applicationType)&&void 0!==_&&_.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=v)&&void 0!==D&&null!==(A=D.applicationType)&&void 0!==A&&A.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]: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:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]}};c({AmendmentUpdate:n})}else{if(v={...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:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:{...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:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]}},null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=mn(null==e?void 0:e.date);v.disconnectionExecutionDate=gn(t)}else if(null!=e&&e.date){const t=mn(null==e?void 0:e.date);v.connectionExecutionDate=gn(t)}var T;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(u=v)||void 0===u||null===(s=u.processInstance)||void 0===s?void 0:s.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(T=v)||void 0===T?void 0:T.serviceType)?c({WaterConnection:v,disconnectRequest:!0}):c({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=v)||void 0===m?void 0:m.applicationType))c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var I,O,w,x,L,R,P,M,B,k,F,V,U;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(I=t.value)&&void 0!==I&&I.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(V=t.value)||void 0===V?void 0:V.adhocRebateReason)||""),"WATER"==(null===(U=v)||void 0===U?void 0:U.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)},hn=e=>l.createElement("h1",{className:"heading-m"},e.label),yn=()=>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"})),_n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(yn,null)),Dn=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;console.log("applicationData",c);const{data:p}=Digit.Hooks.useEmployeeSearch(d,{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)}),[f,E]=n.useState({}),[g,S]=n.useState({}),[h,_]=n.useState([]),[D,b]=n.useState(null),[A,C]=n.useState(null),[T,N]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(!1);function L(e){C(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(A){const e=function(){if(A.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(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)}}()},[A]),n.useEffect(()=>{r&&E((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:h,selectedApprover:D,setSelectedApprover:b,selectFile:L,uploadedFile:T,setUploadedFile:N,businessService:v}))},[r,h,T]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(hn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(_n,{onClick:u}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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"};c.creationReason="CREATE",s({PetRegistrationApplications:[{...c,workflow:t}]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},bn=e=>l.createElement("h1",{className:"heading-m"},e.label),An=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Cn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(An,null)),Tn=e=>{var i,o,a;let{t:r,action:d,closeModal:u,submitAction:s,applicationData:c,businessService:v}=e;const m=Digit.ULBService.getStateId(),{data:p,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(m,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==p||null===(i=p.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",c);const[E,g]=n.useState({}),[S,h]=n.useState({}),[y,_]=n.useState([]),[D,b]=n.useState(""),[A,C]=n.useState([]),[T,N]=n.useState(null),I=null===(o=c)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",I);const O=n.useMemo(()=>{var e;if(f||!p||!I.length)return[];const t=new Set(I.map(e=>e.tradeType)),n=(null===(e=p.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"]},[f,p,I]);return console.log("years",O),n.useEffect(()=>{d&&g((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:d,years:O,selectedApprover:D,setSelectedApprover:b,businessService:v}))},[d,O,A,T]),d&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(bn,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Cn,{onClick:u}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=c)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i=`20${Number(l)}-${Number(l)+1}`;c={...c,financialYear:i,action:"INITIATE",additionalDetail:{...c.additionalDetail,validityYears:D.length>0?parseInt(D):""}},s({Licenses:[c]})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Nn=e=>l.createElement("h1",{className:"heading-m"},e.label),In=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),On=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(In,null)),wn=e=>{var i,o;let{t:a,action:r,tenantId:d,closeModal:u,submitAction:s,applicationData:c,businessService:v,moduleCode:m}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(d,{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}),[f,E]=n.useState({}),[g,S]=n.useState({}),[h,_]=n.useState([]),[D,b]=n.useState(null),[A,C]=n.useState(null),[T,N]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState(!1);function L(e){x(!0),C(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(A){const e=function(){if(A.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",A,d)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(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(x(!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)}}()},[A]),console.log("actyhdesh,jhfsefsef",r,c),n.useEffect(()=>{E((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:h,selectedApprover:D,setSelectedApprover:b,selectFile:L,uploadedFile:T,setUploadedFile:N,businessService:v,isUploading:w}))},[r,h,T]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Nn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(On,{onClick:u}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null};T&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]),s({streetVendingDetail:{...c,workflow:n}})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},xn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(X,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Dn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(te,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Tn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(oe,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(ue,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(me,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Sn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(wn,e):void 0;function Ln(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 Rn=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),[_,D]=n.useState(!1),[b,A]=n.useState(!1),{isLoading:C,data:T}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:N,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==T||null===(o=T.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,!N]),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(Pn,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:D,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:b}))))};function Pn(e){var i,o;let{t:a,document:r,setDocuments:d,documents:u,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const m=null==u?void 0:u.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],p=Digit.ULBService.getStateId(),[f,E]=n.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,S]=n.useState(null),[h,y]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[_,D]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&d(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==h?void 0:h.length)||null===h?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==f?void 0:f.code,fileStoreId:h,documentUid:h,fileName:(null==g?void 0:g.name)||"",id:u?null===(t=u.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[h,f]),n.useEffect(()=>{try{_.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],_.map(e=>{var t,n,l;null!=f&&f.code&&r.newUploadedDocs.push({documentType:null==f?void 0:f.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})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[_,f]),n.useEffect(()=>{},[g]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Ln,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:f,optionKey:"i18nKey",select:e=>E(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:p,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])&&S(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Mn(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(Ln,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function Bn(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=y(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 kn=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([]),[D,b]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[T,N]=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(()=>{b("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(Ln,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),D&&(null==y?void 0:y.map((e,t)=>l.createElement(Bn,{key:t,document:e,t:o,error:T,setError:N,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:D}))))},Fn=e=>{let{permissions:i,t:o}=e;const[a,r,d]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[u,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?{...e,checked:l}:e))})(e,0,n),isLabelFirst:!0,index:n})),null==u?void 0:u.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==u?void 0:u.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:v?"96%":"830px",width:v?"96%":"830px"},style:v?{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:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...u];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...u,{label:""}])}}))};function Vn(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:d}=i.useTranslation(),[u,s]=n.useState(()=>[]),[c,v]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=u&&u.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(u,Digit.ULBService.getCurrentTenantId()).then(e=>{v(null==e?void 0:e.data)}):null!=u&&u.length&&Digit.UploadServices.Filefetch(u,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[u]);const m=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),p=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!p&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:m?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=c[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:m?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},d(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),p&&(null==o?void 0:o.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"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=c[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+d(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Un(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 Hn(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 Wn(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 d={marginTop:"19px"},u={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?d={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(d={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},u={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(d={...d,maxWidth:"950px"},d={...d,maxWidth:"950px"},s={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:d,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:u},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const jn=e=>{var o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,_,D,b,A,C,T,N,I;let{scrutinyDetails:O,paymentsList:w=[],additionalDetails:x,applicationData:L}=e;const R=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==L?void 0:L.status))&&window.location.href.includes("bpa"),[P,M]=n.useState(),[B,k]=n.useState(),[F,V]=n.useState(),U=Digit.ULBService.getStateId(),[H,W]=n.useState(),[j,z]=n.useState(),[K,G]=n.useState([]),[$,Y]=n.useState(),[q,Z]=n.useState(""),[X,J]=n.useState(null),[Q,ee]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if($&&null!=$&&$.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==$||null===(t=$.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if($.size>=2e6)J(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",$,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?G([...K,{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}]):J(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[$]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(K))},[K]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=x&&null!==(e=x.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==x?void 0:x.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==x||null===(n=x.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==x||null===(l=x.lessAdjustmentFeeFiles[(null==x||null===(i=x.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,U).then(e=>ee(null==e?void 0:e.data))}M(null==x||null===(t=x.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==x||null===(n=x.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),k(null==x||null===(l=x.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==x||null===(i=x.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),V(null==x||null===(o=x.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==x||null===(a=x.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),W(null==x?void 0:x.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==x?void 0:x.otherFeesDiscription),G(null==x?void 0:x.lessAdjustmentFeeFiles)},[x]);const{t:ae}=i.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(n.Fragment,null,!(null!=O&&O.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==O||null===(o=O.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+ae(""+e.title),text:null!=e&&e.value?`${re(e)} ${ae(null==e?void 0:e.isUnit)}`:ae("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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==O||null===(a=O.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==O||null===(r=O.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==x?void 0:x.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==x?void 0:x.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==O||null===(d=O.values[0])||void 0===d?void 0:d.title)&&l.createElement("div",null,!ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!0)}},ae("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},ae("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==x||null===(u=x.selfCertificationCharges)||void 0===u?void 0:u.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==x||null===(s=x.selfCertificationCharges)||void 0===s?void 0:s.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==x||null===(c=x.selfCertificationCharges)||void 0===c?void 0:c.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==x||null===(v=x.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==x||null===(m=x.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:P,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(M(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==x||null===(p=x.selfCertificationCharges)||void 0===p?void 0:p.BPA_OTHER_CHARGES)||0,value:B,disabled:!R,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(k(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==x||null===(f=x.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:H,disabled:!R,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==x||null===(E=x.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:F,disabled:!R,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(P)?parseFloat(P):0)+parseFloat(B?parseFloat(B):0)+parseFloat(null==x||null===(t=x.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==x||null===(n=x.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==x||null===(l=x.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==x||null===(i=x.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(V(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0&&R?l.createElement("div",null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),Y(e.target.files[0])},disabled:!R,onDelete:()=>{z(null),Y("")},message:j?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:X,uploadMessage:q})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==x||null===(S=x.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(h=Q.fileStoreIds)||void 0===h?void 0:h.length)&&parseInt(null==x||null===(_=x.selfCertificationCharges)||void 0===_?void 0:_.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(D=Q.fileStoreIds[(null==Q||null===(b=Q.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===D?void 0:D.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(P)?parseFloat(P):0)+parseFloat(B?parseFloat(B):0)+parseFloat(null==x||null===(A=x.selfCertificationCharges)||void 0===A?void 0:A.BPA_MALBA_CHARGES)+parseFloat(null==x||null===(C=x.selfCertificationCharges)||void 0===C?void 0:C.BPA_LABOUR_CESS)+parseFloat(null==x||null===(T=x.selfCertificationCharges)||void 0===T?void 0:T.BPA_WATER_CHARGES)+parseFloat(null==x||null===(N=x.selfCertificationCharges)||void 0===N?void 0:N.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(F)?parseFloat(F):0))}))),l.createElement("div",null,null==O||null===(I=O.scruntinyDetails)||void 0===I?void 0:I.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},zn=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,d,u;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:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(d=e.occupancies)||void 0===d||null===(u=d[0])||void 0===u?void 0:u.CarpetArea)||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:{}})})))})))},Kn=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Gn=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(Kn,{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 $n(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 Yn(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 qn=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:""})))))))},Zn=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Xn=[{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"}],Jn=e=>{var o,a,r,d;let{wsAdditionalDetails:u}=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==u||null===(o=u.additionalDetails)||void 0===o||!o.isPaid),[h,y]=n.useState(!1),[D,b]=n.useState(v||{}),[A,C]=n.useState(null),[T,N]=n.useState(u.additionalDetails.data?u.additionalDetails.data:{}),[I,O]=n.useState(u.additionalDetails.values?u.additionalDetails.values:[]),w=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(w,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i={...null==u||null===(e=u.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,d,s,c,p;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===(d=r[0])||void 0===d?void 0:d.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(s=v.billDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.taxAmount)}];O(e),N(null==v||null===(p=v.billDetails)||void 0===p?void 0:p[0])}else m(i),b(i)},[]);let x={};const L=e=>l.createElement("h1",{className:"heading-m"},e.label),R=()=>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(R,null)),M=function(e,t,n){void 0===t&&(t=!1);let l={...D};if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},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==T?void 0:T.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(S?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:S?{color:"#00703C"}:{color:"#D4351C"}}))),null!=u&&null!==(a=u.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(L,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{b(v),y(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{b(v),y(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=D&&D.adhocPenalty?Number(null==D?void 0:D.adhocPenalty):0,n=null!=D&&D.adhocRebate?Number(null==D?void 0:D.adhocRebate):0;var l,i;if(t||n)if(n>(null==u||null===(l=u.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,d,s,v,p,f,g,S;const e=null==u||null===(o=u.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==u||null===(r=u.additionalDetails)||void 0===r||null===(d=r.appDetails)||void 0===d?void 0:d.tenantId,n={...null==u||null===(s=u.additionalDetails)||void 0===s||null===(v=s.appDetails)||void 0===v?void 0:v.additionalDetails,...D};u.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==u||null===(p=u.additionalDetails)||void 0===p||null===(f=p.appDetails)||void 0===f?void 0:f.service)?[{applicationNo:e,tenantId:t,waterConnection:u.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:u.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==u||null===(g=u.additionalDetails)||void 0===g||null===(S=g.appDetails)||void 0===S?void 0:S.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(mn(e.Calculation[0])),N(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),O(h),D.billDetails=null==e?void 0:e.Calculation,m(D),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:Zn,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==D?void 0:D.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==D||null===(r=D.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,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==D?void 0:D.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,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==D?void 0:D.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:Xn,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==D?void 0:D.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==D||null===(d=D.adhocRebateReason_data)||void 0===d?void 0:d.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==D?void 0:D.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,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==D?void 0:D.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})))},Qn=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...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"})))},el=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(Qn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(d)))))},tl=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"}})))))},nl={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:{}},ll=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:nl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:nl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...nl.cell,...nl.cellLeft,...nl.cellHeader}},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...nl.cell,...n.length==t+1?nl.cellRight:{},...nl.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...nl.cell,...nl.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{...nl.cell,textAlign:"left",...n.length==i+1?nl.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...nl.cell,...nl.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...nl.cell,...nl.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:{...nl.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:nl.cell,key:t,numeric:!0})))))))},il={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))"}},ol=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:il.headerStyle},d("CS_ARREARS_DETAILS")),f&&l.createElement(ll,{headers:[...p],values:u,arrears:v}),!f&&l.createElement("div",{style:il.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},d("CS_SHOW_CARD"))),f&&l.createElement("div",{style:il.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},d("CS_HIDE_CARD"))))};function al(e){var a,r,d,u,s,c,v,m,p,f,E,g,S,h;let{applicationDetails:y,demandData:D,workflowDetails:b,isDataLoading:A,applicationData:C,totalDemandTax:T,timelineStatusPrefix:N,showTimeLine:I=!0,statusAttribute:O="status",paymentsList:w,oldValue:x,isInfoLabel:L=!1}=e;const{t:R}=i.useTranslation();let P=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",y);const[B,k]=n.useState({}),[F,V]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||F.loading||F.loaded||F.canLoad||V({loading:!1,loaded:!1,canLoad:!0}),null==F||!F.canLoad||F.loading||F.loaded||(V({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)return 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==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,k,V));const U=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()}`},H=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:U(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(Gn,{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,D,b,A;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==y?void 0:y.tenantId,businessIds:null==y?void 0:y.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},T=n[t-1],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,mobileNumber:(null==C||null===(s=C.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!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(g=E[0])&&void 0!==g&&g.mobileNumber?null==C||null===(S=C.processInstance)||void 0===S||null===(h=S.assignes)||void 0===h||null===(D=h[0])||void 0===D?void 0:D.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.mobileNumber,comment:R(null==e?void 0:e.comment),wfComment:T?T.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Gn,{data:N,OpenImage:M,privacy:i})}{var T,N,I,O,w;const t={date:U(null==C||null===(T=C.auditDetails)||void 0===T?void 0:T.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(w=O[0])||void 0===w?void 0:w.mobileNumber};return l.createElement(Gn,{data:t})}},W=(e,t)=>e?t?e:R(e):R("NA"),j=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),z=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),G=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||j?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),$={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},Y=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${R(null==e?void 0:e.isUnit)}`:R("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):R("N/A"),[q,Z]=n.useState(!1);console.log("demand Data arr",D);const X=null==D?void 0:D.reduce((e,t)=>e+t.demandInterest,0),J=null==D?void 0:D.reduce((e,t)=>e+t.demandPenality,0),Q=null==D?void 0:D.reduce((e,t)=>e+t.collectionTax,0),ee=null==D?void 0:D.reduce((e,t)=>e+t.collectionInterest,0),te=null==D?void 0:D.reduce((e,t)=>e+t.collectionPenality,0),ne=null==D?void 0:D.reduce((e,t)=>e+t.balanceTax,0);return null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},L?l.createElement(el,{t:R,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==y||null===(a=y.applicationDetails)||void 0===a?void 0:a.map((e,i)=>{var a,r,d,u,s,c,v,m,p,f,E,g,S,h,_,D,A,C,T,N,I,O,L,M,k,F,V,U,H,W,$,q,Z,X,J,Q,ee,te,ne,le;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"}:j?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&j?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},z?""+R(e.title):R(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},R(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"}},R(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"}},R(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},R(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||j?{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:R(n.title),label:R(n.title),text:l.createElement("img",{src:R(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:R(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"}},R(null==n?void 0:n.title)))):z||K?""+R(n.title):R(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:G(),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:""+R(""+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:R(n.title),label:R(n.title),text:Y(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:G(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(ol,{bill:null===(r=B.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(jn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:w,additionalDetails:null==y||null===(d=y.applicationData)||void 0===d?void 0:d.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==y||null===(u=y.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(Mn,{fiReport:null==y||null===(m=y.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Hn,{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(Wn,{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(Yn,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.accessories)&&l.createElement($n,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.accessories}),!P&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==b||null===(T=b.data)||void 0===T||null===(N=T.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(Fn,{applicationData:null==y?void 0:y.applicationData,t:R,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(Rn,{t:R,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(kn,{t:R,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(M=e.additionalDetails)||void 0===M?void 0:M.data,bpaActionsDetails:b}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.scruntinyDetails)&&l.createElement(jn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(jn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.subOccupancyTableDetails)&&l.createElement(zn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(Ln,{documents:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(Vn,{documents:null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.documents}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation)&&l.createElement(Un,{taxHeadEstimatesCalculation:null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(qn,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.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===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Jn,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(tl,{wsAdditionalDetails:e,workflowDetails:b}))}),I&&(null==b||null===(r=b.data)||void 0===r||null===(d=r.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==b?void 0:b.isLoading)||A)&&l.createElement(t.Loader,null),!(null!=b&&b.isLoading)&&!A&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},R("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(u=b.data)&&void 0!==u&&u.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:R(`${N}${null==b||null===(v=b.data)||void 0===v||null===(m=v.timeline[0])||void 0===m?void 0:m.state}`),customChild:H(null==b||null===(p=b.data)||void 0===p?void 0:p.timeline[0],null==b||null===(f=b.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)&&(null==b||null===(g=b.data)||void 0===g?void 0:g.timeline.slice(0,q?null==b?void 0:b.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!=b&&null!==(r=b.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!=b&&null!==(s=b.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:R(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[O]}${a}`),customChild:H(e,n,null==b||null===(o=b.data)||void 0===o?void 0:o.timeline)}))}))),(null==b||null===(S=b.data)||void 0===S||null===(h=S.timeline)||void 0===h?void 0:h.length)>2&&l.createElement(t.LinkButton,{label:R(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{Z(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:$.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:$.th},"Installments"),l.createElement("th",{colSpan:"3",style:$.th},"Demand"),l.createElement("th",{colSpan:"3",style:$.th},"Collection"),l.createElement("th",{colSpan:"3",style:$.th},"Balance"),l.createElement("th",{style:$.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:$.th}),l.createElement("th",{style:$.th},"Tax"),l.createElement("th",{style:$.th},"Interest"),l.createElement("th",{style:$.th},"Penalty"),l.createElement("th",{style:$.th},"Tax"),l.createElement("th",{style:$.th},"Interest"),l.createElement("th",{style:$.th},"Penalty"),l.createElement("th",{style:$.th},"Tax"),l.createElement("th",{style:$.th},"Interest"),l.createElement("th",{style:$.th},"Penalty"),l.createElement("th",{style:$.th},"Advance"))),l.createElement("tbody",null,null==D?void 0:D.map(e=>l.createElement("tr",null,l.createElement("td",{style:$.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:$.td},e.demandTax),l.createElement("td",{style:$.td},e.demandInterest),l.createElement("td",{style:$.td},e.demandPenality),l.createElement("td",{style:$.td},e.collectionTax),l.createElement("td",{style:$.td},e.collectionInterest),l.createElement("td",{style:$.td},e.collectionPenality),l.createElement("td",{style:$.td},e.balanceTax),l.createElement("td",{style:$.td},e.balanceInterest),l.createElement("td",{style:$.td},e.balancePenality),l.createElement("td",{style:$.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:$.th},"Total"),l.createElement("td",{style:$.td},T),l.createElement("td",{style:$.td},X),l.createElement("td",{style:$.td},J),l.createElement("td",{style:$.td},Q),l.createElement("td",{style:$.td},ee),l.createElement("td",{style:$.td},te),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td})),l.createElement("tr",null,l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("th",{style:$.th},"Total"),l.createElement("td",{style:$.td},ne),l.createElement("td",{style:$.td},"0"),l.createElement("td",{style:$.td},"0"),l.createElement("td",{style:$.td},"0")),l.createElement("tr",null,l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("td",{style:$.td}),l.createElement("th",{style:$.th},"Total Balance"),l.createElement("td",{style:$.td},ne)))))}function rl(e){var n,i,o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y;let{t:_,showToast:D,closeToast:b,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==D||null===(C=D.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==D?void 0:D.key)?null==D||null===(n=D.error)||void 0===n?void 0:n.message:_("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==D?void 0:D.key)?null==D||null===(i=D.error)||void 0===i?void 0:i.message:_("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==D?void 0:D.key)?null==D||null===(o=D.error)||void 0===o?void 0:o.message:_("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==D?void 0:D.key)?null==D||null===(a=D.error)||void 0===a?void 0:a.message:_("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==D?void 0:D.key)?null==D||null===(r=D.error)||void 0===r?void 0:r.message:_("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==D?void 0:D.key)?null==D||null===(d=D.error)||void 0===d?void 0:d.message:_("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==D?void 0:D.key)?null==D||null===(u=D.error)||void 0===u?void 0:u.message:_("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==D?void 0:D.key)?null==D||null===(s=D.error)||void 0===s?void 0:s.message:_(`ES_${A}_${null==D||null===(c=D.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,D&&l.createElement(t.Toast,{error:"error"===D.key,label:e,onClose:b}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.includes("BPA_OC")){var T;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=A&&A.includes("BPA_OC")?_(e[1]):_(e[0]),n};let n="";switch(null==D||null===(T=D.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==D?void 0:D.key)?null==D||null===(v=D.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==D?void 0:D.key)?null==D||null===(m=D.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==D?void 0:D.key)?null==D||null===(p=D.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==D?void 0:D.key)?null==D||null===(f=D.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==D?void 0:D.key)?null==D||null===(E=D.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==D?void 0:D.key)?null==D||null===(g=D.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==D?void 0:D.key)?null==D||null===(S=D.error)||void 0===S?void 0:S.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==D?void 0:D.key)?null==D||null===(h=D.error)||void 0===h?void 0:h.message:_(`ES_${A}_${null==D||null===(y=D.action)||void 0===y?void 0:y.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,D&&l.createElement(t.Toast,{error:"error"===D.key,label:n,onClose:b}))}{var N,I;const e="error"===(null==D?void 0:D.key)?null==D||null===(N=D.error)||void 0===N?void 0:N.message:`ES_${A}_${null==D||null===(I=D.action)||void 0===I?void 0:I.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,D&&l.createElement(t.Toast,{error:"error"===D.key,label:_(e),onClose:b}))}}function dl(e){var o,a,r,d,u,s,c,v,m,p,f,E,g,S,h,y;let{workflowDetails:_,displayMenu:D,onActionSelect:b,setDisplayMenu:A,businessService:C,forcedActionPrefix:T,ActionBarStyle:N={},MenuStyle:I={}}=e;const{t:O}=i.useTranslation();let w=Digit.UserService.getUser();const x=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const L=null===(o=w)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,P=!1,M=(null==_||null===(d=_.data)||void 0===d||null===(u=d.actionState)||void 0===u||null===(s=u.nextActions)||void 0===s?void 0:s.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==_||null===(c=_.data)||void 0===c||null===(v=c.nextActions)||void 0===v?void 0:v.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 Digit.Hooks.useClickOutside(x,()=>{A(!1)},D),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==M?void 0:M.length)||null!=M&&null!==(m=M[0])&&void 0!==m&&null!==(p=m.redirectionUrl)&&void 0!==p&&p.pathname.includes("/pt/property-details/")&&1==(null==M?void 0:M.length)?(P=!1,R=!0):(null==M?void 0:M.length)>0&&(P=!0,R=!1),l.createElement(l.Fragment,null,!(null!=_&&_.isLoading)&&P&&!R&&l.createElement(t.ActionBar,{style:{...N}},D&&(null!=_&&null!==(f=_.data)&&void 0!==f&&null!==(E=f.actionState)&&void 0!==E&&E.nextActions||null!=_&&null!==(g=_.data)&&void 0!==g&&g.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:T||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase()),options:M,optionKey:"action",t:O,onSelect:b,style:I}):null,l.createElement(t.SubmitBar,{ref:x,label:O("WF_TAKE_ACTION"),onSubmit:()=>A(!D)})),!(null!=_&&_.isLoading)&&!P&&R&&l.createElement(t.ActionBar,{style:{...N}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==M||null===(S=M[0])||void 0===S?void 0:S.action,value:null==M||null===(h=M[0])||void 0===h?void 0:h.action,onClick:e=>{b((null==M?void 0:M[0])||{})}},O(`${T||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase())}_${null==M||null===(y=M[0])||void 0===y?void 0:y.action}`))))}const ul=()=>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"})),sl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ul,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(sl,{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 vl=e=>{var r,d;console.log("props",e);let u=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(c,"BPA",["BlockReason"]),{t:m}=i.useTranslation(),p=o.useHistory();let{id:f}=o.useParams();const[E,g]=n.useState(!1),[S,h]=n.useState(null),[_,D]=n.useState(!1),[b,A]=n.useState(!1),[C,T]=n.useState(!1),{data:N}=Digit.Hooks.obps.useMDMS(c,"BPA",["RiskTypeComputation"]),{applicationDetails:I,demandData:O,totalDemandTax:w,totalBalanceTax:x,showToast:L,setShowToast:R,isLoading:P,isDataLoading:M,applicationData:B,mutate:k,nocMutation:F,workflowDetails:V,id:U,businessService:H,closeToast:W,moduleCode:j,timelineStatusPrefix:z,forcedActionPrefix:K,statusAttribute:G,ActionBarStyle:$,MenuStyle:Y,paymentsList:q,showTimeLine:Z=!0,oldValue:X,isInfoLabel:J=!1,clearDataDetails:Q}=e;n.useEffect(()=>{L&&V.revalidate()},[L]);const ee=a.useQueryClient(),te=()=>{h(null),D(!1)};return P||b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,P?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(al,{applicationDetails:I,demandData:O,id:U,workflowDetails:V,isDataLoading:M,applicationData:B,totalDemandTax:w,totalBalanceTax:x,businessService:H,timelineStatusPrefix:z,statusAttribute:G,paymentsList:q,showTimeLine:Z,oldValue:X,isInfoLabel:J}),_?l.createElement(xn,{t:m,action:S,tenantId:s,state:c,id:f,applicationDetails:I,applicationData:null==I?void 0:I.applicationData,closeModal:te,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,d,u,s,c,v,f,E,g,h,_,D,b,C,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===(d=r[0])||void 0===d?void 0:d.action)?0==(null==e||null===(u=e.Licenses)||void 0===u||null===(s=u[0])||void 0===s||null===(c=s.additionalDetail)||void 0===c||null===(v=c.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(f=e.Licenses)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(h=e.WaterConnection)||void 0===h||null===(_=h.comment)||void 0===_?void 0:_.length)||0==(null==e||null===(D=e.SewerageConnection)||void 0===D||null===(b=D.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(C=e.BPA)||void 0===C||null===(T=C.comment)||void 0===T?void 0:T.length)){var N,I;"INITIATE"===(null==e||null===(N=e.Licenses)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.action)?alert(m("Please fill in the validity before submitting")):alert(m("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,d){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===(d=r.workflow)||void 0===d?void 0:d.action)){function u(t){if(l)return t;k&&(A(!0),k(e,{onError:(e,t)=>{A(!1),R({key:"error",error:e}),setTimeout(W,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,d;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),A(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=S,p.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=S,p.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&p.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,f,E,g,h;null!=t&&null!==(u=t.AmendmentUpdate)&&void 0!==u&&null!==(s=u.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?R({key:"success",label:m("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")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(E=f.workflow)&&void 0!==E&&E.action.includes("APPROVE")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(h=g.workflow)&&void 0!==h&&h.action.includes("REJECT")&&R({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var y;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 R({key:"success",action:S}),void p.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(y=e.Licenses[0])||void 0===y?void 0:y.applicationNumber));R({key:"success",action:S}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH")}}})),te()}A(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&F){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==F?void 0:F.mutateAsync(e)),i=y(function(){return A(!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,p;A(!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?m(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===(p=v[0])||void 0===p?void 0:p.message)||e;te(),R({key:"error",error:{message:f}}),setTimeout(W,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(u):u(i)}alert(m("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==V||null===(r=V.data)||void 0===r?void 0:r.timeline,businessService:H,workflowDetails:V,moduleCode:j,blockReason:null==v||null===(d=v.BPA)||void 0===d?void 0:d.BlockReason}):null,C?l.createElement(cl,{action:S,workflowDetails:V,businessService:H,isWarningPop:C,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(rl,{t:m,showToast:L,closeToast:W,businessService:H}),u?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==N||null===(t=N.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==I||null===(n=I.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==I||null===(o=I.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},d.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",d.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",d.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",d.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),d.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const u=function(e,t,n,l,i,o,a,r,u,c,v,p){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===(c=d.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(p=v.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(d,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(u&&u.then)return u.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(dl,{workflowDetails:V,displayMenu:E,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]),null!=e&&e.isToast)R({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(W,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,d;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))p.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===(d=location)||void 0===d?void 0:d.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var u,s;p.push(""+(null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var c;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname}`)}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),D(!0);else{var v,m;p.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:{...null===(m=e.redirectionUrl)||void 0===m?void 0:m.state}})}else D(!0);h(e),g(!1)},setDisplayMenu:g,businessService:H,forcedActionPrefix:K,ActionBarStyle:$,MenuStyle:Y})))};var ml=l.memo(()=>{var e,a,r,d,u,s,c,v,m,p,f,E;const{t:g}=i.useTranslation(),{data:S}=Digit.Hooks.useStore.getInitData(),h=Digit.ULBService.getCurrentTenantId(),{tenants:y}=S||{},{id:_}=o.useParams(),[D,b]=n.useState(null),[A,C]=n.useState({}),[T,N]=n.useState(!1);let I=!1;window.location.href.includes("applicationsearch")&&(I=!0);const{isLoading:O,data:w}=Digit.Hooks.sv.useSVApplicationDetail(g,h,_,!1),{mutate:x}=Digit.Hooks.sv.useSVApplicationAction(h);let L=Digit.Hooks.useWorkflowDetails({tenantId:(null==w||null===(e=w.applicationData)||void 0===e?void 0:e.tenantId)||h,id:null==w||null===(a=w.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.applicationNo,moduleCode:"street-vending",role:"SV_CEMP"});var R,P;n.useEffect(()=>{w&&C(H.cloneDeep(w))},[w]),!Digit.UserService.hasAccess(["SVCEMP"])||"street-vending"!==(null==L||null===(d=L.data)||void 0===d?void 0:d.applicationBusinessService)||null==L||null===(u=L.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c||!c.find(e=>"PAY"===e.action)||(L.data.actionState.nextActions=null==L||null===(R=L.data)||void 0===R||null===(P=R.actionState)||void 0===P?void 0:P.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==A||null===(t=A.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNo)}}:e}));let M=[{order:1,label:g("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=null==A?void 0:A.applicationData,t=y.find(t=>t.code===e.tenantId);return Promise.resolve(z(e.applicationData,t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:B,isLoading:k}=Digit.Hooks.useRecieptSearch({tenantId:h,businessService:"sv-services",consumerCodes:null==A||null===(v=A.applicationData)||void 0===v||null===(m=v.applicationData)||void 0===m?void 0:m.applicationNo,isEmployee:!1},{enabled:!(null==A||null===(p=A.applicationData)||void 0===p||null===(f=p.applicationData)||void 0===f||!f.applicationNo)});return B&&(null==B?void 0:B.Payments.length)>0&&0==k&&M.push({label:g("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...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==B||null===(e=B.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==B?void 0:B.Payments[0]})}}),B&&(null==B?void 0:B.Payments.length)>0&&0==k&&M.push({label:g("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(h,{SVDetail:[null==w||null===(e=w.applicationData)||void 0===e?void 0:e.applicationData]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(h,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),B&&(null==B?void 0:B.Payments.length)>0&&0==k&&M.push({label:g("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(h,{SVDetail:[null==w||null===(e=w.applicationData)||void 0===e?void 0:e.applicationData]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(h,{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"}},g("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"}},M&&M.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>N(!T),displayOptions:T,options:M,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(vl,{isAction:I,applicationDetails:null==A?void 0:A.applicationData,isLoading:O,isDataLoading:O,applicationData:null==A||null===(E=A.applicationData)||void 0===E?void 0:E.applicationData,mutate:x,workflowDetails:L,businessService:"street-vending",moduleCode:"sv-services",showToast:D,setShowToast:b,closeToast:()=>{b(null)},timelineStatusPrefix:"SV_",forcedActionPrefix:"SV",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const pl=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=y(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)}})))},fl=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)},El=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(fl,{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(fl,{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(fl,{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 gl=function(e){return"symbol"==typeof e||nt(e)&&"[object Symbol]"==we(e)},Sl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hl=/^\w*$/;function yl(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(yl.Cache||Ye),n}yl.Cache=Ye;var _l,Dl,bl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Al=/\\(\\)?/g,Cl=(_l=yl(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(bl,function(e,n,l,i){t.push(l?i.replace(Al,"$1"):n||e)}),t},function(e){return 500===Dl.size&&Dl.clear(),e}),Dl=_l.cache,_l),Tl=be?be.prototype:void 0,Nl=Tl?Tl.toString:void 0,Il=function(e){if("string"==typeof e||gl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const Ol={Create:e=>{var t,n,r,u,s,c;const v=a.useQueryClient(),m=o.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:f}=o.useLocation(),E=o.useHistory();Digit.ULBService.getStateId();let g=[];const[S,h,y]=Digit.Hooks.useSessionStorage("SV_CREATES",{}),_=sessionStorage.getItem("vendingApplicationID")?sessionStorage.getItem("vendingApplicationID"):null,{data:D}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{applicationNumber:_,isDraftApplication:!1},enabled:!!_}),b=null==D||null===(t=D.SVDetail)||void 0===t?void 0:t[0],{data:A}=Digit.Hooks.sv.useSvSearchApplication({tenantId:Digit.ULBService.getCitizenCurrentTenant(!0),filters:{isDraftApplication:!0}}),C=null==A||null===(n=A.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=S.owners||[];n[l]=t,h({...S,[e]:[...n]})}else if("units"===e){let e=S.units||[];e=t,h({...S,units:e})}else h({...S,[e]:{...S[e],...t}});((e,t,n,l)=>{let i,o=f.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=f.slice(0,-3),o=o.split("/").pop(),r=!0):(o=f.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:d={}}=g.find(e=>e.route===o),u=E.push;if(e&&(u=E.replace),n&&(d=l),null===d)return u(m.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?`${m.path}/${d}/${t}`:`${m.path}/${d}`,u(i)})(n,l,i,e)}S&&Object.keys(S).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),v.invalidateQueries("SV_CREATES"));const N=()=>{},I=()=>{};d.forEach(e=>{g=g.concat(e.body.filter(e=>!e.hideInCitizen))}),g.indexRoute="info";const O=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("CheckPage"),w=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,g.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:`${m.path}/${e.route}`,key:t},l.createElement(d,{config:{texts:i,inputs:a,key:r},onSelect:T,onSkip:N,t:p,formData:S,onAdd:I,userType:u,editdata:f.includes("apply")?{}:b,previousData:C}))}),l.createElement(o.Route,{path:m.path+"/check"},l.createElement(O,{onSubmit:function(){try{return E.replace(m.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:S,editdata:f.includes("apply")?{}:b})),l.createElement(o.Route,{path:m.path+"/acknowledgement"},l.createElement(w,{data:S,onSuccess:()=>{y(),v.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:`${m.path}/${g.indexRoute}`})))},SVApplicantDetails:e=>{var i,o,a,d,u,c,m,p,f,E,g,S,h,y,_,D,b,A,C,T,N,I,O,w,x,L,R,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,De,be,Ae,Ce,Te,Ne,Ie,Oe,we,xe,Le,Re,Pe,Me,Be,ke,Fe,Ve,Ue,He,We,je,ze,Ke,Ge,$e,Ye;let{t:qe,config:Ze,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===(d=Je.owner)||void 0===d||null===(u=d.units)||void 0===u?void 0:u.userCategory)||(null==Je||null===(c=Je.owner)||void 0===c?void 0:c.userCategory)||""),[dt,ut]=n.useState((null==Je||null===(m=Je.owner)||void 0===m||null===(p=m.units)||void 0===p?void 0:p.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===(D=_.units)||void 0===D?void 0:D.fatherName)||(null==Je||null===(b=Je.owner)||void 0===b?void 0:b.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===(T=Je.owner)||void 0===T?void 0:T.spouseName)||""),[Et,gt]=n.useState(!1),[St,ht]=n.useState((null==Je||null===(N=Je.owner)||void 0===N||null===(I=N.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===(L=Je.owner)||void 0===L?void 0:L.spouseDateBirth)||""),[Dt,bt]=n.useState((null==Je||null===(R=Je.owner)||void 0===R||null===(P=R.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)||""),[Tt,Nt]=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===($=Je.owner)||void 0===$?void 0:$.tradeNumber)||""),[Lt,Rt]=n.useState(null),[Pt,Mt]=n.useState((null==Je||null===(Y=Je.owner)||void 0===Y?void 0:Y.spouseDependentChecked)||!1),[Bt,kt]=n.useState((null==Je||null===(q=Je.owner)||void 0===q?void 0:q.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===(Z=Je.owner)||void 0===Z?void 0:Z.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===(De=_e[0])||void 0===De?void 0:De.mobileNo)||(null==Qe||null===(be=Qe.vendorDetail)||void 0===be||null===(Ae=be[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===(Te=Ce[1])||void 0===Te?void 0:Te.dob)||(null==Qe||null===(Ne=Qe.vendorDetail)||void 0===Ne||null===(Ie=Ne[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===(Le=xe[2])||void 0===Le?void 0:Le.name)||"",dependentDateBirth:(null==et||null===(Re=et.vendorDetail)||void 0===Re||null===(Pe=Re[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===($e=Qe.vendorDetail)||void 0===$e||null===(Ye=$e[0])||void 0===Ye?void 0:Ye.tradeNumber)||""}]),zt=e=>{""===e||/^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/.test(e)?Rt(""):Rt(qe("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 $t=(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:qe({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 Yt=[{code:"MALE",i18nKey:"MALE",value:"Male"},{code:"FEMALE",i18nKey:"FEMALE",value:"Female"},{code:"OTHERS",i18nKey:"OTHERS",value:"Others"}],qt=()=>{Mt(!Pt)},Zt=()=>{kt(!Bt)};return n.useEffect(()=>{It&&zt(It)},[It]),l.createElement(l.Fragment,null,l.createElement(v,{currentStep:1}),l.createElement(t.FormStep,{config:Ze,onSelect:()=>{const e=$t(Wt[0].vendorDateOfBirth,"vendor"),t=!Pt||$t(Wt[0].spouseDateBirth,"spouse"),n=!Bt||$t(Wt[0].dependentDateBirth,"dependent");if(!e||!t||!n)return;let l={...Je.owner||{},units:Wt,spouseDependentChecked:Pt,dependentNameChecked:Bt};Xe(Ze.key,{...Je[Ze.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:qe,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,""+qe("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,s({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:qe("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:qe("SV_ENTER_CORRECT_NAME")})),l.createElement(t.CardLabel,null,""+qe("SV_OWNER_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:Ht,name:"userCategory-"+n,defaultValue:at,rules:{required:qe("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:qe,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+qe("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:qe("SV_INVALID_NUMBER")}),l.createElement(t.CardLabel,null,""+qe("SV_EMAIL")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:qe,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,""+qe("SV_DATE_OF_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:qe,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),$t(t.target.value,"vendor")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:qe("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||qe("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+qe("SV_GENDER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:qe,options:Yt,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,""+qe("SV_FATHER_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,s({style:{background:"#FAFAFA"},t:qe,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:qe("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:qe("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,""+qe("SV_SPOUSE_NAME")," ",Pt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.CheckBox,{label:qe("SV_INVOLVED_IN_VENDING"),onChange:qt,checked:Pt})),l.createElement(t.TextInput,s({style:{background:"#FAFAFA"},t:qe,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:qe("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:qe("SV_ENTER_CORRECT_NAME")}))),l.createElement(t.CardLabel,null,""+qe("SV_SPOUSE_DATE_OF_BIRTH")," ",Pt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:qe,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),$t(t.target.value,"spouse")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:qe("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||qe("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,""+qe("SV_DEPENDENT_NAME")," ",Bt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.CheckBox,{label:qe("SV_INVOLVED_IN_VENDING"),onChange:Zt,checked:Bt})),l.createElement(t.TextInput,s({style:{background:"#FAFAFA"},t:qe,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:qe("SV_CITIZEN_VALIDATION_FORMAT")});let n=[...Wt];n[e].dependentName=t.target.value,bt(t.target.value),jt(n)}(n,e),disable:!1,ValidationRequired:Bt},tt={isRequired:Bt,pattern:"^[a-zA-Z ]+$",type:"text",title:qe("SV_ENTER_CORRECT_NAME")}))),l.createElement(t.CardLabel,null,""+qe("SV_DEPENDENT_DATE_OF_BIRTH")," ",Bt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{style:{background:"#FAFAFA"},t:qe,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),$t(t.target.value,"dependent")}(n,e),disable:!1,max:(new Date).toISOString().split("T")[0],rules:{required:qe("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||qe("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+qe("SV_DEPENDENT_GENDER")," ",Bt&&l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:qe,options:Yt,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,Nt(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,""+qe("SV_TRADE_NUMBER")),l.createElement(t.TextInput,s({style:{background:"#FAFAFA"},t:qe,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:qe("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)}()},""+qe("SV_ADD_DEPENDENT")))),l.createElement("br",null)))),Vt&&l.createElement(t.Toast,{error:Vt.error,warning:Vt.warning,label:qe(Vt.label),onClose:()=>{Ut(null)}}))},SVBusinessDetails:e=>{var i,o,a,d,u,c,m,p,f,E,g,y,_,D,b,A,C,T,N,I,O,w,x,L,R,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,De;let{t:be,config:Ae,onSelect:Ce,userType:Te,formData:Ne,editdata:Ie,previousData:Oe}=e,we={};const xe=Digit.UserService.getUser().info,Le=e=>e?{i18nKey:e,code:e,value:e}:null,[Re,Pe]=n.useState((null==Ne||null===(i=Ne.businessDetails)||void 0===i?void 0:i.vendingType)||Le((null==Oe?void 0:Oe.vendingActivity)||(null==Ie?void 0:Ie.vendingActivity))||(null==Ne||null===(o=Ne.businessDetails)||void 0===o?void 0:o.vendingType)||""),[Me,Be]=n.useState((null==Ne||null===(a=Ne.businessDetails)||void 0===a?void 0:a.vendingZones)||Le((null==Oe?void 0:Oe.vendingZone)||(null==Ie?void 0:Ie.vendingZone))||""),[ke,Fe]=n.useState((null==Ne||null===(d=Ne.businessDetails)||void 0===d?void 0:d.location)||""),[Ve,Ue]=n.useState((null==Ne||null===(u=Ne.businessDetails)||void 0===u?void 0:u.areaRequired)||(null==Oe?void 0:Oe.vendingArea)||(null==Ie?void 0:Ie.vendingArea)||""),[He,We]=n.useState((null==Ne||null===(c=Ne.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==Ne||null===(m=Ne.businessDetails)||void 0===m?void 0:m.vendingLiscence)||(null==Oe?void 0:Oe.vendingLiscence)||(null==Ie?void 0:Ie.vendingLiscence)||""),Ke={width:"EMPLOYEE"===xe.type?"50%":"86%"},[Ge,$e]=n.useState(null),[Ye,qe]=n.useState(7===(null==Oe||null===(p=Oe.vendingOperationTimeDetails)||void 0===p?void 0:p.length)||7===(null==Ie||null===(f=Ie.vendingOperationTimeDetails)||void 0===f?void 0:f.length)||(null==Ne||null===(E=Ne.businessDetails)||void 0===E?void 0:E.isSameForAll)),[Ze,Xe]=n.useState((null==Ne||null===(g=Ne.businessDetails)||void 0===g?void 0:g.daysOfOperation)||[{name:"Monday",isSelected:!1,startTime:(null==Oe||null===(y=Oe.vendingOperationTimeDetails)||void 0===y||null===(_=y[0])||void 0===_?void 0:_.fromTime)||(null==Ie||null===(D=Ie.vendingOperationTimeDetails)||void 0===D||null===(b=D[0])||void 0===b?void 0:b.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===(T=Ie.vendingOperationTimeDetails)||void 0===T||null===(N=T[0])||void 0===N?void 0:N.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===(L=Oe.vendingOperationTimeDetails)||void 0===L||null===(R=L[1])||void 0===R?void 0:R.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===(B=Oe.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==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===($=G[3])||void 0===$?void 0:$.fromTime)||"",endTime:(null==Oe||null===(Y=Oe.vendingOperationTimeDetails)||void 0===Y||null===(q=Y[3])||void 0===q?void 0:q.toTime)||(null==Ie||null===(Z=Ie.vendingOperationTimeDetails)||void 0===Z||null===(X=Z[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==Ne||null===(De=Ne.businessDetails)||void 0===De?void 0:De.backupDays)||[...Ze]),et=()=>Ze.some(e=>e.startTime,e=>e.endTime),tt=(e,t,n)=>{let l=[...Ze];if(l[e][t]=n,l[e].isSelected=!(!l[e].startTime&&!l[e].endTime),Ye){const{startTime:t,endTime:n}=l[e];l=l.map(e=>({...e,startTime:t,endTime:n}))}Xe(l)},nt=()=>{if(Ye)Xe([...Je]);else{Qe([...Ze]);const{startTime:e,endTime:t,isSelected:n}=Ze.find(e=>e.startTime||e.endTime)||Ze[0];Xe(Ze.map(l=>({...l,startTime:e,endTime:t,isSelected:n})))}qe(!Ye)},lt=[{id:"selection",Header:()=>l.createElement("div",{className:"SVTableHeader"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:Ye,disabled:!et(),onChange:nt}),l.createElement("h4",{style:{marginLeft:"8px"}},be("SV_SELECT_ALL"))),Cell:()=>l.createElement("div",{className:"SVTableCells"},l.createElement("input",{className:"SVCheckbox",type:"checkbox",checked:Ye,disabled:!0}))},{Header:be("SV_DAY"),accessor:"name"},{Header:be("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=Ze[i.index])||void 0===n?void 0:n.startTime)||"",onChange:e=>tt(i.index,"startTime",e.target.value),placeholder:"Start Time"})}},{Header:be("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=Ze[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 $e({error:!0,label:be("SV_TIME_OPERATIONS_VALIDATION")});let e;e={...Ne.businessDetails,vendingType:Re,vendingZones:Me,location:ke,areaRequired:Ve,nameOfAuthority:He,vendingLiscence:je,daysOfOperation:Ze,isSameForAll:Ye,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,_,D,b;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===(D=_.units)||void 0===D||null===(b=D[0])||void 0===b?void 0:b.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==Ne||null===(e=Ne.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==Ne||null===(m=Ne.owner)||void 0===m||null===(p=m.units)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.spouseName,t=null==Ne||null===(E=Ne.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(Ne)]:!v(e)&&v(t)?r=[u(Ne),s(Ne)]:v(e)||v(t)||(r=[u(Ne),s(Ne),c(Ne)])}const h=Ze.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 D={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==Ne||null===(i=Ne.owner)||void 0===i||null===(o=i.units)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tradeNumber,vendingActivity:null==Re?void 0:Re.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:D,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(()=>{$e(null)},2e3);return()=>clearTimeout(e)}},[Ge]),n.useEffect(()=>{"citizen"===Te&&ct()},[Re,Me,ke,Ve,He,je,Ze]),l.createElement(l.Fragment,null,l.createElement(v,{currentStep:2}),l.createElement("div",null,ot&&l.createElement(S,{t:be,onSelect:Ce,formData:Ne,handleRemove:()=>{at(!ot)},onSave:function(e){Fe(e),at(!1)}}),!ot&&l.createElement(t.FormStep,{config:Ae,onSelect:ct,onSkip:()=>Ce(),t:be,isDisabled:!Re||!Me||("STATIONARY"===(null==Re?void 0:Re.code)?!Ve:null)||!He||!Ze},l.createElement("div",null,l.createElement(t.CardLabel,null,""+be("SV_VENDING_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:it,name:"vendingType",defaultValue:Re,rules:{required:be("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Re,select:Pe,option:dt,optionKey:"i18nKey",t:be,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+be("SV_VENDING_ZONES")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:it,name:"vendingZones",defaultValue:Me,rules:{required:be("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Me,select:Be,option:st,optionKey:"i18nKey",t:be,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+be("SV_LOCATION")),l.createElement("div",null,l.createElement(t.TextInput,{isMandatory:!1,optionKey:"i18nKey",t:be,style:Ke,name:"location",value:ke,onChange:function(e){Ne.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,be("SV_DAY_HOUR_OPERATION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(h,{t:be,data:Ze,columns:lt,getCellProps:e=>({style:{padding:"4px 0px 0px 18px",height:"18px"}}),isPaginationRequired:!1}),"STATIONARY"===(null==Re?void 0:Re.code)&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+be("SV_AREA_REQUIRED")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,s({t:be,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"areaRequired",value:Ve,onChange:function(e){/[a-zA-Z]/.test(e.target.value)&&$e({error:!0,label:be("SV_CITIZEN_AREA_VALIDATION")}),Ue(e.target.value)},style:Ke,ValidationRequired:!1},we={isRequired:!0,pattern:"^[0-9. ]{1,3}$",type:"tel",title:be("SV_INVALID_AREA")}))),l.createElement(t.CardLabel,null,""+be("SV_LOCAL_AUTHORITY_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,s({t:be,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:be("SV_INPUT_DID_NOT_MATCH")})),l.createElement(t.CardLabel,null,""+be("SV_VENDING_LISCENCE")),l.createElement(t.TextInput,s({t:be,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:be("PT_NAME_ERROR_MESSAGE")})))),Ge&&l.createElement(t.Toast,{error:Ge.error,warning:Ge.warning,label:be(Ge.label),onClose:()=>{$e(null)}})))},GIS:S,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(m(o,".","_"))),a.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(m(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("COMMON_NEXT"),onSubmit:o}))))},SVDayAndTimeSlot:e=>{let{day:n,onDayToggle:i,onSameForAllChange:o,isSameForAll:a,onTimeChange:r}=e,d={};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,s({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"},d={isRequired:!!n.isSelecte})),l.createElement(t.TextInput,s({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"},d={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,d,u,c,m,p,f,E,g,S,h,y,_,D,b,A,C,T,N,I,O,w,x,L,R,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,De,be,Ae,Ce,Te,Ne,Ie;let{t:Oe,config:we,onSelect:xe,userType:Le,formData:Re,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==Re||null===(i=Re.address)||void 0===i?void 0:i.pincode)||(null==Me||null===(a=Me.addressDetails)||void 0===a||null===(d=a[0])||void 0===d?void 0:d.pincode)||(null==Pe||null===(u=Pe.addressDetails)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.pincode)||""),[je,ze]=n.useState((null==Re||null===(m=Re.address)||void 0===m?void 0:m.city)||ke((null==Me||null===(p=Me.addressDetails)||void 0===p||null===(f=p[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==Re||null===(S=Re.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===(D=_[0])||void 0===D?void 0:D.locality))||""),[$e,Ye]=n.useState((null==Re||null===(b=Re.address)||void 0===b?void 0:b.houseNo)||(null==Me||null===(A=Me.addressDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.houseNo)||(null==Pe||null===(T=Pe.addressDetails)||void 0===T||null===(N=T[0])||void 0===N?void 0:N.houseNo)||""),[qe,Ze]=n.useState((null==Re||null===(I=Re.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===(L=x[0])||void 0===L?void 0:L.landmark)||""),[Xe,Je]=n.useState((null==Re||null===(R=Re.address)||void 0===R?void 0:R.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==Re||null===(F=Re.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==Re||null===(j=Re.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===($=G[1])||void 0===$?void 0:$.pincode)||""),[lt,it]=n.useState((null==Re||null===(Y=Re.correspondenceAddress)||void 0===Y?void 0:Y.ccity)||ke((null==Me||null===(q=Me.addressDetails)||void 0===q||null===(Z=q[1])||void 0===Z?void 0:Z.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==Re||null===(Q=Re.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==Re||null===(ie=Re.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==Re||null===(ue=Re.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==Re||null===(pe=Re.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==Re||null===(he=Re.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===(De=Pe.addressDetails)||void 0===De||null===(be=De[1])||void 0===be?void 0:be.addressLine2)||""),[ft,Et]=n.useState((null==Re||null===(Ae=Re.correspondenceAddress)||void 0===Ae?void 0:Ae.isAddressSame)||(null==Me||null===(Ce=Me.addressDetails)||void 0===Ce||null===(Te=Ce[1])||void 0===Te?void 0:Te.isAddressSame)||(null==Pe||null===(Ne=Pe.addressDetails)||void 0===Ne||null===(Ie=Ne[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,_,D,b,A,C,T,N,I,O,w,x,L,R,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,_,D,b;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===(D=_.units)||void 0===D||null===(b=D[0])||void 0===b?void 0:b.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==Re||null===(e=Re.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==Re||null===(H=Re.owner)||void 0===H||null===(W=H.units)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.spouseName,t=null==Re||null===(z=Re.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(Re)]:!U(e)&&U(t)?M=[k(Re),F(Re)]:U(e)||U(t)||(M=[k(Re),F(Re),V(Re)])}const $=(null==Re||null===(l=Re.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:""})),Y=sessionStorage.getItem("Response"),q=JSON.parse(Y);let Z={addressDetails:[{addressId:"",addressLine1:(null==Re||null===(i=Re.address)||void 0===i?void 0:i.addressline1)||Xe,addressLine2:(null==Re||null===(o=Re.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==Re||null===(d=Re.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==Re||null===(v=Re.address)||void 0===v||null===(m=v.city)||void 0===m?void 0:m.code)||(null==je?void 0:je.code),doorNo:"",houseNo:(null==Re||null===(p=Re.address)||void 0===p?void 0:p.houseNo)||$e,landmark:(null==Re||null===(f=Re.address)||void 0===f?void 0:f.landmark)||qe,locality:(null==Re||null===(E=Re.address)||void 0===E||null===(g=E.locality)||void 0===g?void 0:g.i18nKey)||(null==Ke?void 0:Ke.i18nKey),localityCode:(null==Re||null===(S=Re.address)||void 0===S||null===(h=S.locality)||void 0===h?void 0:h.code)||(null==Ke?void 0:Ke.code),pincode:(null==Re||null===(y=Re.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===(D=_[1])||void 0===D?void 0:D.city)||(null==lt?void 0:lt.name),cityCode:(null==Me||null===(b=Me.addressDetails)||void 0===b||null===(A=b[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==q||null===(C=q.SVDetail)||void 0===C?void 0:C.draftId),documentDetails:[{applicationId:"",auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},documentDetailId:"",documentType:"",fileStoreId:""}],localAuthorityName:null==Re||null===(T=Re.businessDetails)||void 0===T?void 0:T.nameOfAuthority,tenantId:B,termsAndCondition:"Y",tradeLicenseNo:null==Re||null===(N=Re.owner)||void 0===N||null===(I=N.units)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.tradeNumber,vendingActivity:null==Re||null===(w=Re.businessDetails)||void 0===w||null===(x=w.vendingType)||void 0===x?void 0:x.code,vendingArea:(null==Re||null===(L=Re.businessDetails)||void 0===L?void 0:L.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:$,vendingZone:null==Re||null===(R=Re.businessDetails)||void 0===R||null===(P=R.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:Z,draftApplication:!0},B).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})},Dt=()=>{let e=Re.address;if(Fe.includes("correspondence")){e=null==Re?void 0:Re.correspondenceAddress;let t={...e,cpincode:tt,ccity:lt,clocality:ot,chouseNo:rt,clandmark:ut,caddressline1:ct,caddressline2:mt,isAddressSame:ft};xe(we.key,{...Re[we.key],...t},!1),!window.location.href.includes("edit")&&_t()}else{let t={...e,pincode:He,city:je,locality:Ke,houseNo:$e,landmark:qe,addressline1:Xe,addressline2:Qe};xe(we.key,{...Re[we.key],...t},!1),!window.location.href.includes("edit")&&_t()}},bt=()=>xe();return n.useEffect(()=>{"citizen"===Le&&Dt()},[He,je,Ke,$e,qe,Xe,Qe,lt,rt,ot,ct,mt]),Fe.includes("correspondence")?l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(v,{currentStep:3}):null,l.createElement(t.FormStep,{config:we,onSelect:Dt,onSkip:bt,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($e),st(qe),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,s({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,s({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,s({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,s({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:Be,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(v,{currentStep:3}):null,l.createElement(t.FormStep,{config:we,onSelect:Dt,onSkip:bt,t:Oe,isDisabled:!(je&&$e&&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,s({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:$e,placeholder:"Enter House No",onChange:e=>{Ye(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,s({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,s({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,s({t:Oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:qe,placeholder:"Enter Landmark",onChange:e=>{Ze(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:Be,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,d,u,c,m,p,f,E,g,S,h,_,D,b,A;let{t:C,config:T,onSelect:N,userType:I,formData:O,editdata:w,previousData:x}=e;const[L,R]=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===(d=x.bankDetail)||void 0===d?void 0:d.accountNumber)||(null==w||null===(u=w.bankDetail)||void 0===u?void 0:u.accountNumber)||"",ifscCode:(null==O||null===(c=O.bankdetails)||void 0===c?void 0:c.ifscCode)||(null==x||null===(m=x.bankDetail)||void 0===m?void 0:m.ifscCode)||(null==w||null===(p=w.bankDetail)||void 0===p?void 0:p.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===(_=w.bankDetail)||void 0===_?void 0:_.bankBranchName)||"",accountHolderName:(null==O||null===(D=O.bankdetails)||void 0===D?void 0:D.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),B=Digit.UserService.getUser().info,k=n.useCallback(function(){try{const e=y(function(){return Promise.resolve(fetch("https://ifsc.razorpay.com/"+L.ifscCode)).then(function(e){return Promise.resolve(e.json()).then(function(e){null!=e&&e.BANK&&null!=e&&e.BRANCH?R(t=>({...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)}},[L.ifscCode,C]);n.useEffect(()=>{L.accountNumber&&L.confirmAccountNumber&&L.accountNumber===L.confirmAccountNumber&&M({error:!1,label:C("SV_ACCOUNT_NUMBER_MATCHES")})},[L.accountNumber,L.confirmAccountNumber,C]),n.useEffect(()=>{11===L.ifscCode.length&&k()},[L.ifscCode,k]),n.useEffect(()=>{if(P){const e=setTimeout(()=>M(null),2e3);return()=>clearTimeout(e)}},[P]),n.useEffect(()=>{"citizen"===I&&F()},[L.accountNumber||L.confirmAccountNumber||L.ifscCode||L.bankName||L.bankBranchName||L.accountHolderName]);const F=()=>{L.accountNumber===L.confirmAccountNumber?(N(T.key,{...O.bankdetails,...L},!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,_,D,b,A,C,T,N,I,w,R,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,_,D,b;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===(D=_.units)||void 0===D||null===(b=D[0])||void 0===b?void 0:b.vendorName,relationshipType:"VENDOR",vendorId:null}},$=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}},Y=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}},q=e=>!e||""===e.trim();if(!q(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 Z,X,J,Q,ee,te;const e=null==O||null===(Z=O.owner)||void 0===Z||null===(X=Z.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;q(e)&&q(t)?z=[G(O)]:!q(e)&&q(t)?z=[G(O),$(O)]:q(e)||q(t)||(z=[G(O),$(O),Y(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===(D=_.ccity)||void 0===D?void 0:D.code,doorNo:"",houseNo:null==O||null===(b=O.correspondenceAddress)||void 0===b?void 0:b.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===(T=C.clocality)||void 0===T?void 0:T.i18nKey,localityCode:null==O||null===(N=O.correspondenceAddress)||void 0===N||null===(I=N.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===(R=O.correspondenceAddress)||void 0===R?void 0:R.isAddressSame}],applicationDate:0,applicationId:"",applicationNo:"",applicationStatus:"",approvalDate:0,auditDetails:{createdBy:"",createdTime:0,lastModifiedBy:"",lastModifiedTime:0},bankDetail:{accountHolderName:null==L?void 0:L.accountHolderName,accountNumber:null==L?void 0:L.accountNumber,applicationId:"",bankBranchName:null==L?void 0:L.bankBranchName,bankName:null==L?void 0:L.bankName,id:"",ifscCode:null==L?void 0:L.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===(B=O.owner)||void 0===B||null===(k=B.units)||void 0===k||null===(F=k[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"===B.type?"50%":null};return l.createElement(l.Fragment,null,l.createElement(v,{currentStep:4}),l.createElement(t.FormStep,{config:T,onSelect:F,onSkip:()=>N(),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,s({t:C,type:"text",name:i,value:L[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||R(n=>({...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:d,onSelect:u,formData:s,editdata:c,previousData:m}=e;const[p,f]=n.useState((null==s||null===(i=s.documents)||void 0===i?void 0:i.documents)||[]),[E,g]=n.useState(null),[S,h]=n.useState(!0),[y,_]=n.useState(!0),b=Digit.ULBService.getStateId(),{isLoading:A,data:C}=Digit.Hooks.sv.useSVDoc(b,"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==C||null===(e=C.StreetVending)||void 0===e||e.Documents.forEach(e=>{e.hasDropdown=!0,!p.some(t=>e.required&&(null==t?void 0:t.documentType.includes(e.code)))&&e.required&&(t+=1)}),h(!(0===t&&p.length>0))},[p,y,C]),l.createElement("div",null,l.createElement(v,{currentStep:5}),A?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:d,onSelect:()=>{let e={...s.documents,documents:p};u(d.key,e),!window.location.href.includes("edit")&&(()=>{var e,t,n,l,i,o,a,r,d,u,c,v,f,E,g,S,h,y,_,D,b,A,C,N,I,O,w,x,L,R,P,M,B,k,F,V,U,H,W,j,z,K,G,$,Y,q;let Z=[],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,_,D,b;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===(D=_.units)||void 0===D||null===(b=D[0])||void 0===b?void 0:b.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==s||null===(e=s.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==s||null===(ne=s.owner)||void 0===ne||null===(le=ne.units)||void 0===le||null===(ie=le[0])||void 0===ie?void 0:ie.spouseName,t=null==s||null===(oe=s.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)?Z=[J(s)]:!te(e)&&te(t)?Z=[J(s),Q(s)]:te(e)||te(t)||(Z=[J(s),Q(s),ee(s)])}const de=(null==s||null===(l=s.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==s||null===(i=s.address)||void 0===i?void 0:i.addressline1,addressLine2:null==s||null===(o=s.address)||void 0===o?void 0:o.addressline2,addressType:"",city:null==s||null===(a=s.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.name,cityCode:null==s||null===(d=s.address)||void 0===d||null===(u=d.city)||void 0===u?void 0:u.code,doorNo:"",houseNo:null==s||null===(c=s.address)||void 0===c?void 0:c.houseNo,landmark:null==s||null===(v=s.address)||void 0===v?void 0:v.landmark,locality:null==s||null===(f=s.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==s||null===(g=s.address)||void 0===g||null===(S=g.locality)||void 0===S?void 0:S.code,pincode:null==s||null===(h=s.address)||void 0===h?void 0:h.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==s||null===(y=s.correspondenceAddress)||void 0===y?void 0:y.caddressline1,addressLine2:null==s||null===(_=s.correspondenceAddress)||void 0===_?void 0:_.caddressline2,addressType:"",city:null==s||null===(D=s.correspondenceAddress)||void 0===D||null===(b=D.ccity)||void 0===b?void 0:b.name,cityCode:null==s||null===(A=s.correspondenceAddress)||void 0===A||null===(C=A.ccity)||void 0===C?void 0:C.code,doorNo:"",houseNo:null==s||null===(N=s.correspondenceAddress)||void 0===N?void 0:N.chouseNo,landmark:null==s||null===(I=s.correspondenceAddress)||void 0===I?void 0:I.clandmark,locality:null==s||null===(O=s.correspondenceAddress)||void 0===O||null===(w=O.clocality)||void 0===w?void 0:w.i18nKey,localityCode:null==s||null===(x=s.correspondenceAddress)||void 0===x||null===(L=x.clocality)||void 0===L?void 0:L.code,pincode:null==s||null===(R=s.correspondenceAddress)||void 0===R?void 0:R.cpincode,streetName:"",vendorId:"",isAddressSame:null==s||null===(P=s.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==s||null===(M=s.bankDetails)||void 0===M?void 0:M.accountHolderName,accountNumber:null==s||null===(B=s.bankDetails)||void 0===B?void 0:B.accountNumber,applicationId:"",bankBranchName:null==s||null===(k=s.bankDetails)||void 0===k?void 0:k.bankBranchName,bankName:null==s||null===(F=s.bankDetails)||void 0===F?void 0:F.bankName,id:"",ifscCode:null==s||null===(V=s.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(p),localAuthorityName:null==s||null===(H=s.businessDetails)||void 0===H?void 0:H.nameOfAuthority,tenantId:X,termsAndCondition:"Y",tradeLicenseNo:null==s||null===(W=s.owner)||void 0===W||null===(j=W.units)||void 0===j||null===(z=j[0])||void 0===z?void 0:z.tradeNumber,vendingActivity:null==s||null===(K=s.businessDetails)||void 0===K||null===(G=K.vendingType)||void 0===G?void 0:G.code,vendingArea:(null==s||null===($=s.businessDetails)||void 0===$?void 0:$.areaRequired)||"0",vendingLicenseCertificateId:"",vendingOperationTimeDetails:de,vendingZone:null==s||null===(Y=s.businessDetails)||void 0===Y||null===(q=Y.vendingZones)||void 0===q?void 0:q.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:ce,draftApplication:!0},X).then(e=>{sessionStorage.setItem("Response",JSON.stringify(e))}).catch(e=>{console.log("Something Went Wrong",e)})})()},onSkip:()=>u(),isDisabled:S},null==C||null===(o=C.StreetVending)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(D,{key:t,document:e,t:r,error:E,setError:g,setDocuments:f,documents:p,setCheckRequiredFields:_,formData:s,editdata:c,previousData:m})),E&&l.createElement(t.Toast,{label:E,onClose:()=>g(null),error:!0})))},CheckPage:e=>{var o,a,r,d,u,s,c,m,E,S,y,D,A,C,T,N,I,O,w,x,L,R,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;let{onSubmit:re,editdata:de,value:ue={}}=e;const{t:se}=i.useTranslation(),{owner:ce,businessDetails:ve,address:me,bankdetails:pe,documents:fe,specialCategoryData:Ee}=ue,[ge,Se]=n.useState(!1),he=[{Header:se("SV_WEEK_DAYS"),accessor:"name"},{Header:se("SV_START_TIME"),accessor:"startTime"},{Header:se("SV_END_TIME"),accessor:"endTime"}],ye=(null==ve||null===(o=ve.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 _e=[];if(null!=de&&de.documentDetails&&Array.isArray(null==de?void 0:de.documentDetails)&&(null==de||de.documentDetails.map(e=>{_e.push({...e,module:"StreetVending"})})),_.isEmpty(de)&&null!=fe&&fe.documents&&fe.documents.forEach(e=>{_e.some(t=>t.documentType===e.documentType)||_e.push({...e,module:"StreetVending"})}),_.isEmpty(de)){const e=JSON.parse(sessionStorage.getItem("CategoryDocument"));e&&Array.isArray(e)&&e.forEach(e=>{_e.some(t=>t.documentType===e.documentType)||_e.push({...e,module:"StreetVending"})})}const{data:De}=Digit.Hooks.useDocumentSearch(_e,{enabled:(null==_e?void 0:_e.length)>0});let be=[];var Ae;return(null==De||null===(a=De.pdfFiles)||void 0===a?void 0:a.length)>0&&(null==De||null===(Ae=De.pdfFiles)||void 0===Ae||Ae.map(e=>{"StreetVending"==(null==e?void 0:e.module)&&be.push(e)})),l.createElement(l.Fragment,null,l.createElement(v,{currentStep:7}),l.createElement(t.Card,null,l.createElement(t.CardHeader,null,se("SV_SUMMARY_PAGE")),l.createElement("div",null,l.createElement(t.CardSubHeader,null,se("SV_VENDOR_PERSONAL_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:se("SV_VENDOR_NAME"),text:""+se(p(null==ce||null===(r=ce.units)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.vendorName)),actionButton:l.createElement(b,{jumpTo:"/digit-ui/citizen/sv/apply/applicant-details"})}),l.createElement(t.Row,{label:se("SV_REGISTERED_MOB_NUMBER"),text:""+se(p(null==ce||null===(u=ce.units)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.mobileNumber))}),l.createElement(t.Row,{label:se("SV_DATE_OF_BIRTH"),text:""+se(p(null==ce||null===(c=ce.units)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.vendorDateOfBirth))}),l.createElement(t.Row,{label:se("SV_GENDER"),text:""+se(p(null==ce||null===(E=ce.units)||void 0===E||null===(S=E[0])||void 0===S||null===(y=S.gender)||void 0===y?void 0:y.code))}),l.createElement(t.Row,{label:se("SV_FATHER_NAME"),text:""+se(p(null==ce||null===(D=ce.units)||void 0===D||null===(A=D[0])||void 0===A?void 0:A.fatherName))}),null!=ce&&null!==(C=ce.units)&&void 0!==C&&null!==(T=C[0])&&void 0!==T&&T.email?l.createElement(t.Row,{label:se("SV_EMAIL"),text:""+se(p(null==ce||null===(N=ce.units)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.email))}):null,(null==ce||null===(O=ce.units)||void 0===O||null===(w=O[0])||void 0===w?void 0:w.spouseName)&&l.createElement(t.Row,{label:se("SV_SPOUSE_NAME"),text:l.createElement("span",null,se(p(null==ce||null===(x=ce.units)||void 0===x||null===(L=x[0])||void 0===L?void 0:L.spouseName))," ",l.createElement("span",{className:"astericColor"},"(",se(null!=ce&&ce.spouseDependentChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ce&&null!==(R=ce.units)&&void 0!==R&&null!==(P=R[0])&&void 0!==P&&P.spouseDateBirth?l.createElement(t.Row,{label:se("SV_SPOUSE_DATE_OF_BIRTH"),text:""+se(p(null==ce||null===(M=ce.units)||void 0===M||null===(B=M[0])||void 0===B?void 0:B.spouseDateBirth))}):null,(null==ce||null===(k=ce.units)||void 0===k||null===(F=k[0])||void 0===F?void 0:F.dependentName)&&l.createElement(t.Row,{label:se("SV_DEPENDENT_NAME"),text:l.createElement("span",null,se(p(null==ce||null===(V=ce.units)||void 0===V||null===(U=V[0])||void 0===U?void 0:U.dependentName))," ",l.createElement("span",{className:"astericColor"},"(",se(null!=ce&&ce.dependentNameChecked?"INVOLVED":"NOT INVOLVED"),")"))}),null!=ce&&null!==(H=ce.units)&&void 0!==H&&null!==(W=H[0])&&void 0!==W&&W.dependentDateBirth?l.createElement(t.Row,{label:se("SV_DEPENDENT_DATE_OF_BIRTH"),text:""+se(p(null==ce||null===(j=ce.units)||void 0===j||null===(z=j[0])||void 0===z?void 0:z.dependentDateBirth))}):null,null!=ce&&null!==(K=ce.units)&&void 0!==K&&null!==(G=K[0])&&void 0!==G&&G.dependentGender?l.createElement(t.Row,{label:se("SV_DEPENDENT_GENDER"),text:""+se(p(null==ce||null===($=ce.units)||void 0===$||null===(Y=$[0])||void 0===Y||null===(q=Y.dependentGender)||void 0===q?void 0:q.code))}):null,null!=ce&&null!==(Z=ce.units)&&void 0!==Z&&null!==(X=Z[0])&&void 0!==X&&X.dependentGender?l.createElement(t.Row,{label:se("SV_TRADE_NUMBER"),text:""+se(p(null==ce||null===(J=ce.units)||void 0===J||null===(Q=J[0])||void 0===Q?void 0:Q.tradeNumber))}):null),l.createElement(t.CardSubHeader,null,se("SV_VENDOR_BUSINESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:se("SV_VENDING_TYPE"),text:""+se(p(null==ve||null===(ee=ve.vendingType)||void 0===ee?void 0:ee.code)),actionButton:l.createElement(b,{jumpTo:"/digit-ui/citizen/sv/apply/business-details"})}),l.createElement(t.Row,{label:se("SV_VENDING_ZONES"),text:""+se(p(null==ve||null===(te=ve.vendingZones)||void 0===te?void 0:te.value))}),l.createElement(t.Row,{label:se("SV_AREA_REQUIRED"),text:""+se(p(null==ve?void 0:ve.areaRequired))}),l.createElement(t.Row,{label:se("SV_LOCAL_AUTHORITY_NAME"),text:""+se(p(null==ve?void 0:ve.nameOfAuthority))}),null!=ve&&ve.vendingLiscence?l.createElement(t.Row,{label:se("SV_VENDING_LISCENCE"),text:""+se(p(null==ve?void 0:ve.vendingLiscence))}):null,l.createElement("span",{style:{marginTop:"5px",fontSize:"18px",fontWeight:"bold"}},se("SV_DAY_HOUR_OPERATION")),l.createElement(h,{t:se,data:ye,columns:he,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:ye.length})),(null==pe?void 0:pe.accountNumber)&&(null==pe?void 0:pe.ifscCode)&&(null==pe?void 0:pe.bankName)&&(null==pe?void 0:pe.bankBranchName)&&(null==pe?void 0:pe.accountHolderName)&&l.createElement(l.Fragment,null,l.createElement(t.CardSubHeader,null,se("SV_BANK_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:se("SV_ACCOUNT_NUMBER"),text:""+se(p(null==pe?void 0:pe.accountNumber)),actionButton:l.createElement(b,{jumpTo:"/digit-ui/citizen/sv/apply/bank-details"})}),l.createElement(t.Row,{label:se("SV_IFSC_CODE"),text:""+se(p(null==pe?void 0:pe.ifscCode))}),l.createElement(t.Row,{label:se("SV_BANK_NAME"),text:""+se(p(null==pe?void 0:pe.bankName))}),l.createElement(t.Row,{label:se("SV_BANK_BRANCH_NAME"),text:""+se(p(null==pe?void 0:pe.bankBranchName))}),l.createElement(t.Row,{label:se("SV_ACCOUNT_HOLDER_NAME"),text:""+se(p(null==pe?void 0:pe.accountHolderName))}))),l.createElement(t.CardSubHeader,null,se("SV_ADDRESS_DETAILS")),l.createElement(t.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},l.createElement(t.Row,{label:se("SV_ADDRESS_LINE1"),text:""+se(p(null==me?void 0:me.addressline1)),actionButton:l.createElement(b,{jumpTo:"/digit-ui/citizen/sv/apply/address-details"})}),l.createElement(t.Row,{label:se("SV_ADDRESS_LINE2"),text:""+se(p(null==me?void 0:me.addressline2))}),l.createElement(t.Row,{label:se("SV_CITY"),text:""+se(p(null==me||null===(ne=me.city)||void 0===ne||null===(le=ne.city)||void 0===le?void 0:le.name))}),l.createElement(t.Row,{label:se("SV_LOCALITY"),text:""+se(p(null==me||null===(ie=me.locality)||void 0===ie?void 0:ie.i18nKey))}),null!=me&&me.pincode?l.createElement(t.Row,{label:se("SV_ADDRESS_PINCODE"),text:""+se(p(null==me?void 0:me.pincode))}):null,null!=me&&me.landmark?l.createElement(t.Row,{label:se("SV_LANDMARK"),text:""+se(p(null==me?void 0:me.landmark))}):null),l.createElement(t.CardSubHeader,null,se("SV_ADDITIONAL_DETAILS")),l.createElement(t.StatusTable,{style:{marginBottom:"30px"}},l.createElement(t.Row,{label:se("SV_CATEGORY"),text:""+se(p(null==Ee||null===(oe=Ee.ownerCategory)||void 0===oe?void 0:oe.value)),actionButton:l.createElement(b,{jumpTo:"/digit-ui/citizen/sv/apply/special-category"})}),null!==(null==Ee?void 0:Ee.beneficiary)?l.createElement(t.Row,{label:se("SV_BENEFICIARY_SCHEMES"),text:""+se(p(null==Ee||null===(ae=Ee.beneficiary)||void 0===ae?void 0:ae.value))}):null,null!==(null==Ee?void 0:Ee.enrollmentId)?l.createElement(t.Row,{label:se("SV_ENROLLMENT_APPLICATION_NUMBER"),text:""+se(p(null==Ee?void 0:Ee.enrollmentId))}):null),l.createElement(t.CardSubHeader,null,se("SV_DOCUMENT_DETAILS_LABEL")),l.createElement(g,{documents:f(be),svgStyles:{},isSendBackFlow:!1,titleStyles:{fontSize:"18px",fontWeight:700,marginBottom:"10px"}}),l.createElement("br",null),l.createElement(t.CheckBox,{label:se("SV_FINAL_DECLARATION_MESSAGE"),onChange:()=>{Se(!ge)},styles:{height:"auto",marginBottom:"30px",marginTop:"10px"}})),l.createElement(t.SubmitBar,{label:se("SV_COMMON_BUTTON_SUBMIT"),onSubmit:re,disabled:!ge})))},SVEmpCreate:e=>{var t,n,r,u;const s=a.useQueryClient(),c=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:m}=o.useLocation(),p=o.useHistory();Digit.ULBService.getStateId();let f=[];const[E,g,S]=Digit.Hooks.useSessionStorage("SV_EMP_CREATES",{});function h(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=E.owners||[];n[l]=t,g({...E,[e]:[...n]})}else if("units"===e){let e=E.units||[];e=t,g({...E,units:e})}else g({...E,[e]:{...E[e],...t}});((e,t,n,l)=>{let i,o=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:d={}}=f.find(e=>e.route===o),u=p.push;if(e&&(u=p.replace),n&&(d=l),null===d)return u(c.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?`${c.path}/${d}/${t}`:`${c.path}/${d}`,u(i)})(n,l,i,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(S(),s.invalidateQueries("SV_EMP_CREATE"));const y=()=>{},_=()=>{};d.forEach(e=>{f=f.concat(e.body.filter(e=>!e.hideInCitizen))}),f.indexRoute="info";const D=null===(t=Digit)||void 0===t||null===(n=t.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CheckPage"),b=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("SVAcknowledgement");return l.createElement(o.Switch,null,f.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:`${c.path}/${e.route}`,key:t},l.createElement(d,{config:{texts:i,inputs:a,key:r},onSelect:h,onSkip:y,t:v,formData:E,onAdd:_,userType:u}))}),l.createElement(o.Route,{path:c.path+"/check"},l.createElement(D,{onSubmit:function(){try{return p.replace(c.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(o.Route,{path:c.path+"/acknowledgement"},l.createElement(b,{data:E,onSuccess:()=>{S(),s.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:`${c.path}/${f.indexRoute}`})))},SVAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:d}=i.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.sv.useSvCreateApi(u,!window.location.href.includes("edit")),c=Digit.UserService.getUser().info,{data:v}=Digit.Hooks.useStore.getInitData(),{tenants:m}=v||{};return n.useEffect(()=>{try{a.tenantId=u;let e=window.location.href.includes("edit")?(e=>{var t,n,l,i,o,a,r,d,u,s,c,v,m,p,f,g,S,h,y,_,D,b,A,C,T,N,I,O,w,x,L,R,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,_,D,b,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===(D=_[0])||void 0===D?void 0:D.mobileNumber,name:null==e||null===(b=e.owner)||void 0===b||null===(A=b.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===(g=f.locality)||void 0===g?void 0:g.i18nKey,localityCode:null==e||null===(S=e.address)||void 0===S||null===(h=S.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===(D=e.correspondenceAddress)||void 0===D?void 0:D.caddressline2,addressType:"CORRESPONDENCE",city:(null==e||null===(b=e.correspondenceAddress)||void 0===b||null===(A=b.ccity)||void 0===A?void 0:A.name)||(null==e||null===(C=e.correspondenceAddress)||void 0===C||null===(T=C.ccity)||void 0===T?void 0:T.code),cityCode:null==e||null===(N=e.correspondenceAddress)||void 0===N||null===(I=N.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===(L=x.clocality)||void 0===L?void 0:L.i18nKey,localityCode:null==e||null===(R=e.correspondenceAddress)||void 0===R||null===(P=R.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:E(null==e||null===($=e.documents)||void 0===$?void 0:$.documents),localAuthorityName:null==e||null===(Y=e.businessDetails)||void 0===Y?void 0:Y.nameOfAuthority,tenantId:null==e?void 0:e.tenantId,termsAndCondition:"Y",tradeLicenseNo:null==e||null===(q=e.owner)||void 0===q||null===(Z=q.units)||void 0===Z||null===(X=Z[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,g,S,h,y,_,D,b,A,C,T,N,I,O,w,x,L,R,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,_,D,b,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===(D=_[0])||void 0===D?void 0:D.mobileNumber,name:null==e||null===(b=e.owner)||void 0===b||null===(A=b.units)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.vendorName,relationshipType:"VENDOR",vendorId:null}},De=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}},be=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,Te,Ne,Ie,Oe,we;const t=null==e||null===(Ce=e.owner)||void 0===Ce||null===(Te=Ce.units)||void 0===Te||null===(Ne=Te[0])||void 0===Ne?void 0:Ne.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),De(e)]:Ae(t)||Ae(n)||(ye=[_e(e),De(e),be(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:""})),Le=sessionStorage.getItem("Response"),Re=Le?JSON.parse(Le):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==Re||null===(f=Re.SVDetail)||void 0===f||null===(g=f[0])||void 0===g||null===(S=g.addressDetails)||void 0===S||null===(h=S[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==Re||null===(D=Re.SVDetail)||void 0===D||null===(b=D[0])||void 0===b||null===(A=b.addressDetails)||void 0===A||null===(C=A[0])||void 0===C?void 0:C.localityCode)||(null==e||null===(T=e.address)||void 0===T||null===(N=T.locality)||void 0===N?void 0:N.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===(L=x.ccity)||void 0===L?void 0:L.name)||(null==e||null===(R=e.correspondenceAddress)||void 0===R||null===(P=R.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==Re||null===(V=Re.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==Re||null===(K=Re.SVDetail)||void 0===K||null===(G=K[0])||void 0===G||null===($=G.addressDetails)||void 0===$||null===(Y=$[1])||void 0===Y?void 0:Y.localityCode)||(null==e||null===(q=e.correspondenceAddress)||void 0===q||null===(Z=q.clocality)||void 0===Z?void 0:Z.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==Re||null===(ue=Re.SVDetail)||void 0===ue?void 0:ue.draftId)||"",documentDetails:E(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);s.mutate(e,{onSuccess:r})}catch(e){}},[]),s.isLoading||s.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement($,{t:d,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),l.createElement(t.StatusTable,null,s.isSuccess&&l.createElement(t.Row,{rowContainerStyle:G,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&l.createElement(t.SubmitBar,{label:d("SV_ACKNOWLEDGEMENT"),onSubmit:function(){try{const{SVDetail:e=[]}=s.data;let t=e||{};const n=m.find(e=>e.code===t.tenantId);return Promise.resolve(z({...t},n,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},SVApplicationDetails:ml,SVMyApplications:()=>{var e,a;const{t:r}=i.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),u=Digit.UserService.getUser().info,[s,c]=n.useState(""),[v,m]=n.useState(""),[p,f]=n.useState(null),[E,g]=n.useState([]);let S,h=window.location.href.split("/").pop();S=isNaN(parseInt(h))?4:parseInt(h)+50;let y={limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:d,isDraftApplication:!1,mobileNumber:null==u?void 0:u.mobileNumber};n.useEffect(()=>{f(y)},[h]);const{isLoading:_,data:D}=Digit.Hooks.sv.useSvSearchApplication({filters:{...p,isDraftApplication:!1}}),{isLoading:b,data:A}=Digit.Hooks.sv.useSvSearchApplication({filters:{...p,isDraftApplication:!0,sortOrder:"DESC"}}),C=null==A||null===(e=A.SVDetail)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.draftId;n.useEffect(()=>{null!=A&&A.SVDetail&&null!=D&&D.SVDetail&&g([...A.SVDetail||[],...D.SVDetail||[]])},[A,D]);const T=e=>{g(t=>t.filter(t=>t!==e))};return _||b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,`${r("SV_MY_APPLICATIONS")} ${E?`(${E.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:s,onChange:e=>c(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:v,onChange:e=>m(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=s.trim(),t={...y,applicationNumber:e||null,mobileNumber:v||null};f(t)}}),l.createElement("p",{className:"link svclearall",onClick:()=>{c(""),m("")}},r("ES_COMMON_CLEAR_ALL"))))))),l.createElement("div",null,(null==E?void 0:E.length)>0&&E.map((e,t)=>l.createElement("div",{key:t},l.createElement(pl,{application:e,tenantId:null==u?void 0:u.permanentCity,buttonLabel:r("SV_TRACK"),previousDraftId:C,onDiscard:T}))),!(null!=E&&E.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r("SV_NO_APPLICATION_FOUND_MSG")),0!==(null==E?void 0:E.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/"+S},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,d,u,s,c,v,m,p,f,E,g,S,h,y,_,D,b,A,C,T;const{t:N}=i.useTranslation(),{applicationNo:I,tenantId:O}=o.useParams(),[w,x]=n.useState(!1),[L,R]=n.useState(!1),[P,M]=n.useState(null),{data:B}=Digit.Hooks.useStore.getInitData(),{tenants:k}=B||{},{isLoading:F,data:V}=Digit.Hooks.sv.useSvSearchApplication({tenantId:O,filters:{applicationNumber:I,isDraftApplication:!1}}),[U,H]=n.useState(null),W=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return dt(e)?e:function(e,t){if(dt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!gl(e))||hl.test(e)||!Sl.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Cl(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(dt(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(gl(t))return Nl?Nl.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[Il(t[n++])];return n&&n==l?e:void 0}(e,"SVDetail");return void 0===l?[]:l}(V);let j=W&&W.length>0&&W[0]||{};const K=j;sessionStorage.setItem("streetvending",JSON.stringify(K));const[G,$]=n.useState(!1);n.useEffect(()=>{!function(){try{$(!0),Promise.resolve(Digit.PaymentService.fetchBill(O,{businessService:"sv-services",consumerCode:I})).then(function(e){H(e),$(!1)})}catch(e){return Promise.reject(e)}}()},[O,I]);const{data:Y,isLoading:q}=Digit.Hooks.useRecieptSearch({tenantId:O,businessService:"sv-services",consumerCodes:I,isEmployee:!1},{enabled:!!I});if(j.workflow||(j.workflow={id:null,tenantId:O,businessService:"street-vending",businessId:null==K?void 0:K.applicationNo,action:"",moduleName:"sv-services",state:null,comment:null,documents:null,assignes:null}),F)return l.createElement(t.Loader,null);let Z=[];return Z.push({label:N("SV_ACKNOWLEDGEMENT"),onClick:()=>function(){try{const e=K||{},t=k.find(t=>t.code===e.tenantId);return Promise.resolve(z({...e},t,N)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&Z.push({label:N("SV_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...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==Y||null===(e=Y.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Y?void 0:Y.Payments[0]})}}),Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&Z.push({label:N("SV_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(O,{SVDetail:[null==V||null===(e=V.SVDetail)||void 0===e?void 0:e[0]]},"svcertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(O,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&Z.push({label:N("SV_ID_CARD"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(O,{SVDetail:[null==V||null===(e=V.SVDetail)||void 0===e?void 0:e[0]]},"svidentitycard")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(O,{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"}},N("SV_APPLICATION_DETAILS")),Z&&Z.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>x(!w),displayOptions:w,options:Z})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("SV_APPLICATION_NUMBER"),text:null==j?void 0:j.applicationNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},N("SV_VENDOR_PERSONAL_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("SV_VENDOR_NAME"),text:(null==j||null===(e=j.vendorDetail)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.name)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_FATHER_NAME"),text:(null==j||null===(r=j.vendorDetail)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.fatherName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_REGISTERED_MOB_NUMBER"),text:(null==j||null===(u=j.vendorDetail)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.mobileNo)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_DATE_OF_BIRTH"),text:(null==j||null===(c=j.vendorDetail)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.dob)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_EMAIL"),text:(null==j||null===(m=j.vendorDetail)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.emailId)||N("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},N("SV_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("SV_HOUSE_NO"),text:(null==j||null===(f=j.addressDetails)||void 0===f||null===(E=f[0])||void 0===E?void 0:E.houseNo)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_ADDRESS_LINE1"),text:(null==j||null===(g=j.addressDetails)||void 0===g||null===(S=g[0])||void 0===S?void 0:S.addressLine1)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_ADDRESS_LINE2"),text:(null==j||null===(h=j.addressDetails)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.addressLine2)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_ADDRESS_PINCODE"),text:(null==j||null===(_=j.addressDetails)||void 0===_||null===(D=_[0])||void 0===D?void 0:D.pincode)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_CITY"),text:(null==j||null===(b=j.addressDetails)||void 0===b||null===(A=b[0])||void 0===A?void 0:A.city)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_LOCALITY"),text:(null==j||null===(C=j.addressDetails)||void 0===C||null===(T=C[0])||void 0===T?void 0:T.locality)||N("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},N("SV_VENDOR_BUSINESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("SV_VENDING_ZONES"),text:(null==j?void 0:j.vendingZone)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_VENDING_TYPE"),text:(null==j?void 0:j.vendingActivity)||N("CS_NA")}),"STATIONARY"===(null==j?void 0:j.vendingActivity)&&l.createElement(t.Row,{className:"border-none",label:N("SV_AREA_REQUIRED"),text:(null==j?void 0:j.vendingArea)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_LOCAL_AUTHORITY_NAME"),text:(null==j?void 0:j.localAuthorityName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_BENEFICIARY_SCHEMES"),text:(null==j?void 0:j.benificiaryOfSocialSchemes)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("SV_CATEGORY"),text:(null==j?void 0:j.disabilityStatus)||N("CS_NA")})),l.createElement(El,{application:K,id:null==K?void 0:K.applicationNo,userType:"citizen"}),P&&l.createElement(t.Toast,{error:P.key,label:N(P.label),style:{bottom:"0px"},onClose:()=>{M(null)}})),L&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:R,setShowToast:M,data:V})))},Caption:fl,ViewTimeline:El,SVSpecialCategory:e=>{var i,o,a,d,u,c,m;let{t:p,config:f,onSelect:g,userType:S,formData:h,editdata:y,previousData:_}=e;const D=Digit.UserService.getUser().info,b=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)||b((null==_?void 0:_.disabilityStatus)||(null==y?void 0:y.disabilityStatus))||""),[T,N]=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)||b((null==_?void 0:_.benificiaryOfSocialSchemes)||(null==y?void 0:y.benificiaryOfSocialSchemes))||""),w={width:"EMPLOYEE"===D.type?"50%":"100%"},[x,L]=n.useState(null),R=null==_||null===(d=_.documentDetails)||void 0===d?void 0:d.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===(u=y.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)}),[M,B]=n.useState((null==R?void 0:R.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===(m=_.draftId)||void 0===m?void 0:m.length)>0||null!=y&&y.applicationNo)&&sessionStorage.setItem("CategoryDocument",JSON.stringify([{documentType:(null==_?void 0:_.disabilityStatus)||(null==y?void 0:y.disabilityStatus),documentUid:(null==R?void 0:R.fileStoreId)||(null==P?void 0:P.fileStoreId),fileStoreId:(null==R?void 0:R.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(p("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(p("CS_FILE_UPLOAD_ERROR"))}).catch(()=>setError(p("CS_FILE_UPLOAD_ERROR"))).finally(()=>{F(!1)})))},[x,p]);const G=()=>{let e={...h.specialCategoryData,ownerCategory:A,beneficiary:I,uploadedFile:M,enrollmentId:T};g(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,g,S,y,D,b,C,N,O,w,x,L,R,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,_,D,b;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===(D=_.units)||void 0===D||null===(b=D[0])||void 0===b?void 0:b.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===(g=h.address)||void 0===g?void 0:g.pincode,streetName:"",vendorId:""},{addressId:"",addressLine1:null==h||null===(S=h.correspondenceAddress)||void 0===S?void 0:S.caddressline1,addressLine2:null==h||null===(y=h.correspondenceAddress)||void 0===y?void 0:y.caddressline2,addressType:"",city:null==h||null===(D=h.correspondenceAddress)||void 0===D||null===(b=D.ccity)||void 0===b?void 0:b.name,cityCode:null==h||null===(C=h.correspondenceAddress)||void 0===C||null===(N=C.ccity)||void 0===N?void 0:N.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===(L=x.clocality)||void 0===L?void 0:L.i18nKey,localityCode:null==h||null===(R=h.correspondenceAddress)||void 0===R||null===(P=R.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:T,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:E(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===($=G[0])||void 0===$?void 0:$.tradeNumber,vendingActivity:null==h||null===(Y=h.businessDetails)||void 0===Y||null===(q=Y.vendingType)||void 0===q?void 0:q.code,vendingArea:(null==h||null===(Z=h.businessDetails)||void 0===Z?void 0:Z.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"===S&&G()},[A,I]);const $=()=>l.createElement("div",{className:"loading-spinner"});return l.createElement(l.Fragment,null,l.createElement(v,{currentStep:6}),l.createElement("div",null,l.createElement(t.FormStep,{config:f,onSelect:G,onSkip:()=>g(),t:p,isDisabled:!A},l.createElement("div",null,l.createElement(t.CardLabel,null,""+p("SV_CATEGORY")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(r.Controller,{control:H,name:"ownerCategory",defaultValue:A,rules:{required:p("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:A,select:C,option:j,style:w,optionKey:"i18nKey",t:p,placeholder:"Select"})}),A&&"NONE"!==(null==A?void 0:A.code)&&l.createElement("div",{className:"field",style:{marginRight:"EMPLOYEE"===(null==D?void 0:D.type)?"50%":null,marginBottom:"10px"}},l.createElement(t.UploadFile,{onUpload:e=>{L(e.target.files[0])},onDelete:()=>{B(null)},id:"SV",message:k?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement($,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,""+p("SV_BENEFICIARY_SCHEMES")),l.createElement(r.Controller,{control:H,name:"beneficiary",defaultValue:I,rules:{required:p("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:p,placeholder:"Select"})}),I&&l.createElement(l.Fragment,null,l.createElement(t.CardLabel,null,""+p("SV_ENROLLMENT_APPLICATION_NUMBER")),l.createElement(t.TextInput,s({t:p,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"enrollmentId",value:T,onChange:function(e){N(e.target.value)},style:w,ValidationRequired:!1},{isRequired:!1,pattern:"^[a-zA-Z0-9-/ ]*$",type:"text",title:p("SV_INPUT_DID_NOT_MATCH")}))))),V&&l.createElement(t.Toast,{error:V.error,warning:V.warning,label:p(V.label),onClose:()=>{U(null)}})))}},wl=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:d}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"SV",language:s}),Object.entries(Ol).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(P,{path:r,url:d,userType:i}):l.createElement(u,null)},xl=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:wl,SVLinks:xl,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(W,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 B(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 M(""+(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 B(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 M(""+(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 B(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 M(""+(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 B(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 M(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 B(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=xl,exports.SVModule=wl;