@djb25/digit-ui-module-wt 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +452 -287
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var l=require("@djb25/digit-ui-react-components"),n=require("react"),i=e(n),o=require("react-i18next"),a=require("react-router-dom"),r=require("react-query"),u=require("react-hook-form"),d=require("socket.io-client"),s=require("react-leaflet"),c=e(require("leaflet"));require("leaflet/dist/leaflet.css");const m=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"service-type",component:"ServiceTypes",withoutLabel:!0,key:"serviceType",type:"component",nextStep:"info",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT"}},{route:"info",component:"InfoPage",nextStep:"applicant-details",key:"infodetails"},{route:"applicant-details",component:"ApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_APPLICANT_DETAILS"},timeLine:[{currentStep:1,actions:"ES_APPLICANT_DETAILS"}]}]},{head:"ES_TITLE_ADDRESS_DETAILS",body:[{route:"address-details",component:"AddressDetails",withoutLabel:!0,key:"address",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"request-details",texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_ADDRESS_DETAILS"},timeLine:[{currentStep:2,actions:"ES_ADDRESS_DETAILS"}]}]},{head:"ES_REQUEST_DETAILS",body:[{route:"request-details",component:"RequestDetails",withoutLabel:!0,key:"requestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"WT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_REQUEST_DETAILS"}]}]},{head:"ES_TOILET_REQUEST_DETAILS",body:[{route:"toiletRequest-details",component:"ToiletRequestDetails",withoutLabel:!0,key:"toiletRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"MT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TOILET_REQUEST_DETAILS"}]}]},{head:"ES_TREE_PRUNING_REQUEST_DETAILS",body:[{route:"treePruningRequest-details",component:"TreePruningRequestDetails",withoutLabel:!0,key:"treePruningRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"TP_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TREE_PRUNING_REQUEST_DETAILS"}]}]}],v=e=>{let{config:t,showFinalStep:n,...r}=e;const{t:u}=o.useTranslation(),d=a.useLocation().pathname.split("/").pop();if("info"===d)return null;const s=t.filter(e=>e.timeLine&&e.timeLine.length>0).reduce((e,t)=>{const l=t.timeLine[0],n=e.findIndex(e=>e.key===l.currentStep);return-1===n?e.push({key:l.currentStep,label:l.actions,routes:[t.route],stepNumber:l.currentStep}):e[n].routes.push(t.route),e},[]).sort((e,t)=>e.stepNumber-t.stepNumber);n&&s.push({key:"final-submit",label:"Review & Submit",routes:["check","wt-acknowledgement","mt-acknowledgement","tp-acknowledgement"],stepNumber:s.length+1});const c=s.findIndex(e=>e.routes.includes(d)),m=-1!==c?c:0;return i.createElement(i.Fragment,null,i.createElement("div",{className:"vertical-timeline-container"},i.createElement("div",{className:"vertical-timeline-wrapper"},s.map((e,t)=>{const n=t<m;return i.createElement("div",{key:t,className:`vertical-timeline-step ${n?"completed":""} ${t===m?"activeTimeline active":""}`,onClick:()=>{}},i.createElement("div",{className:"vertical-timeline-connector "+(t<m?"completed":"")}),i.createElement("div",{className:"vertical-timeline-pill"},n?i.createElement(l.TickMark,null):e.stepNumber),i.createElement("div",{className:"vertical-timeline-content"},i.createElement("div",{className:"vertical-timeline-label"},u(e.label))))}))))};function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}const E=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},f=e=>{if(!e)return"NA";const[t,l]=e.split(":").map(Number),n=t>=12?"PM":"AM";return`${t%12||12}:${l.toString().padStart(2,"0")} ${n}`},g=e=>{if(!e)return"NA";const[t,l,n]=e.split("-");return`${n}-${l}-${t}`},h=e=>{let{number:t,title:o,children:a,defaultOpen:r=!1,tabs:u=null,defaultTab:d="",onTabChange:s=(()=>{})}=e;const[c,m]=n.useState(r),[v,p]=n.useState(d||u&&u[0]||"");return i.createElement("div",{className:"collapsible-card"},i.createElement("div",{className:"collapsible-card-header",onClick:()=>m(!c)},i.createElement("h3",{className:"collapsible-card-title"},t?t+". ":"",o),i.createElement("span",{className:"collapsible-card-arrow "+(c?"rotate":"")},i.createElement(l.ArrowDown,null))),c&&i.createElement("div",{className:"collapsible-card-body"},u&&i.createElement("div",{className:"collapsible-card-tabs"},u.map((e,t)=>i.createElement("button",{key:t,onClick:()=>(e=>{p(e),s(e)})(e),className:"collapsible-card-tab-button "+(v===e?"active":"")},e))),i.createElement("div",{className:"collapsible-card-tab-content"},u?i.createElement("div",{key:v},a(v)):i.createElement("div",null,a))))},S=e=>{let{isLoading:t,t:o,onSubmit:r,data:d,count:s,setShowToast:c,moduleCode:m}=e;const v=window.Digit.Utils.browser.isMobile(),p=Digit.UserService.getUser().info,E={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},{register:f,control:g,handleSubmit:_,setValue:S,getValues:T,reset:b,formState:y,watch:N}=u.useForm({defaultValues:E}),C=N("fromDate"),A=e=>i.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:o("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;const l=t.original.bookingNo;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:`/digit-ui/${"EMPLOYEE"===p.type?"employee":"citizen"}/wt/bookingsearch/booking-details/${l}`},l)))}},{Header:o("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return A(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:o("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return A(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:o("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return A(o(t.original.bookingStatus))}}],[o,p.type]),D="TP"===m?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:o("TP_BOOKING_CREATED")},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:o("TP_PENDING_FOR_APPROVAL")},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:o("TP_PAYMENT_PENDING")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:o("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:o("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:o("TP_TREE_PRUNING_SERVICE_COMPLETED")}]:[{i18nKey:"WT_BOOKING_CREATED",code:"BOOKING_CREATED",value:o("WT_BOOKING_CREATED")},{i18nKey:"WT_VENDOR_ASSIGNED",code:"VENDOR_ASSIGNED",value:o("WT_VENDOR_ASSIGNED")},{i18nKey:"WT_DELIVERY_PENDING",code:"DELIVERY_PENDING",value:o("WT_DELIVERY_PENDING")},{i18nKey:"WT_DELIVERED",code:"DELIVERED",value:o("WT_DELIVERED")},{i18nKey:"WT_REQUEST_REJECTED",code:"REQUEST_REJECTED",value:o("WT_REQUEST_REJECTED")}],x=n.useCallback(e=>{0!==e.length&&(S("sortBy",e.id),S("sortOrder",e.desc?"DESC":"ASC"))},[S]),O=()=>{b(E),c(null),_(r)()};return i.createElement(i.Fragment,null,i.createElement("div",{className:"CITIZEN"===(null==p?void 0:p.type)?"citizen-wrapper":"employee-wrapper"},i.createElement(h,{title:o("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[o("WT_SMART_SEARCH"),o("WT_ADVANCED_SEARCH")],defaultTab:o("WT_SMART_SEARCH")},e=>{var t,n,a,d;return i.createElement("form",{onSubmit:_(r)},e===o("WT_SMART_SEARCH")&&i.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:v?"1fr":"1fr 1fr",gap:"24px"}},i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_MOBILE_NUMBER")),i.createElement(l.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:o("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),i.createElement(l.CardLabelError,null,null==y||null===(t=y.errors)||void 0===t||null===(n=t.mobileNumber)||void 0===n?void 0:n.message))),e===o("WT_ADVANCED_SEARCH")&&i.createElement("div",{className:"formcomposer-section-grid"},i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_BOOKING_NO")),i.createElement(l.TextInput,{name:"bookingNo",inputRef:f({})})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_APPLICANT_NAME")),i.createElement(l.TextInput,{name:"applicantName",inputRef:f({})})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_MOBILE_NUMBER")),i.createElement(l.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:o("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),i.createElement(l.CardLabelError,null,null==y||null===(a=y.errors)||void 0===a||null===(d=a.mobileNumber)||void 0===d?void 0:d.message)),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("PT_COMMON_TABLE_COL_STATUS_LABEL")),i.createElement(u.Controller,{control:g,name:"status",render:e=>i.createElement(l.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:D,optionKey:"i18nKey",t:o})})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("FROM_DATE")),i.createElement(u.Controller,{render:e=>i.createElement(l.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:g})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("TO_DATE")),i.createElement(u.Controller,{render:e=>i.createElement(l.DatePicker,{date:e.value,onChange:e.onChange,min:C}),name:"toDate",control:g}))),i.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:v?"center":"flex-end",flexDirection:v?"column-reverse":"row",gap:"24px",marginTop:"16px"}},i.createElement("span",{className:"generic-button clear-search",onClick:O,style:{cursor:"pointer",alignSelf:"center"}},o("ES_COMMON_CLEAR_ALL")),i.createElement("div",{style:{minWidth:v?"100%":"160px"}},i.createElement(l.SubmitBar,{label:o("ES_COMMON_SEARCH"),submit:!0}))))}),!t&&null!=d&&d.display?i.createElement(l.Card,{style:{marginTop:20}},o(d.display).split("\\n").map((e,t)=>i.createElement("p",{key:t,style:{textAlign:"center"}},e))):t||""===d?(""!==d||t)&&i.createElement(l.Loader,null):i.createElement(l.Table,{t:o,data:d,totalRecords:s,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===o("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{S("limit",Number(e.target.value)),_(r)()},currentPage:T("offset")/T("limit"),onNextPage:()=>{S("offset",T("offset")+T("limit")),_(r)()},onPrevPage:()=>{const e=T("offset"),t=T("limit");e-t>=0&&(S("offset",e-t),_(r)())},pageSizeLimit:T("limit"),onSort:x,disableSort:!1,sortParams:[{id:T("sortBy"),desc:"DESC"===T("sortOrder")}]})))},T=e=>{let{moduleCode:t}=e;const{t:a}=o.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[u,d]=n.useState({}),[s,c]=n.useState(null);n.useEffect(()=>{if(s){const e=setTimeout(()=>{c(null)},1e3);return()=>clearTimeout(e)}},[s]);const m={enabled:!!(u&&Object.keys(u).length>0)};let v=[],p=0,E=!1,f=!1,g=!1,_=null;return"WT"===t?({isLoading:E,isSuccess:f,isError:g,error:_,data:{waterTankerBookingDetail:v=[],count:p=0}={}}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:r,filters:u},m)):"MT"===t?({isLoading:E,isSuccess:f,isError:g,error:_,data:{mobileToiletBookingDetails:v=[],Count:p=0}={}}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:r,filters:u},m)):"TP"===t&&({isLoading:E,isSuccess:f,isError:g,error:_,data:{treePruningBookingDetails:v=[],Count:p=0}={}}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:r,filters:u},m)),i.createElement(i.Fragment,null,i.createElement(S,{t:a,isLoading:E,tenantId:r,setShowToast:c,onSubmit:function(e){const{fromDate:t,toDate:l}=e,n={...e,...l?{toDate:l}:{},...t?{fromDate:t}:{}};let i=Object.keys(n).filter(e=>n[e]).reduce((e,t)=>({...e,[t]:"object"==typeof n[t]?n[t].code:n[t]}),{});!(Object.keys(i).length>0)||i.bookingNo||i.fromDate||i.status||i.toDate||i.mobileNumber?i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?c({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):d(i):c({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:f&&!E?v.length>0?v:{display:"ES_COMMON_NO_DATA"}:"",count:p,moduleCode:t}),s&&i.createElement(l.Toast,{error:s.error,warning:s.warning,label:a(s.label),onClose:()=>c(null)}))},b=()=>{var e,t,n,r,u,d,s,c,m,v,E,f;const{t:g}=o.useTranslation(),_=a.useLocation(),{path:h,...S}=a.useRouteMatch(),b=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent("WTCreate"),y=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTApplicationDetails"),N=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("MTApplicationDetails"),C=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("TPApplicationDetails"),A=null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("WTMyApplications"),I=Digit.ComponentRegistryService.getComponent("WTEmpInbox"),D=Digit.ComponentRegistryService.getComponent("WTCitizenCard"),x=Digit.ComponentRegistryService.getComponent("MTCitizenCard"),O=null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f?void 0:f.getComponent("ApplicationDetails"),L=e=>({searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:[e],applicationStatus:[],locality:[]}}),w=L("watertanker"),P=L("mobileToilet");return i.createElement("span",{style:{width:"100%"}},i.createElement(a.Switch,null,i.createElement(l.AppContainer,null,i.createElement("div",{className:"ground-container employee-app-container form-container"},i.createElement(l.ModuleHeader,{leftContent:i.createElement(i.Fragment,null,i.createElement(l.ArrowLeft,{className:"icon"}),g("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=_.pathname;e.includes("/mt/"),e.includes("/tp/");let t=[{icon:l.HomeIcon,path:"/digit-ui/citizen"},{label:g("WT_MODULE_NAME"),path:h+"/wt-Vendor"}];if(e.includes("/inbox")){let n="ES_COMMON_INBOX";e.includes("/mt/inbox")&&(t=[{icon:l.HomeIcon,path:"/digit-ui/citizen"},{label:g("ACTION_TEST_MT"),path:h+"/mt-Vendor"}]),t.push({label:g(n)})}else if(e.includes("/my-bookings")){let l="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(l="MT_SEARCH_BOOKINGS"),t.push({label:g(l)})}else e.includes("/status")?t.push({label:g("WT_MY_APPLICATIONS")}):(e.includes("/booking/")||e.includes("/booking-details")||e.includes("/bookingsearch/booking-details"))&&(t.push({label:g("ES_COMMON_INBOX"),path:e.includes("/mt/")?h+"/mt/inbox":h+"/inbox"}),t.push({label:g("WT_BOOKING_DETAILS")}));return t})()}),i.createElement("div",{className:"employee-form-content"},i.createElement(l.PrivateRoute,{path:h+"/inbox",component:()=>i.createElement(I,{useNewInboxAPI:!0,parentRoute:h,moduleCode:"WT",businessService:"watertanker",filterComponent:"WT_INBOX_FILTER",initialStates:w,isInbox:!0})}),i.createElement(l.PrivateRoute,{path:h+"/mt/inbox",component:()=>i.createElement(I,{useNewInboxAPI:!0,parentRoute:h,businessService:"mobileToilet",moduleCode:"MT",filterComponent:"WT_INBOX_FILTER",initialStates:P,isInbox:!0})}),i.createElement(l.PrivateRoute,{path:h+"/request-service",component:b}),i.createElement(l.PrivateRoute,{path:h+"/status",component:A}),i.createElement(l.PrivateRoute,{path:h+"/booking/waterTanker/:acknowledgementIds/:tenantId",component:y}),i.createElement(l.PrivateRoute,{path:h+"/booking/mobileToilet/:acknowledgementIds/:tenantId",component:N}),i.createElement(l.PrivateRoute,{path:h+"/booking/treePruning/:acknowledgementIds/:tenantId",component:C}),i.createElement(l.PrivateRoute,{path:h+"/booking-details/:id",component:()=>i.createElement(O,{parentRoute:h})}),i.createElement(l.PrivateRoute,{path:h+"/bookingsearch/booking-details/:id",component:()=>i.createElement(O,{parentRoute:h})}),i.createElement(l.PrivateRoute,{path:h+"/wt-Vendor",component:()=>Digit.UserService.hasAccess(["WT_VENDOR"])?i.createElement(D,{parentRoute:h}):i.createElement(a.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/wt-Vendor",role:"WT_VENDOR"}}})}),i.createElement(l.PrivateRoute,{path:h+"/mt-Vendor",component:()=>Digit.UserService.hasAccess(["MT_VENDOR"])?i.createElement(x,{parentRoute:h}):i.createElement(a.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/mt-Vendor",role:"MT_VENDOR"}}})}),i.createElement(l.PrivateRoute,{path:h+"/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:h,moduleCode:"WT"}))}),i.createElement(l.PrivateRoute,{path:h+"/mt/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:h,moduleCode:"MT"}))}))))))},y=e=>{let{onSubmit:t,setExistingDataSet:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState(null),[m,v]=n.useState(!1),{offset:p}=a.useParams();n.useEffect(()=>{m&&(t(),v(!1))},[m,t]);let E={limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:p&&!isNaN(parseInt(p))?p:"0",tenantId:d};n.useEffect(()=>{c(E)},[p]);const{isLoading:f,data:g}=Digit.Hooks.wt.useTankerSearchAPI({filters:s});if(f)return i.createElement(l.Loader,null);const _=(null==g?void 0:g.waterTankerBookingDetail)||[],h={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},S={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return i.createElement(i.Fragment,null,i.createElement("div",null,_.length>0&&_.map((e,t)=>{var n;return i.createElement("div",{key:t},i.createElement(l.Card,{style:{...h,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=S.backgroundColor,e.currentTarget.style.boxShadow=S.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{(e=>{var t,l,n,i,o,a,u,d,s,c,m,p,E,f,g,_,h,S;const T={address:{houseNo:null==e||null===(t=e.address)||void 0===t?void 0:t.houseNo,streetName:null==e||null===(l=e.address)||void 0===l?void 0:l.streetName,addressline1:null==e||null===(n=e.address)||void 0===n?void 0:n.addressLine1,addressline2:null==e||null===(i=e.address)||void 0===i?void 0:i.addressLine2,landmark:null==e||null===(o=e.address)||void 0===o?void 0:o.landmark,pincode:null==e||null===(a=e.address)||void 0===a?void 0:a.pincode,cityValue:{code:null==e||null===(u=e.address)||void 0===u?void 0:u.city,value:null==e||null===(d=e.address)||void 0===d?void 0:d.city,i18nKey:null==e||null===(s=e.address)||void 0===s?void 0:s.city,city:{name:null==e||null===(c=e.address)||void 0===c?void 0:c.city,code:null==e||null===(m=e.address)||void 0===m?void 0:m.cityCode}},locality:{code:null==e||null===(p=e.address)||void 0===p?void 0:p.localityCode,value:null==e||null===(E=e.address)||void 0===E?void 0:E.locality,i18nKey:null==e||null===(f=e.address)||void 0===f?void 0:f.locality}},owner:{applicantName:null==e||null===(g=e.applicantDetail)||void 0===g?void 0:g.name,mobileNumber:null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.mobileNumber,alternateNumber:null==e||null===(h=e.applicantDetail)||void 0===h?void 0:h.alternateNumber,emailId:null==e||null===(S=e.applicantDetail)||void 0===S?void 0:S.emailId},requestDetails:{deliveryDate:null==e?void 0:e.deliveryDate,deliveryTime:null==e?void 0:e.deliveryTime,waterQuantity:{code:null==e?void 0:e.waterQuantity,value:null==e?void 0:e.waterQuantity,i18nKey:null==e?void 0:e.waterQuantity},tankerType:{code:null==e?void 0:e.tankerType,value:null==e?void 0:e.tankerType,i18nKey:null==e?void 0:e.tankerType},description:null==e?void 0:e.description}};r(T),v(!0)})(e)}},i.createElement(l.KeyNote,{keyValue:u("BOOKING_NO"),note:null==e?void 0:e.bookingNo}),i.createElement(l.KeyNote,{keyValue:u("APPLICANT_NAME"),note:null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.name}),i.createElement(l.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u(""+(null==e?void 0:e.bookingStatus))})))}),0===_.length&&!f&&i.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("NO_APPLICATION_FOUND_MSG"))))},N=i.memo(e=>{let{t:t}=e;return i.createElement("h1",{className:"heading-m"},t("MY_BOOKINGS"))}),C=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(C,null)),I=e=>{let{t:t,closeModal:o,onSubmit:a,setExistingDataSet:r}=e;const[u,d]=n.useState(!1),[s,c]=n.useState(!1),m=n.useCallback(()=>{s&&(a(),c(!1))},[s,a]);return n.useEffect(()=>{m()},[m]),i.createElement(i.Fragment,null,i.createElement(l.Modal,{headerBarMain:i.createElement(N,{t:t}),headerBarEnd:i.createElement(A,{onClick:o}),actionCancelLabel:u&&t("CS_COMMON_BACK"),actionCancelOnSubmit:()=>d(!1),hideSubmit:!0,formId:"modal-action"},i.createElement(l.Card,{style:{boxShadow:"none"}},u&&i.createElement(y,{onSubmit:a,setExistingDataSet:r}),i.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&i.createElement(l.SubmitBar,{label:t("USE_EXISTING_DETAILS"),onSubmit:()=>{d(!0)}}),!u&&i.createElement(l.SubmitBar,{label:t("FILL_NEW_DETAILS"),onSubmit:()=>{c(!0)}})))))},D=function(){function e(){}return e.prototype.then=function(t,l){const n=new e,i=this.s;if(i){const e=1&i?t:l;if(e){try{x(n,1,e(this.v))}catch(e){x(n,2,e)}return n}return this}return this.o=function(e){try{const i=e.v;1&e.s?x(n,1,t?t(i):i):l?x(n,1,l(i)):x(n,2,i)}catch(e){x(n,2,e)}},n},e}();function x(e,t,l){if(!e.s){if(l instanceof D){if(!l.s)return void(l.o=x.bind(null,e,t));1&t&&(t=l.s),l=l.v}if(l&&l.then)return void l.then(x.bind(null,e,t),x.bind(null,e,2));e.s=t,e.v=l;const n=e.o;n&&n(e)}}function O(e){return e instanceof D&&1&e.s}function L(e,t,l){for(var n;;){var i=e();if(O(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=l();if(o&&o.then){if(!O(o)){n=1;break}o=o.s}if(t){var a=t();if(a&&a.then&&!O(a)){n=2;break}}}var r=new D,u=x.bind(null,r,2);return(0===n?i.then(s):1===n?o.then(d):a.then(c)).then(void 0,u),r;function d(n){o=n;do{if(t&&(a=t())&&a.then&&!O(a))return void a.then(c).then(void 0,u);if(!(i=e())||O(i)&&!i.v)return void x(r,1,o);if(i.then)return void i.then(s).then(void 0,u);O(o=l())&&(o=o.v)}while(!o||!o.then);o.then(d).then(void 0,u)}function s(e){e?(o=l())&&o.then?o.then(d).then(void 0,u):d(o):x(r,1,o)}function c(){(i=e())?i.then?i.then(s).then(void 0,u):s(i):x(r,1,o)}}function w(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function P(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const R=e=>{let{jumpTo:t}=e;o.useTranslation();const n=a.useHistory();return i.createElement(l.LinkButton,{label:i.createElement(l.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){n.push(t)}})},k=e=>{Digit.UploadServices.Filefetch([e],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},M=e=>e.substr(0,1).toUpperCase()+e.substr(1),F=function(e,t,l){try{var n,i,o,a,r,u,d,s,c,m,v,p,E,_;return console.log("booking",e),console.log("tenantInfo",t),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${h=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),h.toLowerCase().split(" ").map(M).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("WT_ACKNOWLEDGEMENT"),details:[{title:l("WT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("WT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("WT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("WT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:l("WT_CITY"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.landmark}].filter(e=>e.value)},{title:l("WT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_TANKER_TYPE"),value:null==e?void 0:e.tankerType},{title:l("WT_WATER_TYPE"),value:l(null==e?void 0:e.waterType)},{title:l("WT_TANKER_QUANTITY"),value:null==e?void 0:e.tankerQuantity},{title:l("WT_WATER_QUANTITY"),value:(null==e?void 0:e.waterQuantity)+" Ltr"},{title:l("WT_DELIVERY_DATE_TIME"),value:`${g(null==e?void 0:e.deliveryDate)} (${f(null==e?void 0:e.deliveryTime)})`},{title:l("WT_DESCRIPTION"),value:null==e?void 0:e.description},{title:l("WT_IMMEDIATE"),value:l("Y"===(null==e?void 0:e.extraCharge)?"YES":"NO")}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var h},B=e=>{const{t:t}=o.useTranslation();return e.isSuccess?t("WT_SUBMIT_SUCCESSFULL"):e.isLoading?t("WT_APPLICATION_PENDING"):e.isSuccess?void 0:t("WT_APPLICATION_FAILED")},U={padding:"4px 0px",justifyContent:"space-between"},W=e=>{var t,n;return i.createElement(l.Banner,{message:B(e),applicationNumber:null===(t=e.data)||void 0===t||null===(n=t.waterTankerBookingDetail)||void 0===n?void 0:n.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},H=()=>{const{t:e}=o.useTranslation(),t=Digit.ULBService.getCurrentTenantId(),{data:n,isLoading:a}=Digit.Hooks.useNewInboxGeneral({tenantId:t,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),{data:r,isLoading:u}=Digit.Hooks.useNewInboxGeneral({tenantId:t,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker-fixedpoint"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),d=a?"-":(null==n?void 0:n.totalCount)??0,s=u?"-":(null==r?void 0:r.totalCount)??0,c=[{count:d,label:e("ES_COMMON_INBOX"),subLabel:"citizen",link:"/digit-ui/employee/wt/inbox"},{count:s,label:e("ES_COMMON_INBOX"),subLabel:"Fixed Point",link:"/digit-ui/employee/wt/fixed-point/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/my-bookings"},{label:e("WT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/request-service"},{label:e("WT_FIXED_POINT_SCHEDULE_MANAGEMENT"),link:"/digit-ui/employee/wt/fixed-point-schedule"},{label:e("WT_LIVE_TRACKING_SYSTEM"),link:"/digit-ui/employee/wt/live-tracking"},{label:e("WT_SEARCH_FIX_POINT"),link:"/digit-ui/employee/wt/search-filling-fix-point"},{label:e("Vendor_Assign"),link:"/digit-ui/employee/wt/vendor-assignment"}],m=Digit.UserService.hasAccess(["WT_CEMP"])||!1,v={Icon:i.createElement(l.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:d,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||m)};return i.createElement(l.EmployeeModuleCard,v)},j=e=>{let{t:t,currentPage:n,columns:o,data:a,getCellProps:r,disableSort:u,onSort:d,onNextPage:s,onPrevPage:c,onPageSizeChange:m,isPaginationRequired:v,pageSizeLimit:E,sortParams:f,totalRecords:g,showCSVExport:_,csvExportFileName:h,csvExportData:S,getCSVExportData:T,csvExportColumns:b,csvExportButtonLabel:y,...N}=e;return i.createElement(l.Table,p({t:t,data:a,currentPage:n,columns:o,getCellProps:r,onNextPage:s,onPrevPage:c,pageSizeLimit:E,disableSort:u,isPaginationRequired:v,onPageSizeChange:m,onSort:d,sortParams:f,totalRecords:g,showCSVExport:_,csvExportFileName:h,csvExportData:S,getCSVExportData:T,csvExportColumns:b,csvExportButtonLabel:y,inboxStyles:{overflowX:"scroll"}},N))},z=e=>{let{businessService:t}=e;const{t:r}=o.useTranslation(),u=[],[d,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===t).filter(e=>{let{roles:t}=e;return t.some(e=>c.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});s(e)},[]),i.createElement(l.Card,{className:"filter inboxLinks"},i.createElement("div",{className:"complaint-links-container"},"CITIZEN"!==Digit.UserService.getUser().info.type&&i.createElement("div",{className:"header"},i.createElement("span",{className:"logo"},i.createElement(l.HomeIcon,null))," ",i.createElement("span",{className:"text"},r(t+"_REQUEST"))),i.createElement("div",{className:"body"},d.map((e,t)=>{let{link:l,text:n,hyperlink:o=!1,roles:u=[]}=e;return i.createElement("span",{className:"link",key:t},o?i.createElement("a",{href:l},n):i.createElement(a.Link,{to:l},r(n)))}))))},V={mobileNumber:l.MobileNumber},G=e=>{var t;let{onSearch:n,type:a,onClose:r,searchFields:d,searchParams:s,isInboxPage:c,clearSearch:m}=e;const{t:v}=o.useTranslation(),{handleSubmit:p,reset:E,watch:f,control:g,formState:_,setValue:h}=u.useForm({defaultValues:c?s:{locality:null,city:null,...s}}),S=f(),T=innerWidth<=640;function b(){const e=d.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(E(e),c){const e={...s};e.delete=[],d.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),n({...e})}else m()}const y=e=>i.createElement(l.LinkLabel,{style:{display:"inline",...e?{margin:0}:{}},onClick:b},v("ES_COMMON_CLEAR_SEARCH"));return i.createElement("form",{id:"search-form",onSubmit:p(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],d.forEach(t=>{e[t.name]||e.delete.push(t.name)}),n(e),"mobile"===a&&r()}),className:"search-form-wrapper search-complaint-container"},i.createElement(i.Fragment,null,("mobile"===a||T)&&i.createElement("div",{className:"complaint-header"},i.createElement("h2",null,v("ES_COMMON_SEARCH_BY")),i.createElement("span",{onClick:r},i.createElement(l.CloseSvg,null))),i.createElement("div",{className:"formcomposer-section-grid"},null==d||null===(t=d.filter(e=>!0))||void 0===t?void 0:t.map((e,t)=>{var n,o,a,r,d;return i.createElement("div",{key:e.name,className:"input-fields"},i.createElement("span",{className:"mobile-input"},i.createElement(l.Label,null,v(e.label)+" "+(e.isMendatory?"*":"")),i.createElement(u.Controller,e.type?{render:t=>i.createElement(null==V?void 0:V[e.type],{formValue:S,setValue:h,onChange:t.onChange,value:t.value}),name:e.name,control:g,defaultValue:""}:{render:e=>i.createElement(l.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:g,defaultValue:""})),null!=_&&null!==(n=_.dirtyFields)&&void 0!==n&&n[e.name]&&null!=_&&null!==(o=_.errors)&&void 0!==o&&null!==(a=o[e.name])&&void 0!==a&&a.message?i.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==_||null===(r=_.errors)||void 0===r||null===(d=r[e.name])||void 0===d?void 0:d.message):null)})),i.createElement("div",{className:"formcomposer-section-button"},c?i.createElement("div",{className:"generic-button clear-search"},i.createElement("p",{onClick:b},v("ES_COMMON_CLEAR_SEARCH"))):i.createElement("div",null,y()),"desktop"===a&&!T&&i.createElement(l.SubmitBar,{className:"generic-button",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==d||!d.find(e=>"locality"===e.name)||null!=S&&null!==(e=S.locality)&&void 0!==e&&e.code||(t=!0),t})(),label:v("ES_COMMON_SEARCH"),submit:!0,form:"search-form"})),("mobile"===a||T)&&i.createElement(l.ActionBar,{className:"clear-search-container"},i.createElement("button",{className:"clear-search",style:{flex:1}},y(T)),i.createElement(l.SubmitBar,{disabled:!!Object.keys(_.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},K=e=>{var t;let{tableConfig:a,filterComponent:r,...u}=e;const{data:d,useNewInboxAPI:s}=u,{t:c}=o.useTranslation(),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[p,E]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(u.EmptyResultInboxComp)}),[f,g]=n.useState(!1),_=i.useMemo(()=>u.isSearch?a.searchColumns(u):a.inboxColumns(u)||[],[]),h=i.useMemo(()=>{var e,t,l,n,i;return[{Header:(null==_||null===(e=_[0])||void 0===e?void 0:e.Header)||c("WT_BOOKING_NO"),exportAccessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""}},{Header:(null==_||null===(t=_[1])||void 0===t?void 0:t.Header)||c("WT_APPLICANT_NAME"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""}},{Header:(null==_||null===(l=_[2])||void 0===l?void 0:l.Header)||c("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""}},{Header:(null==_||null===(n=_[3])||void 0===n?void 0:n.Header)||c("LOCALITY"),exportAccessor:e=>{var t;return null!=e&&null!==(t=e.searchData)&&void 0!==t&&t.localityCode?c(e.searchData.localityCode):""}},{Header:(null==_||null===(i=_[4])||void 0===i?void 0:i.Header)||c("WT_STATUS"),exportAccessor:e=>{var t,l;return null!=e&&null!==(t=e.workflowData)&&void 0!==t&&null!==(l=t.state)&&void 0!==l&&l.applicationStatus?c(e.workflowData.state.applicationStatus):""}}]},[_,c]);let S;if(u.isLoading)S=i.createElement(l.Loader,null);else if(f)S=null;else if(!d||0===(null==d?void 0:d.length)||s&&null!=d&&null!==(t=d[0])&&void 0!==t&&t.dataEmpty){var T;S=p?i.createElement(p,{data:d}):0===(null==d?void 0:d.length)||s&&null!=d&&null!==(T=d[0])&&void 0!==T&&T.dataEmpty?i.createElement(l.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\n").map((e,t)=>i.createElement("p",{key:t,style:{textAlign:"center"}},e))):i.createElement(l.Loader,null)}else(null==d?void 0:d.length)>0&&(S=i.createElement(j,{t:c,data:d,columns:_,getCellProps:e=>({style:{padding:"8px 12px",fontSize:"13.5px"}}),onPageSizeChange:u.onPageSizeChange,currentPage:u.currentPage,onNextPage:u.onNextPage,onPrevPage:u.onPrevPage,pageSizeLimit:u.pageSizeLimit,onSort:u.onSort,disableSort:u.disableSort,sortParams:u.sortParams,autoSort:!1,totalRecords:u.totalRecords,showCSVExport:!0,getCSVExportData:u.getCSVExportData,csvExportColumns:h,csvExportFileName:String(u.moduleCode||"wt").toLowerCase()+"-inbox"}));return i.createElement("div",{className:"inbox-container"},!u.isSearch&&i.createElement("div",{className:"side-panel-item"},i.createElement(z,{parentRoute:u.parentRoute,businessService:u.moduleCode}),i.createElement("div",{className:"filter-form "},i.createElement(m,{defaultSearchParams:u.defaultSearchParams,onFilterChange:u.onFilterChange,searchParams:u.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==d?void 0:d[0].statusMap:null,moduleCode:u.moduleCode}))),i.createElement("div",{className:"employee-form-content",style:{flex:1}},i.createElement(G,{defaultSearchParams:u.defaultSearchParams,onSearch:e=>{u.onSearch(e),g(!1)},type:"desktop",searchFields:u.searchFields,isInboxPage:!(null!=u&&u.isSearch),searchParams:u.searchParams,clearSearch:()=>g(!0)}),i.createElement("div",{className:"result",style:{flex:1}},S)))},Y=e=>{const{t:t}=o.useTranslation(),[a,r]=n.useState(()=>{var l,n;return null!==(l=e.sortParams)&&void 0!==l&&null!==(n=l[0])&&void 0!==n&&n.desc?{code:"DESC",name:t("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:t("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return i.createElement(i.Fragment,null,i.createElement("div",{className:"filter"},i.createElement("div",{className:"filter-card"},i.createElement("div",{className:"heading"},i.createElement("div",{className:"filter-label"},t("SORT_BY"),":"),i.createElement("div",{className:"clearAll",onClick:u},t("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&i.createElement("span",{className:"clear-search",onClick:u},t("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&i.createElement("span",{onClick:e.onClose},i.createElement(l.CloseSvg,null))),i.createElement("div",null,i.createElement(l.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:t("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:t("ES_INBOX_DATE_LATEST_LAST")}]})))))},$=e=>{let{t:t,data:o,onFilterChange:a,onSearch:r,onSort:u,serviceRequestIdKey:d,isFstpOperator:s,isLoading:c,isSearch:m,searchParams:v,searchFields:p,sortParams:E,linkPrefix:f,filterComponent:g}=e;const[_,h]=n.useState(m?"SEARCH":""),[S,T]=n.useState(!!m),[b,y]=n.useState(E),[N]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{_&&T(!0)},[_]);const C=()=>{T(!1),h(""),y(E)};if(c)return i.createElement(l.Loader,null);let A;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(A=i.createElement(l.DetailsCard,{data:o,serviceRequestIdKey:d,linkPrefix:f||"/digit-ui/employee/chb/"})):A=i.createElement(l.Card,{style:{marginTop:20}},t("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>i.createElement("p",{key:t,style:{textAlign:"center"}},e))),i.createElement(i.Fragment,null,i.createElement("div",{className:"searchBox"},r&&i.createElement(l.SearchAction,{text:"SEARCH",handleActionClick:()=>{h("SEARCH"),T(!0)}}),!m&&a&&i.createElement(l.FilterAction,{text:"FILTER",handleActionClick:()=>{h("FILTER"),T(!0)}}),i.createElement(l.FilterAction,{text:"SORT",handleActionClick:()=>{h("SORT"),T(!0)}})),A,S&&i.createElement(l.PopUp,null,"FILTER"===_&&i.createElement("div",{className:"popup-module"},i.createElement(N,{onFilterChange:e=>{a(e),T(!1)},Close:C,type:"mobile",searchParams:v})),"SORT"===_&&i.createElement("div",{className:"popup-module"},i.createElement(Y,{type:"mobile",sortParams:E,onClose:C,onSort:u})),"SEARCH"===_&&i.createElement("div",{className:"popup-module"},i.createElement(G,{type:"mobile",onClose:C,onSearch:r,isFstpOperator:s,searchParams:v,searchFields:p}))))},q=e=>{let{classNameForMobileView:t=""}=e;const{t:r}=o.useTranslation(),u=[],[d,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var l;t.accessTo?(l=t.accessTo,c.filter(e=>l.includes(e.code)).length&&e.push(t)):e.push(t)}),s(e)},[]),i.createElement(l.Card,{className:"employeeCard filter"},i.createElement("div",{className:"complaint-links-container "+t},i.createElement("div",{className:"header"},i.createElement("span",{className:"logo"},i.createElement(l.ShippingTruck,null))," ",i.createElement("span",{className:"text"},r("ES_TITLE_WT_REGISTRATION"))),i.createElement("div",{className:"body"},d.map((e,t)=>{let{link:l,text:n}=e;return i.createElement("span",{className:"link",key:t},i.createElement(a.Link,{to:l},n))}))))},X=e=>{let{data:t,isLoading:l,isSearch:n,searchFields:a,onFilterChange:r,onSearch:u,onSort:d,parentRoute:s,searchParams:c,sortParams:m,linkPrefix:v,tableConfig:p,filterComponent:E}=e;const{t:f}=o.useTranslation();return i.createElement("div",{style:{padding:0}},i.createElement("div",{className:"inbox-container"},i.createElement("div",{className:"filters-container"},!n&&i.createElement(q,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),i.createElement($,{t:f,data:null==t?void 0:t.map(e=>{const t={};return(n?p.searchColumns():p.inboxColumns()).forEach(l=>{l.mobileCell&&(t[l.Header]=l.mobileCell(e))}),t}),onFilterChange:r,isLoading:l,isSearch:n,onSearch:u,onSort:d,searchParams:c,searchFields:a,linkPrefix:v,sortParams:m,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:E}))))},Q={bookingNo:"bookingNo",applicantName:"applicantName",mobileNumber:"mobileNumber",localityCode:"localityCode",applicationStatus:"applicationStatus",bookingStatus:"bookingStatus",createdTime:"createdTime"},Z=e=>{var t,l,a,r,u;let{useNewInboxAPI:d,parentRoute:s,moduleCode:c,detailRoute:m,initialStates:v={},filterComponent:p,isInbox:E,rawWfHandler:f,rawSearchHandler:g,combineResponse:_,wfConfig:h,searchConfig:S,middlewaresWf:T,middlewareSearch:b,EmptyResultInboxComp:y}=e;const N=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),C=Digit.UserService.getUser().info,{t:A}=o.useTranslation(),[I,D]=n.useState(()=>E?{}:{enabled:!1}),[x,O]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("WTInboxTableConfig")}),[w,P]=n.useState(v.pageOffset||0),[R,k]=n.useState(v.pageSize||10),[M,F]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(v.searchParams||{}),W=Q[null==M||null===(t=M[0])||void 0===t?void 0:t.id]||(null==M||null===(l=M[0])||void 0===l?void 0:l.id)||"createdTime";let H=window.Digit.Utils.browser.isMobile(),j=H?{limit:100,offset:0,sortBy:W,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:R,offset:w,sortBy:W,sortOrder:null!=M&&null!==(r=M[0])&&void 0!==r&&r.desc?"DESC":"ASC"};const{isLoading:z,data:V,searchFields:G,...Y}=d?Digit.Hooks.useNewInboxGeneral({tenantId:N,ModuleCode:c,filters:{...B,...j,sortParams:M}}):Digit.Hooks.useInboxGeneral({tenantId:N,businessService:c,isInbox:E,filters:{...B,...j,sortParams:M},rawWfHandler:f,rawSearchHandler:g,combineResponse:_,wfConfig:h,searchConfig:{...I,...S},middlewaresWf:T,middlewareSearch:b});n.useEffect(()=>{P(0)},[B]);const $=e=>{let t=e.delete,l={...B,...e};t&&t.forEach(e=>delete l[e]),delete e.delete,U({...l}),D({enabled:!0})},q=n.useCallback(e=>{var t;Array.isArray(e)&&0!==e.length&&null!==(t=e[0])&&void 0!==t&&t.id&&F(e)},[]),Z=n.useCallback(()=>{var e,t,l,n;const i={WT:"request-service.water_tanker",MT:"request-service.mobile_toilet",TP:"request-service.tree_pruning"},o={moduleName:i[c]||i.WT},a={isInboxSearch:!0,creationReason:[""]},r="ASSIGNED_TO_ME"===(null==B||null===(e=B.uuid)||void 0===e?void 0:e.code),u=null===(t=Digit.UserService.getUser())||void 0===t||null===(l=t.info)||void 0===l?void 0:l.uuid;if(r&&u&&(o.assignee=u),Array.isArray(null==B?void 0:B.services)&&B.services.length>0&&(o.businessService=B.services),Array.isArray(null==B?void 0:B.applicationStatus)&&B.applicationStatus.length>0){const e=B.applicationStatus.map(e=>null==e?void 0:e.uuid).filter(Boolean);e.length>0&&(o.status=e)}return null!=B&&B.mobileNumber&&(a.mobileNumber=B.mobileNumber),null!=B&&B.bookingNo&&(a.bookingNo=B.bookingNo),Array.isArray(null==B?void 0:B.locality)&&B.locality.length>0&&(a.locality=B.locality.map(e=>String((null==e?void 0:e.code)||"").split("_").pop()).filter(Boolean)),Array.isArray(M)&&null!==(n=M[0])&&void 0!==n&&n.id&&(a.sortBy=Q[M[0].id]||M[0].id,a.sortOrder=M[0].desc?"DESC":"ASC"),{workflowFilters:o,moduleSearchCriteria:a}},[c,B,M]),J=n.useCallback(function(){try{var e,t;let l=!1;if(!d||"function"!=typeof(null===(e=Digit)||void 0===e||null===(t=e.InboxGeneral)||void 0===t?void 0:t.Search))return Promise.resolve(Array.isArray(V)?V:[]);const{workflowFilters:n,moduleSearchCriteria:i}=Z(),o=200;let a=0,r=Number.POSITIVE_INFINITY;const u=[],s=L(function(){return!l&&a<r},void 0,function(){return Promise.resolve(Digit.InboxGeneral.Search({inbox:{tenantId:N,processSearchCriteria:n,moduleSearchCriteria:i,limit:o,offset:a}})).then(function(e){const t=Array.isArray(null==e?void 0:e.items)?e.items:[],n=t.map(t=>({searchData:(null==t?void 0:t.businessObject)||{},workflowData:(null==t?void 0:t.ProcessInstance)||{},statusMap:null==e?void 0:e.statusMap,totalCount:null==e?void 0:e.totalCount}));u.push(...n);const i=Number(null==e?void 0:e.totalCount);r=Number.isFinite(i)&&i>=0?i:u.length,0===t.length||t.length<o?l=!0:a+=t.length})});return Promise.resolve(s&&s.then?s.then(function(){return u}):u)}catch(e){return Promise.reject(e)}},[Z,V,N,d]);var ee;if(null!==(null==Y||null===(u=Y.data)||void 0===u?void 0:u.length))return H?i.createElement(X,{data:V,isLoading:z,isSearch:!E,searchFields:G,onFilterChange:$,onSearch:$,onSort:q,parentRoute:s,searchParams:B,sortParams:M,linkPrefix:s+"/application-details/",tableConfig:null!=Y&&Y.tableConfig?Y.tableConfig:x(A)[c],filterComponent:p,EmptyResultInboxComp:y,useNewInboxAPI:d}):i.createElement("div",{className:"app-container",style:{padding:"CITIZEN"===(null==C?void 0:C.type)?"0 24px":""}},i.createElement(K,{moduleCode:c,detailRoute:m,data:V,tableConfig:x(A)[c],isLoading:z,defaultSearchParams:v.searchParams,isSearch:!E,onFilterChange:$,searchFields:G,onSearch:$,onSort:q,onNextPage:()=>{P(e=>e+R)},onPrevPage:()=>{P(e=>e-R)},currentPage:Math.floor(w/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:s,searchParams:B,sortParams:M,totalRecords:Number(null==V||null===(ee=V[0])||void 0===ee?void 0:ee.totalCount),filterComponent:p,EmptyResultInboxComp:y,useNewInboxAPI:d,getCSVExportData:J}))},J=e=>{var t;let{t:n,closeModal:o,onSubmit:a,initialValues:r}=e;const d=new Date,s=`${String(d.getHours()).padStart(2,"0")}:${String(d.getMinutes()).padStart(2,"0")}`,c=r?{...r,arrivalTimeFpl:r.arrivalTimeFpl||s,departureTimeFpl:r.departureTimeFpl||s,arrivalFixedPoint:r.arrivalFixedPoint||s,departureFixedPoint:r.departureFixedPoint||s,returnFpl:r.returnFpl||s,frequencyNo:r.frequencyNo,vehicleId:r.vehicleId}:{arrivalTimeFpl:s,departureTimeFpl:s,arrivalFixedPoint:s,departureFixedPoint:s,returnFpl:s},{handleSubmit:m,control:v,formState:{},watch:p}=u.useForm({defaultValues:c}),E=Digit.ULBService.getCurrentTenantId(),{isLoading:f,data:g}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:E,filters:{limit:1e3}}),_=((null==g?void 0:g.waterTankerBookingDetail)||[]).map(e=>{var t,l,i,o,a,r,u,d,s,c;return{name:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA",mobileNumber:(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.mobileNumber)||"NA",locality:(null==e||null===(i=e.address)||void 0===i?void 0:i.locality)||"NA",displayLabel:`${(null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.name)||"NA"} | ${(null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.mobileNumber)||"NA"} | ${(null==e||null===(r=e.address)||void 0===r?void 0:r.locality)||"NA"}`,value:e.bookingId,fullAddress:[(null==e||null===(u=e.address)||void 0===u?void 0:u.houseNo)&&`${n("WT_HOUSE_NO")} = ${e.address.houseNo}`,(null==e||null===(d=e.address)||void 0===d?void 0:d.streetName)&&`${n("WT_STREET_NAME")} = ${e.address.streetName}`,(null==e||null===(s=e.address)||void 0===s?void 0:s.landmark)&&`${n("WT_LANDMARK")} = ${e.address.landmark}`,(null==e||null===(c=e.address)||void 0===c?void 0:c.locality)&&`${n("WT_LOCALITY")} = ${e.address.locality}`].filter(Boolean).join(", ")}}),h=p("fixedPointCode"),S=_.find(e=>e.value===h),T=[{label:n("MONDAY"),value:"MONDAY"},{label:n("TUESDAY"),value:"TUESDAY"},{label:n("WEDNESDAY"),value:"WEDNESDAY"},{label:n("THURSDAY"),value:"THURSDAY"},{label:n("FRIDAY"),value:"FRIDAY"},{label:n("SATURDAY"),value:"SATURDAY"},{label:n("SUNDAY"),value:"SUNDAY"}],b=[{label:n("YES"),value:"Yes"},{label:n("NO"),value:"No"}],y=p(),N=!(null!=y&&y.fixedPointCode&&null!=y&&y.day&&0!==(null==y||null===(t=y.day)||void 0===t?void 0:t.length)&&null!=y&&y.arrivalTimeFpl&&null!=y&&y.departureTimeFpl&&null!=y&&y.arrivalFixedPoint&&null!=y&&y.departureFixedPoint&&null!=y&&y.returnFpl&&null!=y&&y.volume&&null!=y&&y.active);return i.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},i.createElement("style",null,"\n .custom-modal-content {\n background-color: #fff;\n border-radius: 8px;\n width: 70%;\n max-width: 800px;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n position: relative;\n }\n .add-trip-form {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 20px;\n }\n @media (max-width: 768px) {\n .custom-modal-content {\n width: 90%;\n max-height: 85vh;\n }\n .add-trip-form {\n grid-template-columns: 1fr;\n gap: 15px;\n }\n }\n @media (max-width: 480px) {\n .custom-modal-content {\n width: 95%;\n max-height: 95vh;\n }\n .custom-modal-body {\n padding: 15px !important;\n }\n .custom-modal-footer {\n padding: 12px 15px !important;\n flex-direction: row;\n justify-content: flex-end;\n }\n .custom-modal-header {\n padding: 12px 15px !important;\n }\n .custom-modal-header h1 {\n font-size: 18px !important;\n }\n }\n @media (max-width: 320px) {\n .custom-modal-footer {\n flex-direction: column-reverse;\n align-items: stretch;\n }\n .custom-modal-footer button {\n width: 100%;\n }\n }\n "),i.createElement("div",{className:"custom-modal-content"},i.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},n(r?"WT_EDIT_TRIP":"WT_ADD_TRIP")),i.createElement("button",{onClick:o,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),i.createElement("div",{className:"custom-modal-body",style:{padding:"24px",overflowY:"auto"}},i.createElement("div",{className:"add-trip-form"},i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_FIXED_POINT_CODE")),f?i.createElement(l.Loader,null):i.createElement(u.Controller,{control:v,name:"fixedPointCode",render:e=>i.createElement(l.CustomNameDropdown,{option:_,optionKey:"displayLabel",selected:_.find(t=>t.value===e.value),select:t=>e.onChange(t.value),t:n,optionsHeader:{name:"WT_NAME",mobileNumber:"WT_MOBILE_NUMBER",locality:"WT_LOCALITY"}})}),S&&i.createElement("div",{style:{marginTop:"8px",padding:"10px",backgroundColor:"#f9f9f9",border:"1px solid #ddd",borderRadius:"4px",fontSize:"14px",color:"#555"}},i.createElement("strong",null,n("WT_ADDRESS"),":")," ",S.fullAddress)),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_DAY")),i.createElement(u.Controller,{control:v,name:"day",render:e=>i.createElement(l.MultiSelectDropdown,{options:T,optionsKey:"label",selected:T.filter(t=>(e.value||[]).some(e=>e===t.value||(null==e?void 0:e.value)===t.value)),onSelect:t=>{const l=(t||[]).map(e=>null!=e&&e[1]?e[1]:(null==e?void 0:e.value)||e);e.onChange(l)},t:n,defaultLabel:n("WT_SELECT_DAYS"),defaultUnit:n("WT_DAYS")})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_ARRIVAL_TIME_TO_FPL")),i.createElement(u.Controller,{control:v,name:"arrivalTimeFpl",defaultValue:c.arrivalTimeFpl,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:e.onChange,onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_DEPARTURE_TIME_FROM_FPL")),i.createElement(u.Controller,{control:v,name:"departureTimeFpl",defaultValue:c.departureTimeFpl,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:e.onChange,onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_ARRIVAL_AT_FIXED_POINT")),i.createElement(u.Controller,{control:v,name:"arrivalFixedPoint",defaultValue:c.arrivalFixedPoint,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:e.onChange,onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_DEPARTURE_AT_FIXED_POINT")),i.createElement(u.Controller,{control:v,name:"departureFixedPoint",defaultValue:c.departureFixedPoint,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:e.onChange,onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_RETURN_TO_FPL")),i.createElement(u.Controller,{control:v,name:"returnFpl",defaultValue:c.returnFpl,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:e.onChange,onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_VOLUME")),i.createElement(u.Controller,{control:v,name:"volume",defaultValue:c.volume,render:e=>i.createElement(l.TextInput,{value:e.value,onChange:e.onChange,onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_ACTIVE")),i.createElement(u.Controller,{control:v,name:"active",render:e=>i.createElement(l.Dropdown,{option:b,optionKey:"label",selected:e.value,select:e.onChange,t:n})})),i.createElement("div",{className:"field-group remarks-field-group",style:{gridColumn:"span 2"}},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_REMARKS")),i.createElement(u.Controller,{control:v,name:"remarks",defaultValue:c.remarks,render:e=>i.createElement(l.TextInput,{value:e.value,onChange:e.onChange,onBlur:e.onBlur})})))),i.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},i.createElement("button",{className:"button-cancel",onClick:o,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},n("CS_COMMON_CANCEL")),i.createElement("button",{className:"button-save",disabled:N,onClick:m(e=>{N||a({...r,...e})}),style:{padding:"8px 20px",background:N?"#ccc":"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",cursor:N?"not-allowed":"pointer",opacity:N?.7:1}},n(r?"WT_UPDATE":"CS_COMMON_SAVE")))))},ee=e=>{var t;let{...a}=e;const{t:u}=o.useTranslation(),d=r.useQueryClient(),s=Digit.ULBService.getCurrentTenantId(),[c,m]=n.useState(!1),[v,p]=n.useState(null),[E,f]=n.useState("all"),[g,_]=n.useState({label:"All Fixed Points",value:"all"}),[h,S]=n.useState({label:"All Days",value:"all"}),[T,b]=n.useState({label:"All Status",value:"all"}),[y,N]=n.useState(null),[C,A]=n.useState(0),[I,D]=n.useState(10),[x,O]=n.useState({limit:10,offset:0}),{isLoading:w,data:P}=Digit.Hooks.wt.useFixedPointScheduleSearch(s,x),{data:R}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:s,filters:{offset:0,limit:100}}),k=i.useMemo(()=>({...x,limit:1e3,offset:0}),[x]),{data:M}=Digit.Hooks.wt.useFixedPointScheduleSearch(s,k),F=i.useMemo(()=>{const e=[...(null==R?void 0:R.fixedPointTimeTableDetails)||(null==R?void 0:R.waterTankerBookingDetail)||(null==R?void 0:R.fixedPoints)||[],...(null==M?void 0:M.fixedPointTimeTableDetails)||[]].map(e=>{var t;return{label:e.fixedPointCode||e.name||(null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||e.bookingId,value:e.fixedPointCode||e.bookingId}}).filter(e=>e.label&&e.value).filter((e,t,l)=>l.findIndex(t=>t.value===e.value)===t);return[{label:"WT_ALL_FIXED_POINTS"!==u("WT_ALL_FIXED_POINTS")?u("WT_ALL_FIXED_POINTS"):"All Fixed Points",value:"all"},...e]},[R,M,u]),{mutate:B}=Digit.Hooks.wt.useCreateFixedPointSchedule(s),{mutate:U}=Digit.Hooks.wt.useUpdateFixedPointSchedule(s),W=()=>{p(null)},H=i.useCallback(function(e){return void 0===e&&(e=[]),e.map(e=>({scheduleId:e.systemAssignedScheduleId,fixedPointName:e.fixedPointName,fixedPoint:e.fixedPointId,day:e.day,freq:e.tripNo,arrToFpl:e.arrivalTimeToFpl,depFromFpl:e.departureTimeFromFpl,arrAtFixedPoint:e.arrivalTimeDeliveryPoint,depAtFixedPoint:e.departureTimeDeliveryPoint,returnToFpl:e.timeOfArrivingBackFplAfterDelivery,volume:e.volumeWaterTobeDelivery,vehicle:e.vehicleId,active:e.isEnable?"Y":"N",totalCount:e.totalCount}))},[]),z=i.useMemo(()=>H((null==P?void 0:P.fixedPointTimeTableDetails)||[]),[P,H]),V=function(e,t){var l;void 0===e&&(e=null),void 0===t&&(t=null);const n=e||{fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==h?void 0:h.value)?"":null==h||null===(l=h.value)||void 0===l?void 0:l.toUpperCase(),status:"all"===(null==T?void 0:T.value)?"":null==T?void 0:T.value},i=null!==t?t:0;null===t&&A(0),O({...n,limit:I,offset:i})};i.useEffect(()=>{0!==C&&V(null,C)},[C,I]);const G=i.useMemo(()=>[{Header:u("WT_FIXED_POINT_CODE"),accessor:"fixedPoint"},{Header:u("WT_FIXED_POINT_NAME"),accessor:"fixedPointName"},{Header:u("WT_DAY"),accessor:"day"},{Header:u("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:u("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:u("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:u("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:u("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:u("WT_VOLUME"),accessor:"volume"},{Header:u("WT_ACTIVE"),accessor:"active",Cell:e=>{let{value:t}=e;return i.createElement("span",{style:{background:"Y"===t?"#E6F4EA":"#FCE8E6",padding:"2px 8px",borderRadius:"10px",color:"Y"===t?"#1E8E3E":"#D93025"}},t)}},{Header:u("WT_ACTION"),Cell:e=>{let{row:t}=e;return i.createElement("div",{style:{display:"flex",gap:"5px"}},i.createElement("button",{onClick:()=>{N(t.index),m(!0)},style:{color:"#1D4E7F",border:"1px solid #1D4E7F",background:"none",padding:"2px 8px",cursor:"pointer"}},u("WT_EDIT")))}}],[u]),K=i.useCallback(function(){try{let t=!1;function e(){return H(a)}const l={...x||{}};delete l.limit,delete l.offset;const n=200;let i=0,o=Number.POSITIVE_INFINITY;const a=[],r=L(function(){return!t&&i<o},void 0,function(){return Promise.resolve(Digit.WTService.SearchFixedPointSchedule({tenantId:s,filters:{...l,limit:n,offset:i}})).then(function(e){const l=(null==e?void 0:e.fixedPointTimeTableDetails)||[];a.push(...l);const r=Number((null==e?void 0:e.count)??(null==e?void 0:e.totalCount)??(null==e?void 0:e.Count));o=Number.isFinite(r)&&r>=0?r:a.length,!l.length||l.length<n?t=!0:i+=l.length})});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},[x,H,s]),Y=i.useMemo(()=>[{Header:u("WT_SCHEDULE_ID"),accessor:"scheduleId"},{Header:u("WT_FIXED_POINT"),accessor:"fixedPoint"},{Header:u("WT_DAY"),accessor:"day"},{Header:u("WT_FREQ"),accessor:"freq"},{Header:u("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:u("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:u("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:u("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:u("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:u("WT_VOLUME"),accessor:"volume"},{Header:u("WT_ACTIVE"),accessor:"active"}],[u]);return i.createElement("div",{className:"fixed-point-schedule-management"},i.createElement(l.Card,{style:{padding:"20px"}},i.createElement("div",{className:"finance-mainlayout",style:{marginBottom:"20px"}},i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_EXPORT")),i.createElement(l.Dropdown,{option:[{label:u("WT_EXCEL_WEEKWISE"),value:"Weekwise"},{label:u("WT_EXCEL_MONTHWISE"),value:"Monthwise"},{label:u("WT_EXCEL_YEARWISE"),value:"Yearwise"}],optionKey:"label",placeholder:u("WT_EXPORT"),t:u,select:e=>{const t=new Date,l=`${t.getDate()}-${t.getMonth()+1}-${t.getFullYear()}`,n=`FixedPointSchedule_${e.value}_${l}`,i=(null==M?void 0:M.fixedPointTimeTableDetails)||[],o=[[u("WT_SCHEDULE_ID"),u("WT_FIXED_POINT"),u("WT_DAY"),u("WT_FREQ"),u("WT_ARR_TO_FPL"),u("WT_DEP_FROM_FPL"),u("WT_ARR_AT_FIXED_POINT"),u("WT_DEP_AT_FIXED_POINT"),u("WT_RETURN_TO_FPL"),u("WT_VOLUME"),u("WT_VEHICLE"),u("WT_ACTIVE")],...i.map(e=>[e.systemAssignedScheduleId,e.fixedPointCode,u(e.day),e.tripNo,e.arrivalTimeToFpl,e.departureTimeFromFpl,e.arrivalTimeDeliveryPoint,e.departureTimeDeliveryPoint,e.timeOfArrivingBackFplAfterDelivery,e.volumeWaterTobeDelivery,e.vehicleId,e.isEnable?"Y":"N"])];if(window.Digit&&window.Digit.Download&&window.Digit.Download.Excel)window.Digit.Download.Excel(o,n);else{const e=o.map(e=>e.map(e=>`"${(""+(null==e?"":e)).replace(/"/g,'\\"')}"`).join(",")),t=new Blob([e.join("\n")],{type:"text/csv"}),l=window.URL.createObjectURL(t),i=document.createElement("a");i.setAttribute("hidden",""),i.setAttribute("href",l),i.setAttribute("download",n+".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}}})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_FIXED_POINT")),i.createElement(l.Dropdown,{option:F,optionKey:"label",selected:g,t:u,select:e=>{_(e)},placeholder:u("WT_ALL_FIXED_POINTS")})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_DAY")),i.createElement(l.Dropdown,{option:[{label:"All Days",value:"all"},{label:u("MONDAY"),value:"MONDAY"},{label:u("TUESDAY"),value:"TUESDAY"},{label:u("WEDNESDAY"),value:"WEDNESDAY"},{label:u("THURSDAY"),value:"THURSDAY"},{label:u("FRIDAY"),value:"FRIDAY"},{label:u("SATURDAY"),value:"SATURDAY"},{label:u("SUNDAY"),value:"SUNDAY"}],optionKey:"label",selected:h,t:u,select:e=>{var t;S(e),f(e.value),V({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==e?void 0:e.value)?"":null==e||null===(t=e.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==T?void 0:T.value)?"":null==T?void 0:T.value})},placeholder:"All Days"})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_STATUS")),i.createElement(l.Dropdown,{option:[{label:"All Status",value:"all"},{label:"Active",value:"Active"},{label:"Inactive",value:"Inactive"}],optionKey:"label",selected:T,t:u,select:e=>{var t;b(e),V({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==h?void 0:h.value)?"":null==h||null===(t=h.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==e?void 0:e.value)?"":null==e?void 0:e.value})},placeholder:"All Status"})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement("span",{className:"generic-button clear-search",onClick:()=>{f("all"),S({label:"All Days",value:"all"}),_({label:"All Fixed Points",value:"all"}),b({label:"All Status",value:"all"}),A(0),O({limit:I,offset:0})},style:{alignSelf:"center"}},u("ES_COMMON_CLEAR_SEARCH"))),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement(l.SubmitBar,{label:u("ES_COMMON_SEARCH"),onSubmit:()=>V()}))),i.createElement("div",{style:{display:"flex",gap:"5px",marginBottom:"20px",flexWrap:"wrap"}},["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"].map(e=>i.createElement("button",{key:e,onClick:()=>{f(e),S({label:e,value:e}),V({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:e.toUpperCase(),status:"all"===(null==T?void 0:T.value)?"":null==T?void 0:T.value})},style:{padding:"8px 16px",border:"1px solid #ccc",borderRadius:"4px",background:E===e?"#1D4E7F":"#fff",color:E===e?"#fff":"#333",cursor:"pointer"}},u(e.toUpperCase())))),i.createElement("div",{style:{width:"100%",overflowX:"auto"}},i.createElement(j,{t:u,data:z,columns:G,getCellProps:e=>({}),styles:{minWidth:"1200px"},inboxStyles:{overflowX:"auto"},isLoading:w,onPageSizeChange:e=>{D(Number(e.target.value))},currentPage:Math.floor(C/I),onNextPage:()=>{A(e=>e+I)},onPrevPage:()=>{A(e=>e-I)},pageSizeLimit:I,onSort:a.onSort,disableSort:a.disableSort,sortParams:a.sortParams,totalRecords:(null==P?void 0:P.count)||(null==P?void 0:P.totalCount)||(null==z||null===(t=z[0])||void 0===t?void 0:t.totalCount),showCSVExport:!0,getCSVExportData:K,csvExportColumns:Y,csvExportFileName:"wt-fixed-point-schedule"})),i.createElement("span",null,i.createElement("button",{onClick:()=>{N(null),m(!0)},style:{background:"#1E8E3E",color:"#fff",border:"none",padding:"10px 20px",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px",marginBottom:"10px"}},i.createElement("span",null,"+")," ",u("WT_ADD_TRIP")))),c&&i.createElement(J,{t:u,closeModal:()=>{m(!1),N(null)},initialValues:null!==y?{scheduleId:z[y].scheduleId,fixedPointCode:z[y].fixedPoint,day:[{label:u(z[y].day),value:z[y].day}],frequencyNo:z[y].freq,arrivalTimeFpl:z[y].arrToFpl,departureTimeFpl:z[y].depFromFpl,arrivalFixedPoint:z[y].arrAtFixedPoint,departureFixedPoint:z[y].depAtFixedPoint,returnFpl:z[y].returnToFpl,volume:z[y].volume,vehicleId:z[y].vehicle,active:{label:u("Y"===z[y].active?"YES":"NO"),value:"Y"===z[y].active?"Yes":"No"}}:null,onSubmit:e=>{var t,l;const n=null==e?void 0:e.day;let i=[];if(Array.isArray(n))i=n.map(e=>"string"==typeof e?e:(null==e?void 0:e.value)||(Array.isArray(e)?e[1]:e)).filter(e=>"string"==typeof e&&"WT_SELECT_ALL"!==e),0===i.length&&n.some(e=>"WT_SELECT_ALL"===("string"==typeof e?e:(null==e?void 0:e.value)||(Array.isArray(e)?e[1]:e)))&&(i=["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]);else if(n){const e="string"==typeof n?n:(null==n?void 0:n.value)||(Array.isArray(n)?n[1]:n);e&&"WT_SELECT_ALL"!==e&&(i=[e])}const o={tenantId:s,system_assigned_schedule_id:e.scheduleId,fixed_point_code:e.fixedPointCode,day:i.map(e=>{var t;return(null==e||null===(t=e.toUpperCase)||void 0===t?void 0:t.call(e))||e}),trip_no:Number(e.frequencyNo),arrival_time_to_fpl:e.arrivalTimeFpl,departure_time_from_fpl:e.departureTimeFpl,arrival_time_delivery_point:e.arrivalFixedPoint,departure_time_delivery_point:e.departureFixedPoint,time_of_arriving_back_fpl_after_delivery:e.returnFpl,volume_water_tobe_delivery:e.volume,active:"Yes"===(null===(t=e.active)||void 0===t?void 0:t.value)||"Yes"===e.active,is_enable:"Yes"===(null===(l=e.active)||void 0===l?void 0:l.value)||"Yes"===e.active,remarks:e.remarks,vehicle_id:e.vehicleId},a=null!==y?{fixedPointDetailsList:[o]}:{fixedPointDetails:o};null!==y?U(a,{onError:(e,t)=>{var l,n,i,o;p({key:"error",label:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"ERROR_WHILE_UPDATING_SCHEDULE"}),setTimeout(W,5e3)},onSuccess:(e,t)=>{p({label:u("WT_SCHEDULE_UPDATE_SUCCESS")}),setTimeout(W,5e3),m(!1),N(null),d.invalidateQueries(["FIXED_POINT_SCHEDULE_SEARCH",s])}}):B(a,{onError:(e,t)=>{var l,n,i,o;p({key:"error",label:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"ERROR_WHILE_CREATING_SCHEDULE"}),setTimeout(W,5e3)},onSuccess:(e,t)=>{p({label:u("WT_SCHEDULE_CREATE_SUCCESS")}),setTimeout(W,5e3),m(!1),N(null),d.invalidateQueries(["FIXED_POINT_SCHEDULE_SEARCH",s])}})}}),v&&i.createElement(l.Toast,{error:"error"===v.key,label:v.label,onClose:W}))},te=new Map,le=function(e,t){try{if(null==e||null==t)return Promise.resolve(null);const l=`${e.toFixed(5)},${t.toFixed(5)}`;return te.has(l)?Promise.resolve(te.get(l)):Promise.resolve(w(function(){return Promise.resolve(fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&zoom=18&addressdetails=1`,{headers:{"Accept-Language":"en","User-Agent":"Digit-UI-WT-Module"}})).then(function(e){if(!e.ok)throw new Error("Geocoding failed: "+e.statusText);return Promise.resolve(e.json()).then(function(e){return te.set(l,e),e})})},function(e){return console.error("Error in reverseGeocode:",e),null}))}catch(e){return Promise.reject(e)}},ne=e=>{if(!e||!e.address)return"Unknown Address";const{address:t}=e,l=[t.house_number||t.amenity,t.road,t.suburb||t.neighbourhood||t.village,t.city_district||t.city||t.town,t.state,t.postcode].filter(Boolean);return l.length>0?l.join(", "):e.display_name||"Unknown Address"},ie=(e,t,l,n)=>{const i=oe(l-e),o=oe(n-t),a=Math.sin(i/2)*Math.sin(i/2)+Math.cos(oe(e))*Math.cos(oe(l))*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))*6371};function oe(e){return e*(Math.PI/180)}delete c.Icon.Default.prototype._getIconUrl,c.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"});const ae=new c.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),re=new c.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),ue=new c.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),de=e=>{let{lat:t,lng:l,fallback:o="Resolving area"}=e;const[a,r]=n.useState(o);return n.useEffect(()=>{!function(){try{const e=function(){if(null!=t&&null!=l)return Promise.resolve(le(t,l)).then(function(e){r(ne(e))})}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t,l]),i.createElement("span",{title:`${null==t?void 0:t.toFixed(6)}, ${null==l?void 0:l.toFixed(6)}`},a)},se=e=>{let{selectedDriver:t,mapZoom:l,mapCenter:i}=e;const o=s.useMap();return n.useEffect(()=>{null!=t&&t.lat&&null!=t&&t.lng&&o.setView([t.lat,t.lng],l||15,{animate:!0,duration:1})},[t,o]),n.useEffect(()=>{Array.isArray(i)&&2===i.length&&o.setView(i,l||15,{animate:!0,duration:1})},[i,o]),n.useEffect(()=>{l&&o.setZoom(l)},[l,o]),null},ce=e=>{let{start:l,end:o,color:a="#2196f3",weight:r=6}=e;const{routeData:u,loading:d,error:m}=((e,l)=>{const[i,o]=n.useState(null),[a,r]=n.useState(!1),[u,d]=n.useState(null);return n.useEffect(()=>{e&&l&&function(){try{r(!0),Promise.resolve(P(function(){return w(function(){return Promise.resolve(fetch(`https://router.project-osrm.org/route/v1/driving/${e.lng},${e.lat};${l.lng},${l.lat}?overview=full&geometries=geojson&steps=true`)).then(function(e){if(!e.ok)throw new Error(t("FAILED_TO_FETCH_ROUTE"));return Promise.resolve(e.json()).then(function(e){if(e.routes&&e.routes[0]){const t=e.routes[0],l=t.geometry.coordinates.map(e=>[e[1],e[0]]);o({coordinates:l,distance:t.distance,duration:t.duration,legs:t.legs})}})})},function(e){console.error(t("Error fetching route:"),e),d(e.message)})},function(e,t){if(r(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}()},[null==e?void 0:e.lat,null==e?void 0:e.lng,null==l?void 0:l.lat,null==l?void 0:l.lng]),{routeData:i,loading:a,error:u}})(l,o),[v,p]=n.useState(!1),[E,f]=n.useState(null);return d?i.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"white",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},t("LOADING_ROUTE")):m?i.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"#ffebee",color:"#c62828",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},t("ERROR_LOADING_ROUTE"),m):u?i.createElement(i.Fragment,null,(()=>{if(!u.legs)return null;const e=[];return u.legs.forEach((t,l)=>{t.steps.forEach((t,n)=>{const o=t.geometry.coordinates.map(e=>[e[1],e[0]]);let u=a;"turn"===t.maneuver.type?u="#ff9800":"straight"===t.maneuver.type?u="#4caf50":"arrive"===t.maneuver.type&&(u="#f44336"),e.push(i.createElement(i.Fragment,{key:`${l}-${n}`},i.createElement(s.Polyline,{positions:o,color:u,weight:r+2,opacity:.3,lineCap:"round"}),i.createElement(s.Polyline,{positions:o,color:u,weight:r,opacity:.9,lineCap:"round",eventHandlers:{mouseover:()=>f(t),mouseout:()=>f(null),click:()=>p(!v)}}),o.map((e,t)=>{if(t%5==0&&t<o.length-1){const a=o[t+1],r=180*Math.atan2(a[0]-e[0],a[1]-e[1])/Math.PI;return i.createElement(s.Marker,{key:`dot-${l}-${n}-${t}`,position:e,icon:c.divIcon({className:"direction-dot",html:`<div style="\n width: 6px;\n height: 6px;\n background: white;\n border: 2px solid ${u};\n border-radius: 50%;\n transform: rotate(${r}deg);\n "></div>`,iconSize:[10,10],iconAnchor:[5,5]})})}return null})))})}),e})(),(E||v)&&i.createElement("div",{style:{position:"absolute",bottom:"80px",left:"10px",right:"10px",background:"white",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:1e3,maxWidth:"calc(100% - 20px)",border:"1px solid #e0e0e0",maxHeight:"50vh",overflowY:"auto"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},i.createElement("h4",{style:{margin:0,color:"#667eea"}},t("ROUTE_INFORMATION")),i.createElement("button",{onClick:()=>p(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:"24px",color:"#666",padding:"0 8px"}},"×")),i.createElement("div",{style:{marginBottom:"12px"}},i.createElement("div",null,i.createElement("strong",null,t("TOTAL_DISTANCE"),":")," ",(u.distance/1e3).toFixed(2)," km"),i.createElement("div",null,i.createElement("strong",null,t("ESTIMATED_TIME"),":")," ",Math.round(u.duration/60)," minutes")),E&&i.createElement("div",{style:{padding:"8px",background:"#f5f5f5",borderRadius:"4px",marginBottom:"8px"}},i.createElement("div",null,i.createElement("strong",null,t("CURRENT_STEP"),":")," ",E.maneuver.type),i.createElement("div",null,i.createElement("strong",null,t("INSTRUCTION"),":")," ",E.maneuver.instruction||E.name),i.createElement("div",null,i.createElement("strong",null,t("DISTANCE"),":")," ",(E.distance/1e3).toFixed(2)," km"),i.createElement("div",null,i.createElement("strong",null,t("DURATION"),":")," ",Math.round(E.duration/60)," min")),v&&u.legs&&i.createElement("div",{style:{maxHeight:"200px",overflowY:"auto"}},i.createElement("h5",{style:{margin:"8px 0",color:"#666"}},t("TURN_BY_TURN_DIRECTIONS"),":"),u.legs[0].steps.map((e,t)=>i.createElement("div",{key:t,style:{padding:"8px",borderBottom:"1px solid #eee",fontSize:"12px",cursor:"pointer",background:E===e?"#e3f2fd":"transparent"},onMouseEnter:()=>f(e),onMouseLeave:()=>f(null)},i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement("span",{style:{width:"20px",height:"20px",borderRadius:"50%",background:"#667eea",color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",flexShrink:0}},t+1),i.createElement("div",null,i.createElement("div",{style:{fontWeight:"500"}},e.maneuver.instruction||e.name),i.createElement("div",{style:{color:"#666"}},(e.distance/1e3).toFixed(2)," km · ",Math.round(e.duration/60)," min"))))))),u.distance>1e3&&u.coordinates&&i.createElement(me,{coordinates:u.coordinates,totalDistance:u.distance})):null},me=e=>{let{coordinates:t,totalDistance:l}=e;const n=[];for(let e=1e3;e<l;e+=1e3){const o=Math.floor(t.length*(e/l));o<t.length&&n.push(i.createElement(s.Marker,{key:"dist-"+e,position:t[o],icon:c.divIcon({className:"distance-marker",html:`<div style="\n background: white;\n border: 2px solid #667eea;\n border-radius: 12px;\n padding: 2px 6px;\n font-size: 10px;\n font-weight: bold;\n color: #667eea;\n white-space: nowrap;\n ">${(e/1e3).toFixed(0)} km</div>`,iconSize:[40,20],iconAnchor:[20,10]})}))}return i.createElement(i.Fragment,null,n)},ve=e=>{let{isOnline:t}=e;return i.createElement("span",{style:{display:"inline-block",padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",backgroundColor:t?"#e6f7e6":"#ffe6e6",color:t?"#2e7d32":"#c62828",border:"1px solid "+(t?"#a5d6a7":"#ef9a9a")}},i.createElement("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:t?"#4caf50":"#f44336",marginRight:"6px"}}),t?"ONLINE":"OFFLINE")},pe=e=>{let{driver:t,isSelected:l,onClick:a,vendorList:r}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState("Resolving area..."),[c,m]=n.useState("Resolving area..."),v=n.useRef({lat:null,lng:null}),p=n.useRef({lat:null,lng:null});n.useEffect(()=>{!function(){try{const e=function(){if(t.lat&&t.lng){const e=v.current.lat?ie(v.current.lat,v.current.lng,t.lat,t.lng):Infinity,l=function(){if(e>.2)return Promise.resolve(le(t.lat,t.lng)).then(function(e){s(ne(e)),v.current={lat:t.lat,lng:t.lng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.lat,t.lng]),n.useEffect(()=>{!function(){try{const e=function(){if(t.deliveryLat&&t.deliveryLng){const e=p.current.lat?ie(p.current.lat,p.current.lng,t.deliveryLat,t.deliveryLng):Infinity,l=function(){if(e>.2)return Promise.resolve(le(t.deliveryLat,t.deliveryLng)).then(function(e){m(ne(e)),p.current={lat:t.deliveryLat,lng:t.deliveryLng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.deliveryLat,t.deliveryLng]);const E=n.useMemo(()=>{if(!r||!r.length)return{name:"Unknown",vehicle:"N/A"};for(const o of r){var e;const a=null===(e=o.drivers)||void 0===e?void 0:e.find(e=>{var l,n;return e.id===t.driverId||(null===(l=e.owner)||void 0===l?void 0:l.mobileNumber)===t.driverId||(null===(n=e.owner)||void 0===n?void 0:n.uuid)===t.driverId});var l,n,i;if(a)return{name:(null===(l=a.owner)||void 0===l?void 0:l.name)||"Unknown",vehicle:(null===(n=o.vehicles)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.registrationNumber)||"N/A"}}return{name:"Unknown",vehicle:"N/A"}},[r,t.driverId]);return i.createElement("div",{onClick:a,style:{padding:"16px",borderRadius:"12px",background:l?"#f0f4ff":"white",border:"2px solid "+(l?"#667eea":"#f0f0f0"),cursor:"pointer",position:"relative",transition:"all 0.2s ease"}},i.createElement("div",{style:{display:"flex",gap:"12px",marginBottom:"12px"}},i.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"8px",background:"#f0f2f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px"}},"👤"),i.createElement("div",{style:{flex:1}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},i.createElement("div",null,i.createElement("div",{style:{fontWeight:"700",fontSize:"14px",color:"#0d47a1"}},"DRV-",t.driverId.substring(0,4).toUpperCase()),i.createElement("div",{style:{fontSize:"11px",color:"#666"}},E.name," • ",E.vehicle)),i.createElement("div",{style:{fontSize:"10px",fontWeight:"700",padding:"2px 8px",borderRadius:"4px",background:t.isOnline?"#e8f5e9":"#ffebee",color:t.isOnline?"#2e7d32":"#c62828"}},t.isOnline?"ONLINE":"OFFLINE")))),i.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"}},i.createElement("div",null,i.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},u("CURRENT_LOCATION")),i.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},d))),i.createElement("div",null,i.createElement("div",null,i.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},u("DESTINATION")),i.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},c))))};function Ee(){const{t:e}=o.useTranslation(),t=Digit.ULBService.getCurrentTenantId(),[a,r]=n.useState({}),[u,c]=n.useState(!1),[m,v]=n.useState(null),[p,E]=n.useState(""),[f,g]=n.useState("all"),[_,h]=n.useState(!0),[S,T]=n.useState([28.6139,77.209]),[b,y]=n.useState(12),[N,C]=n.useState(!0),[A,I]=n.useState(window.innerWidth<=768),[D,x]=n.useState(null),[O,L]=n.useState(null),{data:w}=Digit.Hooks.wt.useFillPointSearch({tenantId:t,filters:{status:"ACTIVE"}}),P=n.useMemo(()=>(null==w?void 0:w.fillingPoints)||[],[w]),{data:R}=Digit.Hooks.fsm.useVendorSearch({tenantId:t,filters:{status:"ACTIVE"},config:{select:e=>(null==e?void 0:e.vendor)||[]}}),k=n.useMemo(()=>R&&R.length?D?R.filter(e=>{var t;return(null==e||null===(t=e.fillingPoint)||void 0===t?void 0:t.id)===(null==D?void 0:D.id)}):R:[],[R,D]);n.useEffect(()=>{var e,t,l;null!=R&&R.length&&Object.keys(a).length&&(console.log("=== VENDOR DEBUG ==="),console.log("Vendor[0] vehicles:",null===(e=R[0])||void 0===e?void 0:e.vehicles),console.log("Vendor[0] drivers:",null===(t=R[0])||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.map(e=>{var t,l;return{id:e.id,mobile:null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,uuid:null===(l=e.owner)||void 0===l?void 0:l.uuid}})),console.log("Socket driverId example:",Object.keys(a)[0]))},[R,a]),n.useEffect(()=>{const e=()=>{I(window.innerWidth<=768),window.innerWidth<=768?C(!1):C(!0)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]);const M=n.useMemo(()=>d.io("https://dev-djb.nitcon.in",{path:"/driver-tanker-tracker-service/socket.io",transports:["websocket"],autoConnect:!1}),[]);n.useEffect(()=>(M.connect(),M.on("connect",()=>{console.log("Admin connected:",M.id),c(!0),M.emit("admin-join")}),M.on("disconnect",()=>{console.log("Admin disconnected"),c(!1)}),M.on("drivers-snapshot",e=>{if(console.log("drivers-snapshot",e),!Array.isArray(e))return;const t={};e.forEach(e=>{e&&e.driverId&&(t[e.driverId]={...e,lastUpdate:(new Date).toISOString()})}),r(t)}),M.on("driver-location-update",e=>{console.log("driver-location-update",e),e&&e.driverId&&r(t=>{const l=t[e.driverId]||{};return{...t,[e.driverId]:{...l,...e,lastUpdate:(new Date).toISOString()}}})}),M.on("driver-status",e=>{console.log("driver-status",e),e&&e.driverId&&r(t=>({...t,[e.driverId]:{...t[e.driverId],...e,lastUpdate:(new Date).toISOString()}}))}),()=>{M.disconnect()}),[M]),n.useEffect(()=>{null!=m&&m.lat&&null!=m&&m.lng&&(T([m.lat,m.lng]),y(15))},[m]);const F=Object.values(a).filter(e=>{const t=e.driverId.toLowerCase().includes(p.toLowerCase()),l="all"===f||"online"===f&&e.isOnline||"offline"===f&&!e.isOnline,n=!D||!(!R||!R.length)&&R.some(t=>{var l,n;return(null==t||null===(l=t.fillingPoint)||void 0===l?void 0:l.id)===(null==D?void 0:D.id)&&(null===(n=t.drivers)||void 0===n?void 0:n.some(t=>{var l,n,i,o;return(null===(l=t.owner)||void 0===l?void 0:l.mobileNumber)===e.driverId||(null===(n=t.owner)||void 0===n?void 0:n.uuid)===e.driverId||t.id===e.driverId||String(null===(i=t.owner)||void 0===i?void 0:i.mobileNumber)===String(e.driverId)||String(null===(o=t.owner)||void 0===o?void 0:o.uuid)===String(e.driverId)}))}),i=!O||((null===(o=O.drivers)||void 0===o?void 0:o.map(e=>{var t,l,n,i;return[null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,null===(l=e.owner)||void 0===l?void 0:l.uuid,e.id,String(null===(n=e.owner)||void 0===n?void 0:n.mobileNumber),String(null===(i=e.owner)||void 0===i?void 0:i.uuid)]}).flat().filter(Boolean))||[]).some(t=>e.driverId===t);var o;return t&&l&&n&&i}),B=Object.values(a).filter(e=>e.isOnline).length,U=Object.values(a).filter(e=>!e.isOnline).length,W=Object.values(a).filter(e=>e.isOnline&&e.deliveryLat&&e.deliveryLng).length;return i.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100vh",width:"100%",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",background:"#f0f2f5",padding:"16px",boxSizing:"border-box"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",background:"white",padding:"16px 24px",borderRadius:"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"2px solid #667eea44"}},i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},i.createElement("h1",{style:{margin:0,fontSize:"24px",fontWeight:"700",color:"#0d47a1"}},e("WT_LIVE_DRIVER_TRACKING")),i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",background:"#e8f5e9",color:"#2e7d32",padding:"4px 12px",borderRadius:"20px",fontSize:"12px",fontWeight:"700",border:"1px solid #c8e6c9"}},i.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:u?"#4caf50":"#f44336",boxShadow:u?"0 0 8px #4caf50":"none"}}),u?"CONNECTED":"DISCONNECTED")),i.createElement("p",{style:{margin:"4px 0 0 0",fontSize:"14px",color:"#666"}},e("REAL_TIME_TELEMETRY_AND_FLEET_COORDINATION"))),i.createElement("div",{style:{display:"flex",gap:"12px"}},[{label:e("TOTAL_FLEET"),value:Object.keys(a).length,color:"#0d47a1"},{label:e("ONLINE"),value:B,color:"#2e7d32"},{label:e("OFFLINE"),value:U,color:"#c62828"},{label:e("ACTIVE"),value:W,color:"#0d47a1"}].map((e,t)=>i.createElement("div",{key:t,style:{background:"#f8f9fa",padding:"8px 16px",borderRadius:"8px",minWidth:"100px",display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"}},i.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#888",marginBottom:"4px"}},e.label),i.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:e.color}},e.value))))),i.createElement("div",{style:{display:"flex",flex:1,gap:"16px",overflow:"hidden"}},A&&i.createElement("button",{onClick:()=>{C(!N)},style:{position:"absolute",top:"80px",left:"20px",zIndex:2e3,background:"#667eea",color:"white",border:"none",borderRadius:"8px",padding:"8px 12px",fontSize:"12px",cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}},N?"Close":"Menu"),i.createElement("div",{style:{width:A?N?"100%":"0":"360px",height:"100%",display:"flex",flexDirection:"column",background:"transparent",position:A?"absolute":"relative",top:0,left:0,zIndex:1500,transition:"all 0.3s ease-in-out",...A&&!N&&{width:"0",opacity:0,pointerEvents:"none"}}},N&&i.createElement(i.Fragment,null,i.createElement("div",{style:{padding:"20px",background:"white",borderRadius:"12px",display:"flex",flexDirection:"column",height:"100%",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"}},i.createElement("h3",{style:{margin:0,fontSize:"14px",fontWeight:"700",color:"#888",letterSpacing:"1px"}},e("WT_FILTER_FLEET")),i.createElement("button",{onClick:()=>{x(null),L(null),E(""),g("all")},style:{background:"none",border:"none",color:"#667eea",fontSize:"12px",fontWeight:"700",cursor:"pointer"}},e("WT_RESET_ALL"))),i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginBottom:"20px"}},i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},i.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_FILLING_POINT")),i.createElement(l.Dropdown,{t:e,option:P,optionKey:"fillingPointName",select:e=>{x(e),L(null)},selected:D,placeholder:e("WT_SELECT_FILLING_POINT"),style:{width:"100%",margin:0}})),i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},i.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_VENDOR")),i.createElement(l.Dropdown,{t:e,option:k,optionKey:"name",select:L,selected:O,placeholder:e("WT_SELECT_VENDOR"),style:{width:"100%",margin:0}})),i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},i.createElement("label",{style:{fontSize:"10px",fontWeight:"700",color:"#888"}},e("WT_SEARCH_DRIVER_BY_ID")),i.createElement("div",{style:{position:"relative"}},i.createElement("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},"🔍"),i.createElement("input",{type:"text",placeholder:e("WT_SEARCH_DRIVER_BY_ID"),value:p,onChange:e=>E(e.target.value),style:{width:"100%",padding:"10px 10px 10px 36px",border:"1px solid #e0e0e0",borderRadius:"8px",fontSize:"12px",outline:"none",background:"#f8f9fa",boxSizing:"border-box"}})))),i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"}},i.createElement("div",{style:{display:"flex",gap:"8px"}},["all","online","offline"].map(e=>i.createElement("button",{key:e,onClick:()=>g(e),style:{padding:"4px 12px",borderRadius:"4px",background:f===e?"#667eea":"transparent",color:f===e?"white":"#666",border:f===e?"none":"1px solid #e0e0e0",cursor:"pointer",fontSize:"12px",fontWeight:"600",textTransform:"capitalize"}},e))),i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},i.createElement("input",{type:"checkbox",id:"showRoutes",checked:_,onChange:e=>h(e.target.checked),style:{cursor:"pointer"}}),i.createElement("label",{htmlFor:"showRoutes",style:{fontSize:"12px",color:"#666",cursor:"pointer"}},"Routes"))),i.createElement("div",{style:{flex:1,overflowY:"auto",padding:"4px",marginTop:"8px",display:"flex",flexDirection:"column",gap:"12px"}},0===F.length?i.createElement("div",{style:{textAlign:"center",padding:"40px 20px",color:"#999"}},i.createElement("p",null,e("WT_NO_DRIVERS_FOUND"))):F.map(e=>i.createElement(pe,{key:e.driverId,driver:e,isSelected:(null==m?void 0:m.driverId)===e.driverId,vendorList:R,onClick:()=>{v(e),A&&C(!1)}})))))),i.createElement("div",{style:{flex:1,position:"relative",background:"white",borderRadius:"12px",overflow:"hidden",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},i.createElement(s.MapContainer,{center:S,zoom:b,style:{height:"100%",width:"100%"},zoomControl:!1},i.createElement(s.TileLayer,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),i.createElement(se,{selectedDriver:m,mapZoom:b,mapCenter:S}),F.filter(e=>e.driverId!==(null==m?void 0:m.driverId)).map(e=>i.createElement(s.Marker,{key:e.driverId,position:[Number(e.lat),Number(e.lng)],icon:e.isOnline?ae:re,eventHandlers:{click:()=>{v(e)}}})),m&&null!=m.lat&&null!=m.lng&&i.createElement(s.Marker,{key:m.driverId,position:[Number(m.lat),Number(m.lng)],icon:m.isOnline?ae:re},i.createElement(s.Popup,null,i.createElement("div",{style:{minWidth:A?"200px":"250px",padding:"8px"}},i.createElement("div",{style:{fontWeight:"bold",fontSize:A?"14px":"16px",color:"#667eea",marginBottom:"8px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},"Driver #",m.driverId.substring(0,8),"... (Selected)"),i.createElement("div",{style:{marginBottom:"8px"}},i.createElement(ve,{isOnline:m.isOnline})),i.createElement("div",{style:{fontSize:A?"12px":"13px"}},i.createElement("div",{style:{marginBottom:"8px"}},i.createElement("strong",null,"Current Location"),i.createElement("div",null,i.createElement(de,{lat:m.lat,lng:m.lng}))),m.deliveryLat&&m.deliveryLng&&i.createElement("div",{style:{marginBottom:"8px"}},i.createElement("strong",null,e("DELIVERY_DESTINATION")),i.createElement("div",null,i.createElement(de,{lat:m.deliveryLat,lng:m.deliveryLng}))),i.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",background:"#f5f5f5",padding:"8px",borderRadius:"4px",marginTop:"8px"}},m.speed&&i.createElement(i.Fragment,null,i.createElement("span",null,e("WT_SPEED"),":"),i.createElement("span",null,(3.6*m.speed).toFixed(1)," ",e("WT_KM_PER_HOUR"))),m.heading&&i.createElement(i.Fragment,null,i.createElement("span",null,e("WT_HEADING"),":"),i.createElement("span",null,Math.round(m.heading),"°")),m.accuracy&&i.createElement(i.Fragment,null,i.createElement("span",null,e("WT_ACCURACY"),":"),i.createElement("span",null,Math.round(m.accuracy),"m"))),m.lastUpdate&&i.createElement("div",{style:{marginTop:"8px",color:"#666",fontSize:"10px"}},e("WT_LAST_UPDATE"),": ",new Date(m.lastUpdate).toLocaleString()))))),m&&null!=m.deliveryLat&&null!=m.deliveryLng&&i.createElement(s.Marker,{key:"dest-"+m.driverId,position:[Number(m.deliveryLat),Number(m.deliveryLng)],icon:ue}),_&&m&&m.lat&&m.lng&&m.deliveryLat&&m.deliveryLng&&i.createElement(ce,{start:{lat:m.lat,lng:m.lng},end:{lat:m.deliveryLat,lng:m.deliveryLng},color:"#2196f3",weight:6})),i.createElement("div",{style:{position:"absolute",top:A?"60px":"20px",right:"10px",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",padding:"4px",display:"flex",flexDirection:A?"column":"row",gap:"4px"}},m&&i.createElement(i.Fragment,null,i.createElement("button",{onClick:()=>{if(null!=m&&m.lat&&null!=m&&m.lng){const e=[Number(m.lat),Number(m.lng)];T(e),y(15)}},style:{padding:A?"10px 12px":"8px 16px",background:"#667eea",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:A?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CENTER")),i.createElement("button",{onClick:()=>v(null),style:{padding:A?"10px 12px":"8px 16px",background:"#f44336",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:A?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CLEAR"))),!m&&i.createElement("div",{style:{padding:A?"10px 12px":"8px 16px",background:"#f5f5f5",color:"#666",borderRadius:"4px",fontSize:A?"12px":"14px"}},A?"Select driver":"Select a driver from the list")),m&&i.createElement("div",{style:{position:"absolute",bottom:A?"10px":"20px",left:A?"10px":"20px",right:A?"10px":"auto",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:A?"12px":"16px",maxWidth:A?"calc(100% - 20px)":"300px",border:"2px solid #2196f3"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},i.createElement("h4",{style:{margin:0,color:"#667eea",fontSize:A?"14px":"16px"}},e("WT_SELECTED_DRIVER")),i.createElement(ve,{isOnline:m.isOnline})),i.createElement("div",{style:{fontSize:A?"12px":"13px"}},i.createElement("div",null,i.createElement("strong",null,e("WT_ID"),":")," ",m.driverId.substring(0,6).toUpperCase(),"..."),i.createElement("div",null,i.createElement("strong",null,e("WT_LOCATION"),":")," ",i.createElement(de,{lat:m.lat,lng:m.lng})),m.speed&&i.createElement("div",null,i.createElement("strong",null,e("WT_SPEED"),":")," ",Math.round(3.6*m.speed)," ",e("km/h")),m.lastSeen&&i.createElement("div",null,i.createElement("strong",null,e("WT_LAST_SEEN"),":")," ",new Date(m.lastSeen).toLocaleTimeString()))),i.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",zIndex:1e3,display:"flex",flexDirection:"column",gap:"8px"}},i.createElement("button",{onClick:()=>y(e=>e+1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"+"),i.createElement("button",{onClick:()=>y(e=>e-1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"−")),i.createElement("div",{style:{position:"absolute",top:"20px",right:"20px",zIndex:1e3,display:"flex",gap:"12px"}}))))}const fe=e=>{let{t:t,formData:n={},onSelect:o,config:a={},visibleFields:r=[]}=e;const u=(null==a?void 0:a.key)||"metaData",d=[{label:"WT_FILLING_POINT_NAME",name:"fillingPointName",isMandatory:!0},{label:"WT_AE_NAME",name:"aeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_AE_MOBILE_NUMBER",name:"aeMobile",isMandatory:!0,componentInFront:i.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_AE_EMAIL_ID",name:"aeEmail",isMandatory:!0,validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_JE_NAME",name:"jeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_JE_MOBILE_NUMBER",name:"jeMobile",isMandatory:!0,componentInFront:i.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_JE_EMAIL_ID",name:"jeEmail",isMandatory:!0,validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_EE_NAME",name:"eeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_EE_MOBILE_NUMBER",name:"eeMobile",isMandatory:!0,componentInFront:i.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_EE_EMAIL_ID",name:"eeEmail",isMandatory:!0,validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}}],s=r&&r.length>0?d.filter(e=>r.includes(e.name)):d,c=window.Digit.Utils.browser.isMobile();return i.createElement(l.Card,{className:"formcomposer-section-grid"},i.createElement(l.CardSubHeader,{style:{gridColumn:"span 2",marginBottom:c?"0px":"10px"}},t("WT_FILLING_POINT_APPLICANT_DETAILS")),s.map(e=>{var a,r;return i.createElement("div",{key:e.name},i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,{className:"card-label-smaller"},t(e.label),e.isMandatory?" *":""),i.createElement("div",{style:{display:"flex"}},e.componentInFront||null,i.createElement(l.TextInput,p({value:(null==n||null===(a=n[u])||void 0===a?void 0:a[e.name])||"",onChange:t=>((e,t)=>{if(!o)return;let l=e;["aeMobile","jeMobile","eeMobile","alternateNumber"].includes(t)&&(l=e.slice(0,10).replace(/[^0-9]/g,"")),o(u,{...null==n?void 0:n[u],[t]:l})})(t.target.value,e.name),maxLength:null===(r=e.validation)||void 0===r?void 0:r.maxLength},e.validation)))))}))},ge=[{name:"Correspondence",code:"CORRESPONDENCE",i18nKey:"COMMON_ADDRESS_TYPE_CORRESPONDENCE"},{name:"Permanent",code:"PERMANENT",i18nKey:"COMMON_ADDRESS_TYPE_PERMANENT"},{name:"Other",code:"OTHER",i18nKey:"COMMON_ADDRESS_TYPE_OTHER"}],_e=e=>{var t,o,r,d,s,c,m,v,p,E,f,g,_;let{t:h,config:S,formData:T,onSelect:b,isEdit:y,userDetails:N}=e;const{data:C}=Digit.Hooks.useTenants(),{control:A}=u.useForm(),I=(null===(t=a.useLocation().state)||void 0===t?void 0:t.usedAddressTypes)||[],[D,x]=n.useState((null==T||null===(o=T.address)||void 0===o?void 0:o.pincode)||""),[O,L]=n.useState((null==T||null===(r=T.address)||void 0===r?void 0:r.city)||null),[w,P]=n.useState((null==T||null===(d=T.address)||void 0===d?void 0:d.locality)||null),[R,k]=n.useState((null==T||null===(s=T.address)||void 0===s?void 0:s.houseNo)||""),[M,F]=n.useState((null==T||null===(c=T.address)||void 0===c?void 0:c.streetName)||""),[B,U]=n.useState((null==T||null===(m=T.address)||void 0===m?void 0:m.landmark)||""),[W,H]=n.useState((null==T||null===(v=T.address)||void 0===v?void 0:v.addressLine1)||""),[j,z]=n.useState((null==T||null===(p=T.address)||void 0===p?void 0:p.addressLine2)||""),[V,G]=n.useState((null==T||null===(E=T.address)||void 0===E?void 0:E.addressType)||null),[K,Y]=n.useState((null==T||null===(f=T.address)||void 0===f?void 0:f.latitude)||""),[$,q]=n.useState((null==T||null===(g=T.address)||void 0===g?void 0:g.longitude)||""),[X,Q]=n.useState(""),Z=n.useRef(!y),J=n.useRef(null),ee=n.useRef(null),te=n.useMemo(()=>ge.filter(3===I.length?e=>"OTHER"===e.code:e=>!I.includes(e.code)),[I]),{data:le}=Digit.Hooks.useBoundaryLocalities(null==O?void 0:O.code,"revenue",{enabled:!!O},h),ne=(null==le?void 0:le.map(e=>({i18nKey:e.i18nkey,code:e.code,label:e.label})))||[];n.useEffect(()=>{var e;const t=(null==T?void 0:T.id)||(null==T?void 0:T.bookingId)||(null==T||null===(e=T.address)||void 0===e?void 0:e.id);if(t&&ee.current!==t&&(Z.current=!1,ee.current=t),null!=T&&T.address&&!Z.current&&C){const e=T.address,t=C.find(t=>t.code===e.cityCode||t.code===e.city||t.name===e.city)||e.city;if(t&&(!O||O.code!==t.code&&O!==t)&&L(t||null),x(e.pincode||""),k(e.houseNo||""),F(e.streetName||""),U(e.landmark||""),H(e.addressLine1||""),z(e.addressLine2||""),G(ge.find(t=>t.code===e.addressType)||e.addressType||null),Y(e.latitude||""),q(e.longitude||""),le||!e.cityCode){if(le){const t=le.find(t=>t.code===e.localityCode||t.code===e.locality||t.i18nkey===e.locality);P(t||e.locality||null)}else P(e.locality||null);Z.current=!0,J.current=JSON.stringify(e)}else console.log("AddFixFillAddress: Waiting for localities to load for city:",null==t?void 0:t.code)}},[null==T?void 0:T.address,O,C,le]),n.useEffect(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{Y(e.coords.latitude),q(e.coords.longitude)},()=>console.log("Location blocked"))},[]),n.useEffect(()=>{X&&Object.keys(X).length&&(x(X.pinCode),L(null==C?void 0:C.find(e=>e.name===X.city)),P(null==le?void 0:le.find(e=>e.i18nkey===X.locality)),k(X.houseNumber),F(X.streetName),U(X.landmark),H(X.address),z(X.address2),Y(X.latitude),q(X.longitude),G(ge.find(e=>e.code===X.addressType)))},[X]),n.useEffect(()=>{if(!b||!Z.current)return;const e={pincode:D||"",city:(null==O?void 0:O.code)||O||null,locality:(null==w?void 0:w.code)||w||null,houseNo:R||"",landmark:B||"",addressLine1:W||"",addressLine2:j||"",streetName:M||"",addressType:(null==V?void 0:V.code)||V||null,latitude:K||"",longitude:$||""},t=JSON.stringify(e);J.current!==t&&(J.current=t,b((null==S?void 0:S.key)||"address",e))},[D,O,w,R,B,W,j,M,V,K,$]);const ie=window.Digit.Utils.browser.isMobile();return i.createElement(l.Card,{className:"formcomposer-section-grid"},i.createElement(l.CardSubHeader,{style:{gridColumn:"span 2",marginBottom:ie?"0px":"10px"}},h("WT_ADDRESS_DETAILS")),(null==N||null===(_=N.addresses)||void 0===_?void 0:_.length)>0&&i.createElement("div",{style:{gridColumn:"span 2"}},i.createElement(l.CardLabel,null,h("COMMON_ADDRESS_TYPE")),i.createElement(l.Dropdown,{selected:X,select:Q,option:N.addresses,optionKey:"address",t:h,style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("COMMON_ADDRESS_TYPE")),i.createElement(l.Dropdown,{selected:V,select:G,option:te,optionKey:"i18nKey",t:h,style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("HOUSE_NO"),i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:R,onChange:e=>k(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("STREET_NAME")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:M,onChange:e=>F(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("ADDRESS_LINE1")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:W,onChange:e=>H(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("ADDRESS_LINE2")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:j,onChange:e=>z(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("LANDMARK")),i.createElement(l.TextInput,{value:B,onChange:e=>U(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("CITY")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(u.Controller,{control:A,name:"city",render:()=>i.createElement(l.Dropdown,{selected:O,select:L,option:C,optionKey:"i18nKey",t:h})})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("LOCALITY")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(u.Controller,{control:A,name:"locality",render:()=>i.createElement(l.Dropdown,{selected:w,select:P,option:ne,optionKey:"i18nKey",t:h})})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("LATITUDE")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:K,onChange:e=>Y(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("LONGITUDE")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:$,onChange:e=>q(e.target.value)})),i.createElement("div",null,i.createElement(l.CardLabel,null,h("PINCODE")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.TextInput,{value:D,onChange:e=>x(e.target.value),maxLength:6})))},he=()=>{var e,t,r,u,d,s,c,m,p,E,f,g,_,h,S,T,b,y;const{t:N}=o.useTranslation(),C=a.useLocation(),A=a.useHistory(),I=new URLSearchParams(C.search).get("id"),[D,x]=n.useState({}),[O,L]=n.useState(null),w=Digit.ULBService.getCurrentTenantId(),{isLoading:P,data:R}=Digit.Hooks.wt.useFillPointSearch({tenantId:w,filters:{id:I}},{enabled:!!I});n.useEffect(()=>{if(I&&null!=R&&R.fillingPoints){const e=R.fillingPoints.find(e=>e.id===I);e&&x({id:e.id,tenantId:e.tenantId,owner:{fillingPointName:e.fillingPointName,emergencyName:e.emergencyName,aeName:e.aeName,aeMobile:e.aeMobile,aeEmail:e.aeEmail,jeName:e.jeName,jeMobile:e.jeMobile,jeEmail:e.jeEmail,eeName:e.eeName,eeMobile:e.eeMobile,eeEmail:e.eeEmail},address:{...e.address}})}},[R,I]);const{mutate:k}=Digit.Hooks.wt.useCreateFillPoint(w),{mutate:M}=Digit.Hooks.wt.useUpdateFillPoint(w),F=window.Digit.Utils.browser.isMobile(),B=!(null!=D&&null!==(e=D.owner)&&void 0!==e&&e.aeName&&null!=D&&null!==(t=D.owner)&&void 0!==t&&t.aeMobile&&null!=D&&null!==(r=D.owner)&&void 0!==r&&r.aeEmail&&null!=D&&null!==(u=D.owner)&&void 0!==u&&u.jeName&&null!=D&&null!==(d=D.owner)&&void 0!==d&&d.jeMobile&&null!=D&&null!==(s=D.owner)&&void 0!==s&&s.jeEmail&&null!=D&&null!==(c=D.owner)&&void 0!==c&&c.eeName&&null!=D&&null!==(m=D.owner)&&void 0!==m&&m.eeMobile&&null!=D&&null!==(p=D.owner)&&void 0!==p&&p.eeEmail&&null!=D&&null!==(E=D.address)&&void 0!==E&&E.houseNo&&null!=D&&null!==(f=D.address)&&void 0!==f&&f.streetName&&null!=D&&null!==(g=D.address)&&void 0!==g&&g.addressLine1&&null!=D&&null!==(_=D.address)&&void 0!==_&&_.addressLine2&&null!=D&&null!==(h=D.address)&&void 0!==h&&h.city&&null!=D&&null!==(S=D.address)&&void 0!==S&&S.locality&&null!=D&&null!==(T=D.address)&&void 0!==T&&T.latitude&&null!=D&&null!==(b=D.address)&&void 0!==b&&b.longitude&&null!=D&&null!==(y=D.address)&&void 0!==y&&y.pincode);return P?i.createElement(l.Loader,null):i.createElement("div",{className:"employee-form-section-wrapper"},i.createElement(v,{config:[{timeLine:[{actions:"Add Filling Point",currentStep:1}]}],showFinalStep:!1}),i.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},i.createElement(fe,{t:N,config:{key:"owner"},onSelect:(e,t)=>{x(l=>({...l,[e]:t}))},formData:D,visibleFields:["fillingPointName","emergencyName","aeName","aeMobile","aeEmail","jeName","jeMobile","jeEmail","eeName","eeMobile","eeEmail"]}),i.createElement(_e,{t:N,config:{key:"address"},onSelect:(e,t)=>{x(l=>({...l,[e]:{...l[e]||{},...t}}))},formData:D,isEdit:!!I}),i.createElement("div",{style:{display:"flex",marginBottom:"24px",justifyContent:F?"center":"flex-end"}},i.createElement(l.SubmitBar,{label:N(I?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{e&&e.preventDefault&&e.preventDefault();const t=(l={...D,tenantId:w},{RequestInfo:{userInfo:{uuid:(null===(n=Digit.UserService.getUser())||void 0===n||null===(i=n.info)||void 0===i?void 0:i.uuid)||"user-123"}},fillingPoints:[{id:null==l?void 0:l.id,bookingId:null==l?void 0:l.bookingId,tenantId:null==l?void 0:l.tenantId,fillingPointName:null==l||null===(o=l.owner)||void 0===o?void 0:o.fillingPointName,emergencyName:null==l||null===(a=l.owner)||void 0===a?void 0:a.emergencyName,eeName:null==l||null===(r=l.owner)||void 0===r?void 0:r.eeName,eeEmail:null==l||null===(u=l.owner)||void 0===u?void 0:u.eeEmail,eeMobile:null==l||null===(d=l.owner)||void 0===d?void 0:d.eeMobile,aeName:null==l||null===(s=l.owner)||void 0===s?void 0:s.aeName,aeEmail:null==l||null===(c=l.owner)||void 0===c?void 0:c.aeEmail,aeMobile:null==l||null===(m=l.owner)||void 0===m?void 0:m.aeMobile,jeName:null==l||null===(v=l.owner)||void 0===v?void 0:v.jeName,jeEmail:null==l||null===(p=l.owner)||void 0===p?void 0:p.jeEmail,jeMobile:null==l||null===(E=l.owner)||void 0===E?void 0:E.jeMobile,address:{houseNo:null==l||null===(f=l.address)||void 0===f?void 0:f.houseNo,streetName:null==l||null===(g=l.address)||void 0===g?void 0:g.streetName,addressLine1:null==l||null===(_=l.address)||void 0===_?void 0:_.addressLine1,addressLine2:null==l||null===(h=l.address)||void 0===h?void 0:h.addressLine2,landmark:null==l||null===(S=l.address)||void 0===S?void 0:S.landmark,city:(null==l||null===(T=l.address)||void 0===T||null===(b=T.city)||void 0===b?void 0:b.name)||(null==l||null===(y=l.address)||void 0===y?void 0:y.city)||"",cityCode:(null==l||null===(C=l.address)||void 0===C?void 0:C.cityCode)||(null==l||null===(x=l.address)||void 0===x||null===(O=x.city)||void 0===O?void 0:O.code)||"",locality:(null==l||null===(P=l.address)||void 0===P?void 0:P.localityCode)||(null==l||null===(R=l.address)||void 0===R||null===(F=R.locality)||void 0===F?void 0:F.code)||"",localityCode:(null==l||null===(B=l.address)||void 0===B?void 0:B.localityCode)||(null==l||null===(U=l.address)||void 0===U||null===(W=U.locality)||void 0===W?void 0:W.code)||"",pincode:null==l||null===(H=l.address)||void 0===H?void 0:H.pincode,latitude:null==l||null===(j=l.address)||void 0===j?void 0:j.latitude,longitude:null==l||null===(z=l.address)||void 0===z?void 0:z.longitude,type:"FILLING-POINT"}}]});var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,C,x,O,P,R,F,B,U,W,H,j,z;(I?M:k)(t,{onSuccess:()=>{L({label:N(I?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),setTimeout(()=>{L(null),A.push("/digit-ui/employee/wt/search-filling-fix-point")},3e3)},onError:e=>{var t,l,n,i;L({label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||N(I?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR"),isError:!0}),setTimeout(()=>L(null),5e3)}})},disabled:B}))),O&&i.createElement(l.Toast,{error:O.isError,label:O.label,onClose:()=>L(null)}))},Se=()=>{var e,t,u,d,s,c,m,p,E,f,g,_,h,S,T,b;const{t:y}=o.useTranslation(),N=a.useLocation(),C=a.useHistory(),A=r.useQueryClient(),I=new URLSearchParams(N.search).get("id"),[D,x]=n.useState({}),[O,L]=n.useState(null),w=Digit.ULBService.getCurrentTenantId(),P=i.useMemo(()=>({tenantId:w,filters:{id:I}}),[w,I]),R=i.useMemo(()=>({enabled:!!I}),[I]),{isLoading:k,data:M}=Digit.Hooks.wt.useFixedPointSearchAPI(P,R),[F,B]=n.useState(!1);n.useEffect(()=>{if(I&&null!=M&&M.waterTankerBookingDetail&&!F){const r=M.waterTankerBookingDetail.find(e=>{var t;return(null===(t=e.applicantDetail)||void 0===t?void 0:t.applicantId)===I});var e,t,l,n,i,o,a;r&&(x({owner:{name:null===(e=r.applicantDetail)||void 0===e?void 0:e.name,mobileNumber:null===(t=r.applicantDetail)||void 0===t?void 0:t.mobileNumber,alternateNumber:null===(l=r.applicantDetail)||void 0===l?void 0:l.alternateNumber,emailId:null===(n=r.applicantDetail)||void 0===n?void 0:n.emailId,applicantId:null===(i=r.applicantDetail)||void 0===i?void 0:i.applicantId},address:{...r.address,addressId:null===(o=r.address)||void 0===o?void 0:o.addressId,applicantId:null===(a=r.address)||void 0===a?void 0:a.applicantId},bookingId:r.bookingId,bookingNo:r.bookingNo,auditDetails:r.auditDetails}),B(!0))}},[M,I,F]);const U=i.useMemo(()=>({key:"address"}),[]),W=i.useCallback((e,t)=>{x(l=>({...l,[e]:{...l[e]||{},...t}}))},[]),{mutate:H}=Digit.Hooks.wt.useCreateFixedPoint(w),{mutate:j}=Digit.Hooks.wt.useUpdateFixedPoint(w),z=window.Digit.Utils.browser.isMobile(),V=!(null!=D&&null!==(e=D.owner)&&void 0!==e&&e.name&&null!=D&&null!==(t=D.owner)&&void 0!==t&&t.mobileNumber&&null!=D&&null!==(u=D.owner)&&void 0!==u&&u.emailId&&null!=D&&null!==(d=D.address)&&void 0!==d&&d.houseNo&&null!=D&&null!==(s=D.address)&&void 0!==s&&s.streetName&&null!=D&&null!==(c=D.address)&&void 0!==c&&c.addressLine1&&null!=D&&null!==(m=D.address)&&void 0!==m&&m.addressLine2&&null!=D&&null!==(p=D.address)&&void 0!==p&&p.city&&null!=D&&null!==(E=D.address)&&void 0!==E&&E.locality&&null!=D&&null!==(f=D.address)&&void 0!==f&&f.latitude&&null!=D&&null!==(g=D.address)&&void 0!==g&&g.longitude&&null!=D&&null!==(_=D.address)&&void 0!==_&&_.pincode);return k?i.createElement(l.Loader,null):i.createElement("div",{className:"employee-form-section-wrapper"},i.createElement(v,{config:[{timeLine:[{actions:"Add Fixed Point",currentStep:1}]}],showFinalStep:!1}),i.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},i.createElement(l.Card,{className:"formcomposer-section-grid"},i.createElement(l.CardSubHeader,{style:{gridColumn:"span 2",marginBottom:z?"0px":"10px"}},y("WT_FIXING_POINT_APPLICANT_DETAILS")),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("WT_FIXING_POINT_APPLICANT_DETAILS")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:y,type:"text",name:"name",value:null==D||null===(h=D.owner)||void 0===h?void 0:h.name,style:{width:"100%"},onChange:e=>W("owner",{name:e.target.value})})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("COMMON_MOBILE_NUMBER")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.MobileNumber,{value:null==D||null===(S=D.owner)||void 0===S?void 0:S.mobileNumber,name:"mobileNumber",onChange:e=>W("owner",{mobileNumber:e}),style:{width:"100%"}})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("COMMON_EMAIL_ID")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:y,type:"email",name:"emailId",value:null==D||null===(T=D.owner)||void 0===T?void 0:T.emailId,style:{width:"100%"},onChange:e=>W("owner",{emailId:e.target.value})})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("COMMON_ALT_MOBILE_NUMBER")),i.createElement(l.MobileNumber,{value:null==D||null===(b=D.owner)||void 0===b?void 0:b.alternateNumber,name:"alternateNumber",onChange:e=>W("owner",{alternateNumber:e}),style:{width:"100%"}}))),i.createElement("div",null,i.createElement(_e,{t:y,config:U,onSelect:W,formData:D,isEdit:!!I})),i.createElement("div",{style:{display:"flex",justifyContent:z?"center":"flex-end"}},i.createElement(l.SubmitBar,{label:y(I?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{console.log("Submitting Form Data:",D);const t={waterTankerBookingDetail:{bookingId:(null==(l={...D,tenantId:w})?void 0:l.bookingId)||"",bookingNo:(null==l?void 0:l.bookingNo)||null,tenantId:null==l?void 0:l.tenantId,mobileNumber:(null==l||null===(n=l.owner)||void 0===n?void 0:n.mobileNumber)||"",applicantDetail:{applicantId:(null==l||null===(i=l.owner)||void 0===i?void 0:i.applicantId)||null,bookingId:(null==l?void 0:l.bookingId)||"",name:(null==l||null===(o=l.owner)||void 0===o?void 0:o.name)||(null==l||null===(a=l.owner)||void 0===a?void 0:a.applicantName)||"",mobileNumber:(null==l||null===(r=l.owner)||void 0===r?void 0:r.mobileNumber)||"",alternateNumber:(null==l||null===(u=l.owner)||void 0===u?void 0:u.alternateNumber)||"",emailId:(null==l||null===(d=l.owner)||void 0===d?void 0:d.emailId)||"",type:"FIXED-POINT"},address:{addressId:(null==l||null===(s=l.address)||void 0===s?void 0:s.addressId)||null,applicantId:(null==l||null===(c=l.address)||void 0===c?void 0:c.applicantId)||null,houseNo:(null==l||null===(m=l.address)||void 0===m?void 0:m.houseNo)||"",streetName:(null==l||null===(v=l.address)||void 0===v?void 0:v.streetName)||"",addressLine1:(null==l||null===(p=l.address)||void 0===p?void 0:p.addressLine1)||"",addressLine2:(null==l||null===(E=l.address)||void 0===E?void 0:E.addressLine2)||"",landmark:(null==l||null===(f=l.address)||void 0===f?void 0:f.landmark)||"",city:(null==l||null===(g=l.address)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name)||(null==l||null===(h=l.address)||void 0===h?void 0:h.city)||"",cityCode:(null==l||null===(S=l.address)||void 0===S?void 0:S.cityCode)||(null==l||null===(T=l.address)||void 0===T||null===(b=T.city)||void 0===b?void 0:b.code)||"DJB",locality:(null==l||null===(N=l.address)||void 0===N||null===(x=N.locality)||void 0===x?void 0:x.label)||(null==l||null===(O=l.address)||void 0===O||null===(P=O.locality)||void 0===P?void 0:P.name)||(null==l||null===(R=l.address)||void 0===R?void 0:R.locality)||"",localityCode:(null==l||null===(k=l.address)||void 0===k||null===(M=k.locality)||void 0===M?void 0:M.code)||(null==l||null===(F=l.address)||void 0===F?void 0:F.localityCode)||"",latitude:(null==l||null===(B=l.address)||void 0===B?void 0:B.latitude)||"",longitude:(null==l||null===(U=l.address)||void 0===U?void 0:U.longitude)||"",pincode:(null==l||null===(W=l.address)||void 0===W?void 0:W.pincode)||"",type:"FIXED-POINT"}}};var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,N,x,O,P,R,k,M,F,B,U,W;console.log("Generated Payload:",t),(I?j:H)(t,{onSuccess:()=>{L({label:y(I?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),A.invalidateQueries("wtFixedPointSearchList"),setTimeout(()=>{L(null),C.push("/digit-ui/employee/wt/search-filling-fix-point")},3e3)},onError:e=>{var t,l,n,i;console.error("Mutation Error:",e),L({label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||y(I?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR"),isError:!0}),setTimeout(()=>L(null),5e3)}})},disabled:V}))),O&&i.createElement(l.Toast,{error:O.isError,label:O.label,onClose:()=>L(null)}))},Te=e=>{var t,o;let{t:a,closeModal:r,onSubmit:u,initialValues:d,tenantId:s,modalMode:c}=e;const m="VIEW"===c,v="UPDATE"===c,[p,E]=n.useState(null),[f,g]=n.useState([]),{data:_,isLoading:h}=Digit.Hooks.hrms.useHrmsMDMS(s,"egov-location","HRMSRolesandDesignation"),S=((null===(T=(null==_?void 0:_.MdmsRes)||_)||void 0===T||null===(b=T["egov-location"])||void 0===b?void 0:b.TenantBoundary)||[]).map(e=>({i18nKey:e.hierarchyType.name||e.hierarchyType.code||e.hierarchyType,code:e.hierarchyType.code||e.hierarchyType,boundary:e.boundary}));var T,b;i.useEffect(()=>{S.length>0&&!p&&E(S[0])},[S,p]);const y=function(e,t){return void 0===t&&(t=[]),e?(("Locality"===e.label||e.children&&0===e.children.length&&e.code)&&t.push({name:e.localname||e.name,code:e.code,i18nKey:e.code}),e.children&&e.children.forEach(e=>y(e,t)),t):t},N=n.useMemo(()=>p&&p.boundary?y(p.boundary):[],[p]);return i.useEffect(()=>{var e,t;if(N.length>0&&((null==d||null===(e=d.fillingPointLocalityCodes)||void 0===e?void 0:e.length)>0||null!=d&&null!==(t=d.address)&&void 0!==t&&t.locality)&&(m||v)){var l;const e=(null==d||null===(l=d.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?d.fillingPointLocalityCodes:d.address.locality.split(",").map(e=>e.trim()),t=N.filter(t=>e.includes(t.code)).map(e=>[e.i18nKey,e]);g(t)}},[N,d,m,v]),h?i.createElement(l.Loader,null):i.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},i.createElement("style",null,"\n .custom-modal-content {\n background-color: #fff;\n border-radius: 8px;\n width: 50%;\n max-width: 600px;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n position: relative;\n }\n @media (max-width: 768px) {\n .custom-modal-content {\n width: 90%;\n }\n }\n "),i.createElement("div",{className:"custom-modal-content"},i.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},a(m?"WT_VIEW_LOCALITY":v?"WT_UPDATE_LOCALITY":"WT_ADD_TO_LOCALITY")),i.createElement("button",{onClick:r,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),i.createElement("div",{style:{padding:"24px"}},i.createElement("div",{style:{marginBottom:"16px"}},i.createElement(l.CardLabel,null,a("WT_CURRENT_LOCALITY")),i.createElement("div",{style:{fontWeight:"600",marginBottom:"8px"}},(null==d||null===(t=d.fillingPointLocalityCodes)||void 0===t?void 0:t.length)>0?d.fillingPointLocalityCodes.join(", "):(null==d||null===(o=d.address)||void 0===o?void 0:o.locality)||"NA")),m?i.createElement("div",{style:{marginBottom:"16px"}},i.createElement(l.CardLabel,null,a("WT_SELECTED_LOCALITIES")),i.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"8px"}},(null==f?void 0:f.length)>0?f.map((e,t)=>i.createElement("span",{key:t,style:{background:"#f4f4f4",border:"1px solid #ddd",borderRadius:"20px",padding:"4px 12px",fontSize:"14px",color:"#333"}},a(e[1].i18nKey)," (",e[1].code,")")):null)):i.createElement("div",{style:{marginBottom:"16px"}},i.createElement(l.CardLabel,null,a("WT_SELECT_NEW_LOCALITY")),i.createElement(l.MultiSelectDropdown,{options:N,optionsKey:"i18nKey",selected:f,onSelect:e=>{m||g(e)},t:a,disabled:!p||m}),(null==f?void 0:f.length)>0&&i.createElement("div",{style:{marginTop:"8px",fontSize:"14px",color:"#666"}},i.createElement("strong",null,a("WT_LOCALITY_CODES"),":")," ",f.map(e=>e[1].code).join(", ")))),i.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},i.createElement("button",{onClick:r,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_CANCEL")),!m&&i.createElement("button",{onClick:()=>{u({hierarchyType:p,locality:f.map(e=>e[1])})},style:{padding:"8px 20px",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_SAVE")))))},be=()=>{const{t:e}=o.useTranslation(),t=a.useHistory(),[r,u]=n.useState("FIXED_POINT"),[d,s]=n.useState(!1),[c,m]=n.useState(""),[v,p]=n.useState(""),[E,f]=n.useState(null),[g,_]=n.useState(null),[h,S]=n.useState(null),[T,b]=n.useState({}),[y,N]=n.useState(null),[C,A]=n.useState(!1),[I,D]=n.useState(null),[x,O]=n.useState("ADD"),[w,P]=n.useState(50),[R,k]=n.useState(0),M=Digit.ULBService.getCurrentTenantId(),F=()=>{N(null)},{isLoading:B,data:U,refetch:W}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:M,filters:{...T,offset:R,limit:w}},{enabled:"FIXED_POINT"===r}),{isLoading:H,data:z,refetch:V}=Digit.Hooks.wt.useFillPointSearch({tenantId:M,filters:{...T,offset:R,limit:w}},{enabled:"FILLING_POINT"===r}),{isLoading:G,data:K}=Digit.Hooks.wt.useFillPointSearch({tenantId:M,filters:{limit:1e3}},{enabled:!0}),Y=(null==K?void 0:K.fillingPoints)||[],{mutate:$}=Digit.Hooks.wt.useVendorFillingMapping(M),q="FIXED_POINT"===r?B:H,X=i.useMemo(()=>{let e=("FIXED_POINT"===r?null==U?void 0:U.waterTankerBookingDetail:null==z?void 0:z.fillingPoints)||[];return"FIXED_POINT"===r&&null!=h&&h.code&&(e=e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===h.code?!!o:"UNMAPPED"!==h.code||!o})),e},[U,z,r,h]),{label:Q,placeholder:Z}={FIXED_POINT:{label:"WT_FIXING_POINT_APPLICANT_DETAILS",placeholder:"WT_ENTER_FIXED_POINT_NAME"},FILLING_POINT:{label:"WT_FILLING_POINT_NAME",placeholder:"WT_ENTER_FILLING_POINT_NAME"}}[r],J=()=>{m(""),p(""),f(null),_(null),S(null),b({})},ee=e=>{u(e),J(),k(0),b({})},te=function(e,t){void 0===t&&(t="ADD"),D(e.original),O(t),A(!0)},{mutate:le}=Digit.Hooks.wt.useLinkFillingPointLocality(M),{mutate:ne}=Digit.Hooks.wt.useUpdateFillingPointLocality(M),ie=i.useMemo(()=>"FIXED_POINT"===r?[{Header:e("WT_FIXED_POINT_CODE"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||"NA"},id:"fixedPointId"},{Header:e("WT_FIXING_POINT_APPLICANT_DETAILS"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"},id:"applicantName",Cell:e=>{var t,l;let{row:n}=e;return i.createElement("span",{className:"link"},i.createElement(a.Link,{to:"/digit-ui/employee/wt/add-fix-point-address?id="+(null===(t=n.original.applicantDetail)||void 0===t?void 0:t.applicantId)},(null===(l=n.original.applicantDetail)||void 0===l?void 0:l.name)||"NA"))}},{Header:e("WT_MOBILE_NUMBER"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"},id:"mobileNumber"},{Header:e("WT_LOCALITY"),accessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.locality)||"NA"},id:"locality"},{Header:e("WT_FILLING_POINT"),accessor:e=>{var t;return(null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null==e?void 0:e.fillingPoint)||"NA"},id:"fillingPoint",Cell:t=>{var n,o,a,r;let{row:u}=t;const d=String(u.original.fillingPointId||(null===(n=u.original.fillingpointmetadata)||void 0===n?void 0:n.fillingPointId)||u.original.fillingPtName||u.original.filling_pt_name||(u.original.fillingPoint&&"object"==typeof u.original.fillingPoint?null===(o=u.original.fillingPoint)||void 0===o?void 0:o.id:u.original.fillingPoint)||(null===(a=u.original.fillingPointDetail)||void 0===a?void 0:a.id)||(null===(r=u.original.fillingPointDetail)||void 0===r?void 0:r.bookingId)||""),s=null==Y?void 0:Y.find(e=>{var t;return String(e.id||e.bookingId||e.fillingPointId||e.uuid||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId))===d&&"undefined"!==d&&"null"!==d&&""!==d});return i.createElement(l.Dropdown,{className:"fsm-registry-dropdown",selected:s,option:Y,select:t=>((t,l)=>{var n,i;const o={fixedFillingPointMapping:{fixed_pt_name:null===(n=t.original.applicantDetail)||void 0===n?void 0:n.applicantId,filling_pt_name:l.id||l.bookingId||l.fillingPointId||l.uuid||(null===(i=l.fillingpointmetadata)||void 0===i?void 0:i.fillingPointId)}};$(o,{onSuccess:()=>{N({label:e("WT_FIXED_FILLING_MAPPING_SUCCESS")}),setTimeout(F,5e3),W()},onError:t=>{var l,n,i,o;N({label:(null==t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||e("WT_FIXED_FILLING_MAPPING_FAIL"),error:!0}),setTimeout(F,5e3)}})})(u,t),style:{textAlign:"left"},optionKey:"fillingPointName",t:e})}}]:[{Header:e("WT_FILLING_POINT_CODE"),accessor:e=>(null==e?void 0:e.fillingPointId)||"NA",id:"fillingPointId"},{Header:e("WT_FILLING_POINT_NAME"),accessor:e=>(null==e?void 0:e.fillingPointName)||"NA",id:"fillingPointName",Cell:e=>{let{row:t}=e;return i.createElement("span",{className:"link"},i.createElement(a.Link,{to:"/digit-ui/employee/wt/add-filling-point-address?id="+t.original.id},t.original.fillingPointName||"NA"))}},{Header:e("WT_AE_NAME"),accessor:e=>(null==e?void 0:e.aeName)||"NA",id:"aeName"},{Header:e("WT_JE_NAME"),accessor:e=>(null==e?void 0:e.jeName)||"NA",id:"jeName"},{Header:e("WT_EE_NAME"),accessor:e=>(null==e?void 0:e.eeName)||"NA",id:"eeName"},{Header:e("WT_LOCALITY"),Cell:e=>{var t,l,n,o;let{row:a}=e;const r=(null===(t=a.original)||void 0===t||null===(l=t.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?a.original.fillingPointLocalityCodes.join(", "):(null===(n=a.original)||void 0===n||null===(o=n.address)||void 0===o?void 0:o.locality)||"NA";return i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement("span",null,r))}},{Header:e("WT_ADD_LOCALITY"),Cell:t=>{var n,o,a,r,u,d;let{row:s}=t;const c=(null===(n=s.original)||void 0===n||null===(o=n.fillingPointLocalityCodes)||void 0===o?void 0:o.length)>0||(null===(a=s.original)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.locality)&&"NA"!==(null===(u=s.original)||void 0===u||null===(d=u.address)||void 0===d?void 0:d.locality);return i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},c?i.createElement(i.Fragment,null,i.createElement("button",{onClick:()=>te(s,"VIEW"),style:{cursor:"pointer",background:"#fff",border:"1px solid #1D4E7F",color:"#1D4E7F",borderRadius:"4px",padding:"4px 12px"}},e("CS_COMMON_VIEW")),i.createElement("button",{onClick:()=>te(s,"UPDATE"),style:{cursor:"pointer",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",padding:"4px 12px"}},e("CS_COMMON_UPDATE"))):i.createElement("button",{onClick:()=>te(s,"ADD"),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",background:"#f4f4f4",border:"1px solid #ddd",borderRadius:"4px",padding:"4px 8px"}},i.createElement(l.AddIcon,{styles:{width:"16px",height:"16px"},fill:"#1D4E7F"}),e("CS_COMMON_ADD")))}}],[Y,r,e]),oe=window.Digit.Utils.browser.isMobile(),ae=Number("FIXED_POINT"===r?(null==U?void 0:U.Count)??(null==U?void 0:U.count)??(null==U?void 0:U.totalCount)??0:(null==z?void 0:z.Count)??(null==z?void 0:z.count)??(null==z?void 0:z.totalCount)??0),re=i.useCallback(function(e){return void 0===e&&(e=[]),"FIXED_POINT"===r&&null!=h&&h.code?e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===h.code?!!o:"UNMAPPED"!==h.code||!o}):e},[h,r]),ue=i.useCallback(function(){try{let t=!1;function e(){return re(o)}const l=200;let n=0,i=Number.POSITIVE_INFINITY;const o=[],a=L(function(){return!t&&n<i},void 0,function(){return Promise.resolve("FIXED_POINT"===r?Digit.WTService.SearchFixedPoint({tenantId:M,filters:{...T,offset:n,limit:l}}):Digit.WTService.SearchFillPoint({tenantId:M,filters:{...T,offset:n,limit:l}})).then(function(e){const a="FIXED_POINT"===r?(null==e?void 0:e.waterTankerBookingDetail)||[]:(null==e?void 0:e.fillingPoints)||[];o.push(...a);const u=Number((null==e?void 0:e.Count)??(null==e?void 0:e.count)??(null==e?void 0:e.totalCount));i=Number.isFinite(u)&&u>=0?u:o.length,!a.length||a.length<l?t=!0:n+=a.length})});return Promise.resolve(a&&a.then?a.then(e):e())}catch(e){return Promise.reject(e)}},[re,T,r,M]),de=i.useMemo(()=>"FIXED_POINT"===r?[{Header:e("WT_APPLICANT_NAME"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"}},{Header:e("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"}},{Header:e("WT_LOCALITY"),exportAccessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.locality)||"NA"}},{Header:e("WT_FILLING_POINT"),exportAccessor:e=>{var t,l,n,i;return(null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null!=e&&e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:null==e?void 0:e.fillingPoint)||(null==e||null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null==e||null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId)||"NA"}}]:[{Header:e("WT_FILLING_POINT_NAME"),exportAccessor:e=>(null==e?void 0:e.fillingPointName)||"NA"},{Header:e("WT_AE_NAME"),exportAccessor:e=>(null==e?void 0:e.aeName)||"NA"},{Header:e("WT_JE_NAME"),exportAccessor:e=>(null==e?void 0:e.jeName)||"NA"},{Header:e("WT_EE_NAME"),exportAccessor:e=>(null==e?void 0:e.eeName)||"NA"},{Header:e("WT_LOCALITY"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.fillingPointLocalityCodes)||void 0===t?void 0:t.length)>0?e.fillingPointLocalityCodes.join(", "):(null==e||null===(l=e.address)||void 0===l?void 0:l.locality)||"NA"}}],[r,e]);return i.createElement(i.Fragment,null,i.createElement(l.Card,null,i.createElement("div",{className:"search-tabs-container",style:{flexDirection:oe?"column":"row",gap:oe?"16px":"0"}},i.createElement("div",null,i.createElement("button",{className:"FIXED_POINT"===r?"search-tab-head-selected":"search-tab-head",onClick:()=>ee("FIXED_POINT"),style:{width:oe?"50%":"auto"}},e("WT_FIXED_POINT")),i.createElement("button",{className:"FILLING_POINT"===r?"search-tab-head-selected":"search-tab-head",onClick:()=>ee("FILLING_POINT"),style:{width:oe?"50%":"auto"}},e("WT_FILLING_POINT"))),i.createElement("div",{className:"action-bar-wrap-registry",style:{alignSelf:oe?"flex-end":"auto"}},i.createElement("div",{className:"search-add",onClick:()=>{s(e=>!e)}},e("ES_VENDOR_REGISTRY_INBOX_HEADER_ADD"),i.createElement("div",{className:"search-add-icon"},i.createElement(l.AddIcon,null))),d&&i.createElement(l.Menu,{localeKeyPrefix:"ES_FSM_ACTION_CREATE",options:["FIXED_POINT","FILLING_POINT"],t:e,onSelect:e=>{"FILLING_POINT"===e?t.push("/digit-ui/employee/wt/add-filling-point-address"):"FIXED_POINT"===e&&t.push("/digit-ui/employee/wt/add-fix-point-address"),s(!1)}}))),i.createElement("div",{className:"finance-mainlayout"},i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e(Q)),i.createElement(l.TextInput,{value:c,onChange:e=>m(e.target.value),placeholder:e(Z)})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e("WT_MOBILE_NUMBER")),i.createElement(l.TextInput,{value:v,onChange:e=>p(e.target.value.replace(/\D/g,"").slice(0,10)),placeholder:e("WT_ENTER_MOBILE_NUMBER"),validation:{pattern:/^[6-9]\d{9}$/}})),"FIXED_POINT"===r&&i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e("WT_FIXED_POINT_STATUS")),i.createElement(l.Dropdown,{option:[{i18nKey:"WT_FIXED_POINT_MAPPED",code:"MAPPED"},{i18nKey:"WT_FIXED_POINT_UNMAPPED",code:"UNMAPPED"}],optionKey:"i18nKey",selected:g,select:_,t:e})),"FILLING_POINT"===r&&i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e("WT_FILLING_POINT_DESIGNATION")),i.createElement(l.Dropdown,{option:[{i18nKey:"WT_FILLING_POINT_DESIGNATION_AE",code:"DESIGNATION_AE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_JE",code:"DESIGNATION_JE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_EE",code:"DESIGNATION_EE"}],optionKey:"i18nKey",selected:E,select:f,t:e})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement("span",{className:"generic-button clear-search",onClick:J,style:{alignSelf:"center"}},e("ES_COMMON_CLEAR_SEARCH"))),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement(l.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{const e={..."FILLING_POINT"===r?{fillingPointName:c}:{name:c},mobileNumber:v,status:"FILLING_POINT"===r?null==E?void 0:E.code:null};S(g),b(e),k(0)}})))),i.createElement(l.Card,null,i.createElement(j,{key:(null==Y?void 0:Y.length)>0?"loaded":"loading",data:X,columns:ie,pageSize:w,getCellProps:()=>({style:{padding:"20px 18px",fontSize:"16px"}}),styles:{minWidth:"1200px"},inboxStyles:{overflowX:"auto"},t:e,isLoading:q||G,onPageSizeChange:e=>{P(Number(e.target.value))},currentPage:Math.floor(R/w),onNextPage:()=>{k(e=>e+w)},onPrevPage:()=>{k(e=>e-w)},pageSizeLimit:w,totalRecords:ae,isPaginationRequired:!0,showPagination:!0,showPageSizeOptions:!0,isSearchRequired:!1,isDownloadRequired:!0,isFilterRequired:!0,isSortRequired:!0,showCSVExport:!0,getCSVExportData:ue,csvExportColumns:de,csvExportFileName:`wt-${"FIXED_POINT"===r?"fixed-point":"filling-point"}-search`})),y&&i.createElement(l.Toast,{error:y.error,label:y.label,onClose:F}),C&&i.createElement(Te,{t:e,closeModal:()=>A(!1),onSubmit:t=>{const l={FillingPointLocality:t.locality.map(e=>({fillingPointId:I.bookingId||I.id,localityCode:e.code}))};("UPDATE"===x?ne:le)(l,{onSuccess:()=>{N({label:e("UPDATE"===x?"WT_LOCALITY_UPDATE_SUCCESS":"WT_LOCALITY_LINKING_SUCCESS")}),A(!1),setTimeout(F,5e3),"FIXED_POINT"===r?W():V()},onError:t=>{var l,n,i,o;N({label:(null==t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||e("WT_LOCALITY_LINKING_FAIL"),error:!0}),setTimeout(F,5e3)}})},initialValues:I,tenantId:M,modalMode:x}))},ye=e=>{let{config:t,onSelect:o,t:a,userType:r,formData:u}=e;const d=Digit.ULBService.getCurrentTenantId(),[s,c]=(Digit.ULBService.getStateId(),n.useState(null==u?void 0:u.serviceType)),[m,v]=n.useState([]),{data:p,isLoading:E}=Digit.Hooks.useCustomMDMS(d,"tenant",[{name:"citymodule"}],{select:e=>{var t;return null==e||null===(t=e.tenant)||void 0===t?void 0:t.citymodule}});return n.useEffect(()=>{if(p){const e=p.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.name}));if(v(e),!s||"WT"===s.code){const l=e.find(e=>"WT"===e.code);l&&(c(l),"employee"===(null==r?void 0:r.toLowerCase())&&o(t.key,l))}}},[p]),E?i.createElement(l.Loader,null):"employee"===(null==r?void 0:r.toLowerCase())?i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,t.label),i.createElement(l.Dropdown,{className:"payment-form-text-input-correction",isMandatory:t.isMandatory,selected:s,option:m,select:e=>{c(e),"employee"===(null==r?void 0:r.toLowerCase())&&o(t.key,e)},optionKey:"i18nKey",disable:t.disable,t:a})):null},Ne=e=>{const t=Digit.ULBService.getCurrentTenantId(),{t:r}=o.useTranslation(),u=a.useHistory(),[d,s]=n.useState(null),[c,m]=n.useState(null),[p,E]=n.useState(""),[f,g]=n.useState(""),[_,h]=n.useState(null),[S,T]=n.useState(null),[b,y]=n.useState(null),[N,C]=n.useState(null),{data:A}=Digit.Hooks.fsm.useVendorSearch({tenantId:t,filters:{status:"ACTIVE"},config:{select:e=>(null==e?void 0:e.vendor)||[]}}),{mutate:I}=Digit.Hooks.wt.useVendorWorkOrderCreate(t);n.useEffect(()=>{!function(){try{C(null);const e=function(){if(S){const e=function(){if(S.size>=2e6)C(r("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",S,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?h(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):C(r("WT_FILE_UPLOAD_ERROR"))})},function(){C(r("WT_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)}}()},[S]);const D=window.Digit.Utils.browser.isMobile(),x=Digit.UserService.getUser().info.type,O=!(c&&p&&f&&b);return i.createElement("div",{className:"employee-form-section-wrapper"},i.createElement(v,{config:[{timeLine:[{actions:"Vendor Assign",currentStep:1}]}],showFinalStep:!1}),i.createElement("div",{style:{flex:1}},i.createElement(l.Card,{className:"formcomposer-section-grid"},i.createElement(l.CardSubHeader,{style:{marginBottom:"10px",gridColumn:"span 2"}},r("WT_VENDOR_ASSIGN")),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("WT_VENDOR_NAME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{t:r,option:A,optionKey:"name",select:m,selected:c,placeholder:r("WT_SELECT_VENDOR")})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("COMMON_VALID_FROM_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.DatePicker,{date:p,onChange:e=>E(e),style:{width:"100%"}})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("COMMON_VALID_TO_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.DatePicker,{date:f,min:p,onChange:e=>g(e),style:{width:"100%"}})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("WT_UPLOAD_DOCUMENT")),i.createElement(l.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){h(null),T(e.target.files[0])},onDelete:()=>{h(null)},message:_?"1 "+r("WT_ACTION_FILEUPLOADED"):r("WT_ACTION_NO_FILEUPLOADED"),error:N})),i.createElement(ye,{t:r,config:{key:"serviceType",label:r("WT_SELECT_SERVICE_TYPE")},onSelect:(e,t)=>{y(t)},userType:x,formData:{serviceType:b}})),i.createElement("div",{style:{display:"flex",marginTop:"24px",justifyContent:D?"center":"flex-end"}},i.createElement(l.SubmitBar,{label:r("ES_COMMON_SAVE"),onSubmit:O?null:()=>{const e={vendorWorkOrder:{tenantId:t,vendorId:(null==c?void 0:c.code)||(null==c?void 0:c.id),validFrom:new Date(p).getTime(),validTo:new Date(f).getTime(),serviceType:(null==b?void 0:b.code)||"WT",fileStoreId:_}};I(e,{onSuccess:e=>{s({isError:!1,label:r("ES_COMMON_SAVE_SUCCESS")}),setTimeout(()=>{u.push("/digit-ui/employee/vendor/search-vendor")},3e3)},onError:e=>{var t,l,n,i;s({isError:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||r("ES_COMMON_ERROR_SAVING")})}})},disabled:O}))),d&&i.createElement(l.Toast,{error:d.isError,label:d.label,onClose:()=>s(null)}))},Ce=e=>{var t,n,r,u;let{path:d}=e;const{t:s}=o.useTranslation(),c=a.useLocation(),m="WT_FIXED_POINT"!==s("WT_FIXED_POINT")?`${s("WT_FIXED_POINT")} ${s("ES_COMMON_INBOX")}`:"Fixed Point Inbox";sessionStorage.removeItem("revalidateddone");const v={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker"],applicationStatus:[],locality:[]}},E={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["mobileToilet"],applicationStatus:[],locality:[]}},f={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["treePruning"],applicationStatus:[],locality:[]}},g={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker-fixedpoint"],applicationStatus:[],locality:[]}},_=null===(t=Digit)||void 0===t||null===(n=t.ComponentRegistryService)||void 0===n?void 0:n.getComponent("ApplicationDetails"),h=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTCreate");return i.createElement(a.Switch,null,i.createElement(l.AppContainer,null,i.createElement("div",{className:"ground-container employee-app-container form-container"},i.createElement(l.ModuleHeader,{leftContent:i.createElement(i.Fragment,null,i.createElement(l.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=c.pathname;let t="WT";e.includes("/mt/")&&(t="MT"),e.includes("/tp/")&&(t="TP");let n=[{icon:l.HomeIcon,path:"/digit-ui/employee"},{label:s("WT_MODULE_NAME"),path:"/digit-ui/employee/module/details?moduleName="+t}];if(e.includes("/fixed-point/inbox"))n.push({label:m});else if(e.includes("/inbox")){let t="ES_COMMON_INBOX";e.includes("/tp/inbox")&&(t="TP_INBOX"),n.push({label:s(t)})}else if(e.includes("/my-bookings")){let t="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(t="MT_SEARCH_BOOKINGS"),e.includes("/tp/my-bookings")&&(t="TP_SEARCH_BOOKINGS"),n.push({label:s(t)})}else if(e.includes("/request-service"))n.push({label:s("WT_REQUEST_SERVICE")});else if(e.includes("/fixed-point/booking-details"))n.push({label:m,path:d+"/fixed-point/inbox"}),n.push({label:s("WT_BOOKING_DETAILS")});else if(e.includes("/booking-details")||e.includes("/bookingsearch/booking-details")){const t=e.includes("/bookingsearch");n.push(t?{label:s("WT_SEARCH_BOOKINGS"),path:d+"/my-bookings"}:{label:s("ES_COMMON_INBOX"),path:d+"/inbox"}),n.push({label:s("WT_BOOKING_DETAILS")})}else e.includes("/fixed-point-schedule")?n.push({label:s("WT_FIXED_POINT_SCHEDULE_MANAGEMENT")}):e.includes("/live-tracking")?n.push({label:s("WT_LIVE_TRACKING_SYSTEM")}):e.includes("/add-filling-point-address")?n.push({label:s("WT_ADD_FILLING_POINT_ADDRESS")}):e.includes("/add-fix-point-address")?n.push({label:s("WT_ADD_FIX_POINT_ADDRESS")}):e.includes("/search-filling-fix-point")?n.push({label:s("WT_SEARCH_FIX_POINT")}):e.includes("/vendor-assign")&&n.push({label:s("WT_VENDOR_ASSIGN")});return n})()}),i.createElement("div",{className:"employee-form"},i.createElement("div",{className:"employee-form-content"},i.createElement(l.PrivateRoute,{path:d+"/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,businessService:"watertanker",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:v,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/fixed-point/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,businessService:"watertanker-fixedpoint",detailRoute:d+"/fixed-point/booking-details",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:g,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/mt/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,moduleCode:"MT",businessService:"mobileToilet",filterComponent:"WT_INBOX_FILTER",initialStates:E,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/tp/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,moduleCode:"TP",businessService:"treePruning",filterComponent:"WT_INBOX_FILTER",initialStates:f,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/request-service",component:h}),i.createElement(l.PrivateRoute,{path:d+"/mt/request-service",component:h}),i.createElement(l.PrivateRoute,{path:d+"/tp/request-service",component:h}),i.createElement(l.PrivateRoute,{path:d+"/fixed-point/booking-details/:id",component:e=>i.createElement(_,p({},e,{parentRoute:d}))}),i.createElement(l.PrivateRoute,{path:d+"/booking-details/:id",component:e=>i.createElement(_,p({},e,{parentRoute:d}))}),i.createElement(l.PrivateRoute,{path:d+"/bookingsearch/booking-details/:id",component:e=>i.createElement(_,p({},e,{parentRoute:d}))}),i.createElement(l.PrivateRoute,{path:d+"/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:d,moduleCode:"WT"}))}),i.createElement(l.PrivateRoute,{path:d+"/mt/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:d,moduleCode:"MT"}))}),i.createElement(l.PrivateRoute,{path:d+"/tp/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:d,moduleCode:"TP"}))}),i.createElement(l.PrivateRoute,{path:d+"/fixed-point-schedule",component:ee}),i.createElement(l.PrivateRoute,{path:d+"/live-tracking",component:Ee}),i.createElement(l.PrivateRoute,{path:d+"/add-filling-point-address",component:he}),i.createElement(l.PrivateRoute,{path:d+"/add-fix-point-address",component:Se}),i.createElement(l.PrivateRoute,{path:d+"/search-filling-fix-point",component:be}),i.createElement(l.PrivateRoute,{path:d+"/vendor-assignment",component:Ne}))))))},Ae=e=>{var t,n;let{application:r,tenantId:u,buttonLabel:d}=e,s=null==r?void 0:r.bookingNo.split("-")[0];const{t:c}=o.useTranslation();return i.createElement(l.Card,null,i.createElement(l.KeyNote,{keyValue:c("BOOKING_NO"),note:null==r?void 0:r.bookingNo}),i.createElement(l.KeyNote,{keyValue:c("APPLICANT_NAME"),note:null==r||null===(t=r.applicantDetail)||void 0===t?void 0:t.name}),i.createElement(l.KeyNote,{keyValue:c("MOBILE_NUMBER"),note:c(""+(null==r||null===(n=r.applicantDetail)||void 0===n?void 0:n.mobileNumber))}),i.createElement(l.KeyNote,{keyValue:c("LOCALITY"),note:c(""+(null==r?void 0:r.localityCode))}),i.createElement(l.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==r?void 0:r.bookingStatus))}),i.createElement("div",null,"WT"===s&&i.createElement(a.Link,{to:`/digit-ui/citizen/wt/booking/waterTanker/${null==r?void 0:r.bookingNo}/${u}`},i.createElement(l.SubmitBar,{label:d})),"MT"===s&&i.createElement(a.Link,{to:`/digit-ui/citizen/wt/booking/mobileToilet/${null==r?void 0:r.bookingNo}/${u}`},i.createElement(l.SubmitBar,{label:d})),"TP"===s&&i.createElement(a.Link,{to:`/digit-ui/citizen/wt/booking/treePruning/${null==r?void 0:r.bookingNo}/${u}`},i.createElement(l.SubmitBar,{label:d}))))};var Ie=Array.isArray,De="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e,t){return e(t={exports:{}},t.exports),t.exports}var Oe,Le="object"==typeof De&&De&&De.Object===Object&&De,we="object"==typeof self&&self&&self.Object===Object&&self,Pe=Le||we||Function("return this")(),Re=Pe.Symbol,ke=Object.prototype,Me=ke.hasOwnProperty,Fe=ke.toString,Be=Re?Re.toStringTag:void 0,Ue=Object.prototype.toString,We=Re?Re.toStringTag:void 0,He=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":We&&We in Object(e)?function(e){var t=Me.call(e,Be),l=e[Be];try{e[Be]=void 0;var n=!0}catch(e){}var i=Fe.call(e);return n&&(t?e[Be]=l:delete e[Be]),i}(e):function(e){return Ue.call(e)}(e)},je=function(e){return null!=e&&"object"==typeof e},ze=function(e){return"symbol"==typeof e||je(e)&&"[object Symbol]"==He(e)},Ve=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ge=/^\w*$/,Ke=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ye=function(e){if(!Ke(e))return!1;var t=He(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},$e=Pe["__core-js_shared__"],qe=(Oe=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||""))?"Symbol(src)_1."+Oe:"",Xe=Function.prototype.toString,Qe=function(e){if(null!=e){try{return Xe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ze=/^\[object .+?Constructor\]$/,Je=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ke(e)||(t=e,qe&&qe in t))&&(Ye(e)?Je:Ze).test(Qe(e));var t}(l)?l:void 0},tt=et(Object,"create"),lt=Object.prototype.hasOwnProperty,nt=Object.prototype.hasOwnProperty;function it(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}it.prototype.clear=function(){this.__data__=tt?tt(null):{},this.size=0},it.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},it.prototype.get=function(e){var t=this.__data__;if(tt){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return lt.call(t,e)?t[e]:void 0},it.prototype.has=function(e){var t=this.__data__;return tt?void 0!==t[e]:nt.call(t,e)},it.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=tt&&void 0===t?"__lodash_hash_undefined__":t,this};var ot=it,at=function(e,t){return e===t||e!=e&&t!=t},rt=function(e,t){for(var l=e.length;l--;)if(at(e[l][0],t))return l;return-1},ut=Array.prototype.splice;function dt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}dt.prototype.clear=function(){this.__data__=[],this.size=0},dt.prototype.delete=function(e){var t=this.__data__,l=rt(t,e);return!(l<0||(l==t.length-1?t.pop():ut.call(t,l,1),--this.size,0))},dt.prototype.get=function(e){var t=this.__data__,l=rt(t,e);return l<0?void 0:t[l][1]},dt.prototype.has=function(e){return rt(this.__data__,e)>-1},dt.prototype.set=function(e,t){var l=this.__data__,n=rt(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var st=dt,ct=et(Pe,"Map"),mt=function(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map};function vt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}vt.prototype.clear=function(){this.size=0,this.__data__={hash:new ot,map:new(ct||st),string:new ot}},vt.prototype.delete=function(e){var t=mt(this,e).delete(e);return this.size-=t?1:0,t},vt.prototype.get=function(e){return mt(this,e).get(e)},vt.prototype.has=function(e){return mt(this,e).has(e)},vt.prototype.set=function(e,t){var l=mt(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var pt=vt;function Et(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Et.Cache||pt),l}Et.Cache=pt;var ft,gt,_t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/\\(\\)?/g,St=(ft=Et(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_t,function(e,l,n,i){t.push(n?i.replace(ht,"$1"):l||e)}),t},function(e){return 500===gt.size&>.clear(),e}),gt=ft.cache,ft),Tt=Re?Re.prototype:void 0,bt=Tt?Tt.toString:void 0,yt=function(e){if("string"==typeof e||ze(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Nt=function(e,t,l){var n=null==e?void 0:function(e,t){for(var l=0,n=(t=function(e,t){return Ie(e)?e:function(e,t){if(Ie(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!ze(e))||Ge.test(e)||!Ve.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:St(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Ie(t))return function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}(t,e)+"";if(ze(t))return bt?bt.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))}(t,e)).length;null!=e&&l<n;)e=e[yt(t[l++])];return l&&l==n?e:void 0}(e,t);return void 0===n?l:n},Ct=xe(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",E="[object RegExp]",f="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",T="[object DataView]",b="[object Float32Array]",y="[object Float64Array]",N="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",I="[object Uint8Array]",D="[object Uint16Array]",x="[object Uint32Array]",O=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,w=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,k=RegExp(P.source),M=RegExp(R.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,V=RegExp(z.source),G=/^\s+/,K=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,q=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,Z=/\\(\\)?/g,J=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ee=/\w*$/,te=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ne=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,re=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,de="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",se="\\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",ce="["+se+"]",me="["+de+"]",ve="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+se+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fe="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Te="(?:"+pe+"|"+Ee+")",be="(?:"+Se+"|"+Ee+")",ye="(?:"+me+"|"+fe+")?",Ne="[\\ufe0e\\ufe0f]?"+ye+"(?:\\u200d(?:"+[ge,_e,he].join("|")+")[\\ufe0e\\ufe0f]?"+ye+")*",Ce="(?:"+["[\\u2700-\\u27bf]",_e,he].join("|")+")"+Ne,Ae="(?:"+[ge+me+"?",me,_e,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),xe=RegExp(me,"g"),Oe=RegExp(fe+"(?="+fe+")|"+Ae+Ne,"g"),Le=RegExp([Se+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ce,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ce,Se+Te,"$"].join("|")+")",Se+"?"+Te+"+(?:['’](?: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_])",ve,Ce].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ke=-1,Me={};Me[b]=Me[y]=Me[N]=Me[C]=Me[A]=Me[I]=Me["[object Uint8ClampedArray]"]=Me[D]=Me[x]=!0,Me[o]=Me[a]=Me[S]=Me[r]=Me[T]=Me[u]=Me[d]=Me[s]=Me[m]=Me[v]=Me[p]=Me[E]=Me[f]=Me[g]=Me[h]=!1;var Fe={};Fe[o]=Fe[a]=Fe[S]=Fe[T]=Fe[r]=Fe[u]=Fe[b]=Fe[y]=Fe[N]=Fe[C]=Fe[A]=Fe[m]=Fe[v]=Fe[p]=Fe[E]=Fe[f]=Fe[g]=Fe[_]=Fe[I]=Fe["[object Uint8ClampedArray]"]=Fe[D]=Fe[x]=!0,Fe[d]=Fe[s]=Fe[h]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,He="object"==typeof De&&De&&De.Object===Object&&De,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ke=Ge&&Ge.exports===Ve,Ye=Ke&&He.process,$e=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),qe=$e&&$e.isArrayBuffer,Xe=$e&&$e.isDate,Qe=$e&&$e.isMap,Ze=$e&&$e.isRegExp,Je=$e&&$e.isSet,et=$e&&$e.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function mt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function vt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var pt=Tt("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function _t(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function ht(e){return e!=e}function St(e,t){var l=null==e?0:e.length;return l?Nt(e,t)/l:NaN}function Tt(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 yt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Nt(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function Ct(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function At(e){return e?e.slice(0,Vt(e)+1).replace(G,""):e}function It(e){return function(t){return e(t)}}function Dt(e,t){return dt(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function Ot(e,t){for(var l=-1,n=e.length;++l<n&>(t,e[l],0)>-1;);return l}function Lt(e,t){for(var l=e.length;l--&>(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Pt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return we.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function Bt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=Oe.lastIndex=0;Oe.test(e);)++t;return t}(e):pt(e)}function zt(e){return Mt(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Gt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Kt=function e(t){var K=(t=null==t?ze:Kt.defaults(ze.Object(),t,Kt.pick(ze,Re))).Array,de=t.Date,se=t.Error,ce=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,ge=K.prototype,_e=ve.prototype,he=t["__core-js_shared__"],Se=ce.prototype.toString,Te=_e.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=_e.toString,Ce=Se.call(ve),Ae=ze._,De=pe("^"+Se.call(Te).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=Ke?t.Buffer:void 0,we=t.Symbol,Be=t.Uint8Array,He=Oe?Oe.allocUnsafe:void 0,je=Bt(ve.getPrototypeOf,ve),Ve=ve.create,Ge=_e.propertyIsEnumerable,Ye=ge.splice,$e=we?we.isConcatSpreadable:void 0,pt=we?we.iterator:void 0,bt=we?we.toStringTag:void 0,Yt=function(){try{var e=Qi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,qt=de&&de.now!==ze.Date.now&&de.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=me.ceil,Zt=me.floor,Jt=ve.getOwnPropertySymbols,el=Oe?Oe.isBuffer:void 0,tl=t.isFinite,ll=ge.join,nl=Bt(ve.keys,ve),il=me.max,ol=me.min,al=de.now,rl=t.parseInt,ul=me.random,dl=ge.reverse,sl=Qi(t,"DataView"),cl=Qi(t,"Map"),ml=Qi(t,"Promise"),vl=Qi(t,"Set"),pl=Qi(t,"WeakMap"),El=Qi(ve,"create"),fl=pl&&new pl,gl={},_l=Co(sl),hl=Co(cl),Sl=Co(ml),Tl=Co(vl),bl=Co(pl),yl=we?we.prototype:void 0,Nl=yl?yl.valueOf:void 0,Cl=yl?yl.toString:void 0;function Al(e){if(ja(e)&&!La(e)&&!(e instanceof Ol)){if(e instanceof xl)return e;if(Te.call(e,"__wrapped__"))return Ao(e)}return new xl(e)}var Il=function(){function e(){}return function(t){if(!Ha(t))return{};if(Ve)return Ve(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Dl(){}function xl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ol(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ll(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function wl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Pl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Pl;++t<l;)this.add(e[t])}function kl(e){var t=this.__data__=new wl(e);this.size=t.size}function Ml(e,t){var l=La(e),n=!l&&Oa(e),i=!l&&!n&&ka(e),o=!l&&!n&&!i&&Xa(e),a=l||n||i||o,r=a?Ct(e.length,Ee):[],u=r.length;for(var d in e)!t&&!Te.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Fl(e){var t=e.length;return t?e[Rn(0,t-1)]:void 0}function Bl(e,t){return bo(Ei(e),Yl(t,0,e.length))}function Ul(e){return bo(Ei(e))}function Wl(e,t,l){(void 0!==l&&!Ia(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Hl(e,t,l){var n=e[t];Te.call(e,t)&&Ia(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ia(e[l][0],t))return l;return-1}function zl(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function Vl(e,t){return e&&fi(t,_r(t),e)}function Gl(e,t,l){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Kl(e,t){for(var l=-1,n=t.length,i=K(n),o=null==e;++l<n;)i[l]=o?void 0:vr(e,t[l]);return i}function Yl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function $l(e,t,l,n,i,a){var d,h=1&t,O=2&t,L=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!Ha(e))return e;var w=La(e);if(w){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return Ei(e,d)}else{var P=eo(e),R=P==s||P==c;if(ka(e))return di(e,h);if(P==p||P==o||R&&!i){if(d=O||R?{}:lo(e),!h)return O?function(e,t){return fi(e,Ji(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(d,e)):function(e,t){return fi(e,Zi(e),t)}(e,Vl(d,e))}else{if(!Fe[P])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case S:return si(e);case r:case u:return new n(+e);case T:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case b:case y:case N:case C:case A:case I:case"[object Uint8ClampedArray]":case D:case x:return ci(e,l);case m:return new n;case v:case g:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ee.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new n;case _:return Nl?ve(Nl.call(e)):{}}}(e,P,h)}}a||(a=new kl);var k=a.get(e);if(k)return k;a.set(e,d),Ya(e)?e.forEach(function(n){d.add($l(n,t,l,n,e,a))}):za(e)&&e.forEach(function(n,i){d.set(i,$l(n,t,l,i,e,a))});var M=w?void 0:(L?O?Vi:zi:O?hr:_r)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Hl(d,i,$l(n,t,l,i,e,a))}),d}function ql(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return _o(function(){e.apply(void 0,n)},t)}function Ql(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,It(l))),n?(o=ut,a=!1):t.length>=200&&(o=xt,a=!1,t=new Rl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var m=d;m--;)if(t[m]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Al.templateSettings={escape:F,evaluate:B,interpolate:U,variable:"",imports:{_:Al}},(Al.prototype=Dl.prototype).constructor=Al,(xl.prototype=Il(Dl.prototype)).constructor=xl,(Ol.prototype=Il(Dl.prototype)).constructor=Ol,Ll.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},Ll.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ll.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Te.call(t,e)?t[e]:void 0},Ll.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:Te.call(t,e)},Ll.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},wl.prototype.clear=function(){this.__data__=[],this.size=0},wl.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ye.call(t,l,1),--this.size,0))},wl.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},wl.prototype.has=function(e){return jl(this.__data__,e)>-1},wl.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Pl.prototype.clear=function(){this.size=0,this.__data__={hash:new Ll,map:new(cl||wl),string:new Ll}},Pl.prototype.delete=function(e){var t=qi(this,e).delete(e);return this.size-=t?1:0,t},Pl.prototype.get=function(e){return qi(this,e).get(e)},Pl.prototype.has=function(e){return qi(this,e).has(e)},Pl.prototype.set=function(e,t){var l=qi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},Rl.prototype.add=Rl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.clear=function(){this.__data__=new wl,this.size=0},kl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},kl.prototype.get=function(e){return this.__data__.get(e)},kl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof wl){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Pl(n)}return l.set(e,t),this.size=l.size,this};var Zl=hi(rn),Jl=hi(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!qa(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Si(),an=Si(!0);function rn(e,t){return e&&on(e,t,_r)}function un(e,t){return e&&an(e,t,_r)}function dn(e,t){return at(t,function(t){return Ba(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[No(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return La(e)?n:st(n,l(e))}function mn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=Te.call(e,bt),l=e[bt];try{e[bt]=void 0;var n=!0}catch(e){}var i=Ne.call(e);return n&&(t?e[bt]=l:delete e[bt]),i}(e):function(e){return Ne.call(e)}(e)}function vn(e,t){return e>t}function pn(e,t){return null!=e&&Te.call(e,t)}function En(e,t){return null!=e&&t in ve(e)}function fn(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=K(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,It(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new Rl(a&&s):void 0}s=e[0];var c=-1,m=r[0];e:for(;++c<i&&d.length<u;){var v=s[c],p=t?t(v):v;if(v=l||0!==v?v:0,!(m?xt(m,p):n(d,p,l))){for(a=o;--a;){var E=r[a];if(!(E?xt(E,p):n(e[a],p,l)))continue e}m&&m.push(p),d.push(v)}}return d}function gn(e,t,l){var n=null==(e=po(e,t=oi(t,e)))?e:e[No(Fo(t))];return null==n?void 0:tt(n,e,l)}function _n(e){return ja(e)&&mn(e)==o}function hn(e,t,l,n,i){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=La(e),h=La(t),b=c?a:eo(e),y=h?a:eo(t),N=(b=b==o?p:b)==p,C=(y=y==o?p:y)==p,A=b==y;if(A&&ka(e)){if(!ka(t))return!1;c=!0,N=!1}if(A&&!N)return s||(s=new kl),c||Xa(e)?Hi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case r:case u:case v:return Ia(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case m:var s=Ft;case f:if(s||(s=Wt),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var p=Hi(s(e),s(t),n,i,o,a);return a.delete(e),p;case _:if(Nl)return Nl.call(e)==Nl.call(t)}return!1}(e,t,b,l,n,i,s);if(!(1&l)){var I=N&&Te.call(e,"__wrapped__"),D=C&&Te.call(t,"__wrapped__");if(I||D){var x=I?e.value():e,O=D?t.value():t;return s||(s=new kl),i(x,O,l,n,s)}}return!!A&&(s||(s=new kl),function(e,t,l,n,i,o){var a=1&l,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Te.call(t,s)))return!1}var c=o.get(e),m=o.get(t);if(c&&m)return c==t&&m==e;var v=!0;o.set(e,t),o.set(t,e);for(var p=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var g=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===g?E===f||i(E,f,l,n,o):g)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,s))}(e,t,l,n,hn,i))}function Sn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=ve(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new kl;if(n)var m=n(d,s,u,e,t,c);if(!(void 0===m?hn(s,d,3,n,c):m))return!1}}return!0}function Tn(e){return!(!Ha(e)||(t=e,ye&&ye in t))&&(Ba(e)?De:ne).test(Co(e));var t}function bn(e){return"function"==typeof e?e:null==e?Vr:"object"==typeof e?La(e)?In(e[0],e[1]):An(e):Jr(e)}function yn(e){if(!so(e))return nl(e);var t=[];for(var l in ve(e))Te.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Nn(e,t){return e<t}function Cn(e,t){var l=-1,n=Pa(e)?K(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function An(e){var t=Xi(e);return 1==t.length&&t[0][2]?mo(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function In(e,t){return ao(e)&&co(t)?mo(No(e),t):function(l){var n=vr(l,e);return void 0===n&&n===t?pr(l,e):hn(t,n,3)}}function Dn(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new kl),Ha(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),u=fo(t,l),d=a.get(u);if(d)Wl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var m=La(u),v=!m&&ka(u),p=!m&&!v&&Xa(u);s=u,m||v||p?La(r)?s=r:Ra(r)?s=Ei(r):v?(c=!1,s=di(u,!0)):p?(c=!1,s=ci(u,!0)):s=[]:Ga(u)||Oa(u)?(s=r,Oa(r)?s=ir(r):Ha(r)&&!Ba(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Wl(e,l,s)}}(e,t,a,l,Dn,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Wl(e,a,r)}},hr)}function xn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function On(e,t,l){t=t.length?dt(t,function(e){return La(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[Vr];var n=-1;return t=dt(t,It($i())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=mi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(Cn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function Ln(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function wn(e,t,l,n){var i=n?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,It(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&Ye.call(r,u,1),Ye.call(e,u,1);return e}function Pn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ye.call(e,i,1):Qn(e,i)}}return e}function Rn(e,t){return e+Zt(ul()*(t-e+1))}function kn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return ho(vo(e,t,Vr),e+"")}function Fn(e){return Fl(Ir(e))}function Bn(e,t){var l=Ir(e);return bo(l,Yl(t,0,l.length))}function Un(e,t,l,n){if(!Ha(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=No(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=Ha(s)?s:io(t[i+1])?[]:{})}Hl(r,u,d),r=r[u]}return e}var Wn=fl?function(e,t){return fl.set(e,t),e}:Vr,Hn=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Hr(t),writable:!0})}:Vr;function jn(e){return bo(Ir(e))}function zn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=K(i);++n<i;)o[n]=e[n+t];return o}function Vn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Gn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!qa(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Kn(e,t,Vr,l)}function Kn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=qa(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),m=void 0!==c,v=null===c,p=c==c,E=qa(c);if(a)var f=n||p;else f=d?p&&(n||m):r?p&&m&&(n||!v):u?p&&m&&!v&&(n||!E):!v&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Yn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function $n(e){return"number"==typeof e?e:qa(e)?NaN:+e}function qn(e){if("string"==typeof e)return e;if(La(e))return dt(e,qn)+"";if(qa(e))return Cl?Cl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:ki(e);if(d)return Wt(d);a=!1,i=xt,u=new Rl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var m=u.length;m--;)if(u[m]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Qn(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[No(Fo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Jn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?zn(e,n?0:o,n?o+1:i):zn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ol&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var i=-1,o=K(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Ql(o[i]||a,e[r],t,l));return Xn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ra(e)?e:[]}function ii(e){return"function"==typeof e?e:Vr}function oi(e,t){return La(e)?e:ao(e,t)?[e]:yo(or(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var ui=$t||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=He?He(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function mi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=qa(e),a=void 0!==t,r=null===t,u=t==t,d=qa(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function vi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=K(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function pi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=K(s+d),m=!n;++i<s;)c[i]=e[i];for(var v=i;++u<d;)c[v+u]=t[u];for(;++a<r;)(m||i<o)&&(c[v+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=K(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Gl(l,r,u):Hl(l,r,u)}return l}function gi(e,t){return function(l,n){var i=La(l)?lt:zl,o=t?t():{};return i(l,e,$i(n,2),o)}}function _i(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function hi(e,t){return function(l,n){if(null==l)return l;if(!Pa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=ve(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Si(e){return function(t,l,n){for(var i=-1,o=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function Ti(e){return function(t){var l=Mt(t=or(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function bi(e){return function(t){return ct(Br(Or(t).replace(Ie,"")),e,"")}}function yi(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 l=Il(e.prototype),n=e.apply(l,t);return Ha(n)?n:l}}function Ni(e){return function(t,l,n){var i=ve(t);if(!Pa(t)){var o=$i(l,3);t=_r(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ci(e){return ji(function(t){var n=t.length,i=n,o=xl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Ki(a))var r=new xl([],!0)}for(i=r?i:n;++i<n;){var u=Ki(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Ki(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&La(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Ai(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,m=2&t,v=24&t,p=512&t,E=m?void 0:yi(e);return function f(){for(var g=arguments.length,_=K(g),h=g;h--;)_[h]=arguments[h];if(v)var S=Yi(f),T=wt(_,S);if(n&&(_=vi(_,n,i,v)),o&&(_=pi(_,o,a,v)),g-=T,v&&g<d){var b=Ut(_,S);return Pi(e,t,Ai,f.placeholder,l,_,b,r,u,d-g)}var y=c?l:this,N=m?y[e]:e;return g=_.length,r?_=Eo(_,r):p&&g>1&&_.reverse(),s&&u<g&&(_.length=u),this&&this!==ze&&this instanceof f&&(N=E||yi(N)),N.apply(y,_)}}function Ii(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Di(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=qn(l),n=qn(n)):(l=$n(l),n=$n(n)),i=e(l,n)}return i}}function xi(e){return ji(function(t){return t=dt(t,It($i())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Oi(e,t){var l=(t=void 0===t?" ":qn(t)).length;if(l<2)return l?kn(t,e):t;var n=kn(t,Qt(e/jt(t)));return Mt(t)?ri(zt(n),0,e).join(""):n.slice(0,e)}function Li(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l,n){for(var i=-1,o=il(Qt((t-e)/(l||1)),0),a=K(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:er(n),e)}}function wi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=nr(t),l=nr(l)),e(t,l)}}function Pi(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],m=l.apply(void 0,c);return ro(e)&&go(m,c),m.placeholder=n,So(m,e,t)}function Ri(e){var t=me[e];return function(e,l){if(e=nr(e),(l=null==l?0:ol(tr(l),292))&&tl(e)){var n=(or(e)+"e").split("e");return+((n=(or(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var ki=vl&&1/Wt(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:qr;function Mi(e){return function(t){var l=eo(t);return l==m?Ft(t):l==f?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(tr(u),0),d=void 0===d?d:tr(d),c-=a?a.length:0,64&t){var m=o,v=a;o=a=void 0}var p=s?void 0:Gi(e),E=[e,t,i,o,a,m,v,r,u,d];if(p&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,p),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=yi(e);return function i(){for(var o=arguments.length,a=K(o),r=o,u=Yi(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Pi(e,t,Ai,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==ze&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Ai.apply(void 0,E):function(e,t,l,n){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=K(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var f=function(e,t,l){var n=1&t,i=yi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return So((p?Wn:go)(f,E),e,t)}function Bi(e,t,l,n){return void 0===e||Ia(e,_e[l])&&!Te.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),Dn(e,t,void 0,Ui,o),o.delete(t)),e}function Wi(e){return Ga(e)?void 0:e}function Hi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,m=!0,v=2&l?new Rl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,o):n(p,E,c,e,t,o);if(void 0!==f){if(f)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!xt(v,t)&&(p===e||i(p,e,l,n,o)))return v.push(t)})){m=!1;break}}else if(p!==E&&!i(p,E,l,n,o)){m=!1;break}}return o.delete(e),o.delete(t),m}function ji(e){return ho(vo(e,void 0,wo),e+"")}function zi(e){return cn(e,_r,Zi)}function Vi(e){return cn(e,hr,Ji)}var Gi=fl?function(e){return fl.get(e)}:qr;function Ki(e){for(var t=e.name+"",l=gl[t],n=Te.call(gl,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Yi(e){return(Te.call(Al,"placeholder")?Al:e).placeholder}function $i(){var e=Al.iteratee||Gr;return e=e===Gr?bn:e,arguments.length?e(arguments[0],arguments[1]):e}function qi(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map}function Xi(e){for(var t=_r(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Qi(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Tn(l)?l:void 0}var Zi=Jt?function(e){return null==e?[]:(e=ve(e),at(Jt(e),function(t){return Ge.call(e,t)}))}:lu,Ji=Jt?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:lu,eo=mn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=No(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Wa(i)&&io(a,i)&&(La(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Il(je(e))}function no(e){return La(e)||Oa(e)||!!($e&&e&&e[$e])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&oe.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!Ha(l))return!1;var n=typeof t;return!!("number"==n?Pa(l)&&io(t,l.length):"string"==n&&t in l)&&Ia(l[t],e)}function ao(e,t){if(La(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!qa(e))||H.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ro(e){var t=Ki(e),l=Al[t];if("function"!=typeof l||!(t in Ol.prototype))return!1;if(e===l)return!0;var n=Gi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=T||cl&&eo(new cl)!=m||ml&&"[object Promise]"!=eo(ml.resolve())||vl&&eo(new vl)!=f||pl&&eo(new pl)!=h)&&(eo=function(e){var t=mn(e),l=t==p?e.constructor:void 0,n=l?Co(l):"";if(n)switch(n){case _l:return T;case hl:return m;case Sl:return"[object Promise]";case Tl:return f;case bl:return h}return t});var uo=he?Ba:nu;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function co(e){return e==e&&!Ha(e)}function mo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=K(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=K(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=To(Wn),_o=Xt||function(e,t){return ze.setTimeout(e,t)},ho=To(Hn);function So(e,t,l){var n=t+"";return ho(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(Y,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(q):[]}(n),l)))}function To(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=Rn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var yo=function(e){var t=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,function(e,l,n,i){t.push(n?i.replace(Z,"$1"):l||e)}),t},function(e){return 500===l.size&&l.clear(),e}),l=t.cache;return t}();function No(e){if("string"==typeof e||qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Co(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ao(e){if(e instanceof Ol)return e.clone();var t=new xl(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Mn(function(e,t){return Ra(e)?Ql(e,nn(t,1,Ra,!0)):[]}),Do=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Ql(e,nn(t,1,Ra,!0),$i(l,2)):[]}),xo=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Ql(e,nn(t,1,Ra,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),ft(e,$i(t,3),i)}function Lo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=tr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,$i(t,3),i,!0)}function wo(e){return null!=e&&e.length?nn(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Mn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),ko=Mn(function(e){var t=Fo(e),l=dt(e,ni);return t===Fo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,$i(t,2)):[]}),Mo=Mn(function(e){var t=Fo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=Mn(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?wn(e,t):e}var Wo=ji(function(e,t){var l=null==e?0:e.length,n=Kl(e,t);return Pn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(mi)),n});function Ho(e){return null==e?e:dl.call(e)}var jo=Mn(function(e){return Xn(nn(e,1,Ra,!0))}),zo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),Xn(nn(e,1,Ra,!0),$i(t,2))}),Vo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Ra,!0),void 0,t)});function Go(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ra(e))return t=il(e.length,t),!0}),Ct(t,function(t){return dt(e,Tt(t))})}function Ko(e,t){if(!e||!e.length)return[];var l=Go(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var Yo=Mn(function(e,t){return Ra(e)?Ql(e,t):[]}),$o=Mn(function(e){return ti(at(e,Ra))}),qo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),$i(t,2))}),Xo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Qo=Mn(Go),Zo=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Ko(e,l)});function Jo(e){var t=Al(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Kl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ol&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new xl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),la=gi(function(e,t,l){Te.call(e,l)?++e[l]:Gl(e,l,1)}),na=Ni(Oo),ia=Ni(Lo);function oa(e,t){return(La(e)?nt:Zl)(e,$i(t,3))}function aa(e,t){return(La(e)?it:Jl)(e,$i(t,3))}var ra=gi(function(e,t,l){Te.call(e,l)?e[l].push(t):Gl(e,l,[t])}),ua=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=Pa(e)?K(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):gn(e,t,l)}),o}),da=gi(function(e,t,l){Gl(e,l,t)});function sa(e,t){return(La(e)?dt:Cn)(e,$i(t,3))}var ca=gi(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),ma=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),On(e,nn(t,1),[])}),va=qt||function(){return ze.Date.now()};function pa(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Ea(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var fa=Mn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,Yi(fa));n|=32}return Fi(e,n,t,l,i)}),ga=Mn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,Yi(ga));n|=32}return Fi(t,n,e,l,i)});function _a(e,t,n){var i,o,a,r,u,d,s=0,c=!1,m=!1,v=!0;if("function"!=typeof e)throw new fe(l);function p(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=_o(g,t),c?p(e):r}function f(e){var l=e-d;return void 0===d||l>=t||l<0||m&&e-s>=a}function g(){var e=va();if(f(e))return _(e);u=_o(g,function(e){var l=t-(e-d);return m?ol(l,a-(e-s)):l}(e))}function _(e){return u=void 0,v&&i?p(e):(i=o=void 0,r)}function h(){var e=va(),l=f(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(m)return ui(u),u=_o(g,t),p(d)}return void 0===u&&(u=_o(g,t)),r}return t=nr(t)||0,Ha(n)&&(c=!!n.leading,a=(m="maxWait"in n)?il(nr(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),h.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},h.flush=function(){return void 0===u?r:_(va())},h}var ha=Mn(function(e,t){return Xl(e,1,t)}),Sa=Mn(function(e,t,l){return Xl(e,nr(t)||0,l)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);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(Ta.Cache||Pl),n}function ba(e){if("function"!=typeof e)throw new fe(l);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)}}Ta.Cache=Pl;var ya=ai(function(e,t){var l=(t=1==t.length&&La(t[0])?dt(t[0],It($i())):dt(nn(t,1),It($i()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Na=Mn(function(e,t){return Fi(e,32,void 0,t,Ut(t,Yi(Na)))}),Ca=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,Yi(Ca)))}),Aa=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var Da=wi(vn),xa=wi(function(e,t){return e>=t}),Oa=_n(function(){return arguments}())?_n:function(e){return ja(e)&&Te.call(e,"callee")&&!Ge.call(e,"callee")},La=K.isArray,wa=qe?It(qe):function(e){return ja(e)&&mn(e)==S};function Pa(e){return null!=e&&Wa(e.length)&&!Ba(e)}function Ra(e){return ja(e)&&Pa(e)}var ka=el||nu,Ma=Xe?It(Xe):function(e){return ja(e)&&mn(e)==u};function Fa(e){if(!ja(e))return!1;var t=mn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function Ba(e){if(!Ha(e))return!1;var t=mn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==tr(e)}function Wa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ja(e){return null!=e&&"object"==typeof e}var za=Qe?It(Qe):function(e){return ja(e)&&eo(e)==m};function Va(e){return"number"==typeof e||ja(e)&&mn(e)==v}function Ga(e){if(!ja(e)||mn(e)!=p)return!1;var t=je(e);if(null===t)return!0;var l=Te.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Se.call(l)==Ce}var Ka=Ze?It(Ze):function(e){return ja(e)&&mn(e)==E},Ya=Je?It(Je):function(e){return ja(e)&&eo(e)==f};function $a(e){return"string"==typeof e||!La(e)&&ja(e)&&mn(e)==g}function qa(e){return"symbol"==typeof e||ja(e)&&mn(e)==_}var Xa=et?It(et):function(e){return ja(e)&&Wa(e.length)&&!!Me[mn(e)]},Qa=wi(Nn),Za=wi(function(e,t){return e<=t});function Ja(e){if(!e)return[];if(Pa(e))return $a(e)?zt(e):Ei(e);if(pt&&e[pt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[pt]());var t=eo(e);return(t==m?Ft:t==f?Wt:Ir)(e)}function er(e){return e?(e=nr(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function tr(e){var t=er(e),l=t%1;return t==t?l?t-l:t:0}function lr(e){return e?Yl(tr(e),0,4294967295):0}function nr(e){if("number"==typeof e)return e;if(qa(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=At(e);var l=le.test(e);return l||ie.test(e)?We(e.slice(2),l?2:8):te.test(e)?NaN:+e}function ir(e){return fi(e,hr(e))}function or(e){return null==e?"":qn(e)}var ar=_i(function(e,t){if(so(t)||Pa(t))fi(t,_r(t),e);else for(var l in t)Te.call(t,l)&&Hl(e,l,t[l])}),rr=_i(function(e,t){fi(t,hr(t),e)}),ur=_i(function(e,t,l,n){fi(t,hr(t),e,n)}),dr=_i(function(e,t,l,n){fi(t,_r(t),e,n)}),sr=ji(Kl),cr=Mn(function(e,t){e=ve(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ia(s,_e[d])&&!Te.call(e,d))&&(e[d]=o[d])}return e}),mr=Mn(function(e){return e.push(void 0,Ui),tt(Tr,void 0,e)});function vr(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function pr(e,t){return null!=e&&to(e,t,En)}var Er=Ii(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=l},Hr(Vr)),fr=Ii(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Te.call(e,t)?e[t].push(l):e[t]=[l]},$i),gr=Mn(gn);function _r(e){return Pa(e)?Ml(e):yn(e)}function hr(e){return Pa(e)?Ml(e,!0):function(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var l in ve(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&Te.call(e,n))&&l.push(n);return l}(e)}var Sr=_i(function(e,t,l){Dn(e,t,l)}),Tr=_i(function(e,t,l,n){Dn(e,t,l,n)}),br=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,Vi(e),l),n&&(l=$l(l,7,Wi));for(var i=t.length;i--;)Qn(l,t[i]);return l}),yr=ji(function(e,t){return null==e?{}:function(e,t){return Ln(e,t,function(t,l){return pr(e,l)})}(e,t)});function Nr(e,t){if(null==e)return{};var l=dt(Vi(e),function(e){return[e]});return t=$i(t),Ln(e,l,function(e,l){return t(e,l[0])})}var Cr=Mi(_r),Ar=Mi(hr);function Ir(e){return null==e?[]:Dt(e,_r(e))}var Dr=bi(function(e,t,l){return t=t.toLowerCase(),e+(l?xr(t):t)});function xr(e){return Fr(or(e).toLowerCase())}function Or(e){return(e=or(e))&&e.replace(ae,Pt).replace(xe,"")}var Lr=bi(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),wr=bi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Pr=Ti("toLowerCase"),Rr=bi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),kr=bi(function(e,t,l){return e+(l?" ":"")+Fr(t)}),Mr=bi(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Fr=Ti("toUpperCase");function Br(e,t,l){return e=or(e),void 0===(t=l?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Ur=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fa(e)?e:new se(e)}}),Wr=ji(function(e,t){return nt(t,function(t){t=No(t),Gl(e,t,fa(e[t],e))}),e});function Hr(e){return function(){return e}}var jr=Ci(),zr=Ci(!0);function Vr(e){return e}function Gr(e){return bn("function"==typeof e?e:$l(e,1))}var Kr=Mn(function(e,t){return function(l){return gn(l,e,t)}}),Yr=Mn(function(e,t){return function(l){return gn(e,l,t)}});function $r(e,t,l){var n=_r(t),i=dn(t,n);null!=l||Ha(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,_r(t)));var o=!(Ha(l)&&"chain"in l&&!l.chain),a=Ba(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function qr(){}var Xr=xi(dt),Qr=xi(ot),Zr=xi(vt);function Jr(e){return ao(e)?Tt(No(e)):function(e){return function(t){return sn(t,e)}}(e)}var eu=Li(),tu=Li(!0);function lu(){return[]}function nu(){return!1}var iu,ou=Di(function(e,t){return e+t},0),au=Ri("ceil"),ru=Di(function(e,t){return e/t},1),uu=Ri("floor"),du=Di(function(e,t){return e*t},1),su=Ri("round"),cu=Di(function(e,t){return e-t},0);return Al.after=function(e,t){if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},Al.ary=pa,Al.assign=ar,Al.assignIn=rr,Al.assignInWith=ur,Al.assignWith=dr,Al.at=sr,Al.before=Ea,Al.bind=fa,Al.bindAll=Wr,Al.bindKey=ga,Al.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},Al.chain=Jo,Al.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(tr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=K(Qt(n/t));i<n;)a[o++]=zn(e,i,i+=t);return a},Al.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Al.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(La(l)?Ei(l):[l],nn(t,1))},Al.cond=function(e){var t=null==e?0:e.length,n=$i();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Al.conforms=function(e){return function(e){var t=_r(e);return function(l){return ql(l,e,t)}}($l(e,1))},Al.constant=Hr,Al.countBy=la,Al.create=function(e,t){var l=Il(e);return null==t?l:Vl(l,t)},Al.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Al.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Al.debounce=_a,Al.defaults=cr,Al.defaultsDeep=mr,Al.defer=ha,Al.delay=Sa,Al.difference=Io,Al.differenceBy=Do,Al.differenceWith=xo,Al.drop=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=l||void 0===t?1:tr(t))<0?0:t,n):[]},Al.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,0,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t):[]},Al.dropRightWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3),!0,!0):[]},Al.dropWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3),!0):[]},Al.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=tr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:tr(n))<0&&(n+=i),n=l>n?0:lr(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Al.filter=function(e,t){return(La(e)?at:ln)(e,$i(t,3))},Al.flatMap=function(e,t){return nn(sa(e,t),1)},Al.flatMapDeep=function(e,t){return nn(sa(e,t),1/0)},Al.flatMapDepth=function(e,t,l){return l=void 0===l?1:tr(l),nn(sa(e,t),l)},Al.flatten=wo,Al.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Al.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:tr(t)):[]},Al.flip=function(e){return Fi(e,512)},Al.flow=jr,Al.flowRight=zr,Al.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Al.functions=function(e){return null==e?[]:dn(e,_r(e))},Al.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Al.groupBy=ra,Al.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Al.intersection=Ro,Al.intersectionBy=ko,Al.intersectionWith=Mo,Al.invert=Er,Al.invertBy=fr,Al.invokeMap=ua,Al.iteratee=Gr,Al.keyBy=da,Al.keys=_r,Al.keysIn=hr,Al.map=sa,Al.mapKeys=function(e,t){var l={};return t=$i(t,3),rn(e,function(e,n,i){Gl(l,t(e,n,i),e)}),l},Al.mapValues=function(e,t){var l={};return t=$i(t,3),rn(e,function(e,n,i){Gl(l,n,t(e,n,i))}),l},Al.matches=function(e){return An($l(e,1))},Al.matchesProperty=function(e,t){return In(e,$l(t,1))},Al.memoize=Ta,Al.merge=Sr,Al.mergeWith=Tr,Al.method=Kr,Al.methodOf=Yr,Al.mixin=$r,Al.negate=ba,Al.nthArg=function(e){return e=tr(e),Mn(function(t){return xn(t,e)})},Al.omit=br,Al.omitBy=function(e,t){return Nr(e,ba($i(t)))},Al.once=function(e){return Ea(2,e)},Al.orderBy=function(e,t,l,n){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(l=n?void 0:l)||(l=null==l?[]:[l]),On(e,t,l))},Al.over=Xr,Al.overArgs=ya,Al.overEvery=Qr,Al.overSome=Zr,Al.partial=Na,Al.partialRight=Ca,Al.partition=ca,Al.pick=yr,Al.pickBy=Nr,Al.property=Jr,Al.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Al.pull=Bo,Al.pullAll=Uo,Al.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?wn(e,t,$i(l,2)):e},Al.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?wn(e,t,void 0,l):e},Al.pullAt=Wo,Al.range=eu,Al.rangeRight=tu,Al.rearg=Aa,Al.reject=function(e,t){return(La(e)?at:ln)(e,ba($i(t,3)))},Al.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=$i(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Pn(e,i),l},Al.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:tr(t))},Al.reverse=Ho,Al.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),(La(e)?Bl:Bn)(e,t)},Al.set=function(e,t,l){return null==e?e:Un(e,t,l)},Al.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Al.shuffle=function(e){return(La(e)?Ul:jn)(e)},Al.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:tr(t),l=void 0===l?n:tr(l)),zn(e,t,l)):[]},Al.sortBy=ma,Al.sortedUniq=function(e){return e&&e.length?Yn(e):[]},Al.sortedUniqBy=function(e,t){return e&&e.length?Yn(e,$i(t,2)):[]},Al.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=qn(t))&&Mt(e)?ri(zt(e),0,l):e.split(t,l):[]},Al.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(tr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Al.tail=function(e){var t=null==e?0:e.length;return t?zn(e,1,t):[]},Al.take=function(e,t,l){return e&&e.length?zn(e,0,(t=l||void 0===t?1:tr(t))<0?0:t):[]},Al.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t,n):[]},Al.takeRightWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3),!1,!0):[]},Al.takeWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3)):[]},Al.tap=function(e,t){return t(e),e},Al.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return Ha(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),_a(e,t,{leading:i,maxWait:t,trailing:o})},Al.thru=ea,Al.toArray=Ja,Al.toPairs=Cr,Al.toPairsIn=Ar,Al.toPath=function(e){return La(e)?dt(e,No):qa(e)?[e]:Ei(yo(or(e)))},Al.toPlainObject=ir,Al.transform=function(e,t,l){var n=La(e),i=n||ka(e)||Xa(e);if(t=$i(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:Ha(e)&&Ba(o)?Il(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Al.unary=function(e){return pa(e,1)},Al.union=jo,Al.unionBy=zo,Al.unionWith=Vo,Al.uniq=function(e){return e&&e.length?Xn(e):[]},Al.uniqBy=function(e,t){return e&&e.length?Xn(e,$i(t,2)):[]},Al.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Al.unset=function(e,t){return null==e||Qn(e,t)},Al.unzip=Go,Al.unzipWith=Ko,Al.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Al.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Al.values=Ir,Al.valuesIn=function(e){return null==e?[]:Dt(e,hr(e))},Al.without=Yo,Al.words=Br,Al.wrap=function(e,t){return Na(ii(t),e)},Al.xor=$o,Al.xorBy=qo,Al.xorWith=Xo,Al.zip=Qo,Al.zipObject=function(e,t){return li(e||[],t||[],Hl)},Al.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Al.zipWith=Zo,Al.entries=Cr,Al.entriesIn=Ar,Al.extend=rr,Al.extendWith=ur,$r(Al,Al),Al.add=ou,Al.attempt=Ur,Al.camelCase=Dr,Al.capitalize=xr,Al.ceil=au,Al.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=nr(l))==l?l:0),void 0!==t&&(t=(t=nr(t))==t?t:0),Yl(nr(e),t,l)},Al.clone=function(e){return $l(e,4)},Al.cloneDeep=function(e){return $l(e,5)},Al.cloneDeepWith=function(e,t){return $l(e,5,t="function"==typeof t?t:void 0)},Al.cloneWith=function(e,t){return $l(e,4,t="function"==typeof t?t:void 0)},Al.conformsTo=function(e,t){return null==t||ql(e,t,_r(t))},Al.deburr=Or,Al.defaultTo=function(e,t){return null==e||e!=e?t:e},Al.divide=ru,Al.endsWith=function(e,t,l){e=or(e),t=qn(t);var n=e.length,i=l=void 0===l?n:Yl(tr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Al.eq=Ia,Al.escape=function(e){return(e=or(e))&&M.test(e)?e.replace(R,Rt):e},Al.escapeRegExp=function(e){return(e=or(e))&&V.test(e)?e.replace(z,"\\$&"):e},Al.every=function(e,t,l){var n=La(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,$i(t,3))},Al.find=na,Al.findIndex=Oo,Al.findKey=function(e,t){return Et(e,$i(t,3),rn)},Al.findLast=ia,Al.findLastIndex=Lo,Al.findLastKey=function(e,t){return Et(e,$i(t,3),un)},Al.floor=uu,Al.forEach=oa,Al.forEachRight=aa,Al.forIn=function(e,t){return null==e?e:on(e,$i(t,3),hr)},Al.forInRight=function(e,t){return null==e?e:an(e,$i(t,3),hr)},Al.forOwn=function(e,t){return e&&rn(e,$i(t,3))},Al.forOwnRight=function(e,t){return e&&un(e,$i(t,3))},Al.get=vr,Al.gt=Da,Al.gte=xa,Al.has=function(e,t){return null!=e&&to(e,t,pn)},Al.hasIn=pr,Al.head=Po,Al.identity=Vr,Al.includes=function(e,t,l,n){e=Pa(e)?e:Ir(e),l=l&&!n?tr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),$a(e)?l<=i&&e.indexOf(t,l)>-1:!!i&>(e,t,l)>-1},Al.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),gt(e,t,i)},Al.inRange=function(e,t,l){return t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=nr(e),t,l)},Al.invoke=gr,Al.isArguments=Oa,Al.isArray=La,Al.isArrayBuffer=wa,Al.isArrayLike=Pa,Al.isArrayLikeObject=Ra,Al.isBoolean=function(e){return!0===e||!1===e||ja(e)&&mn(e)==r},Al.isBuffer=ka,Al.isDate=Ma,Al.isElement=function(e){return ja(e)&&1===e.nodeType&&!Ga(e)},Al.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(La(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Xa(e)||Oa(e)))return!e.length;var t=eo(e);if(t==m||t==f)return!e.size;if(so(e))return!yn(e).length;for(var l in e)if(Te.call(e,l))return!1;return!0},Al.isEqual=function(e,t){return hn(e,t)},Al.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?hn(e,t,void 0,l):!!n},Al.isError=Fa,Al.isFinite=function(e){return"number"==typeof e&&tl(e)},Al.isFunction=Ba,Al.isInteger=Ua,Al.isLength=Wa,Al.isMap=za,Al.isMatch=function(e,t){return e===t||Sn(e,t,Xi(t))},Al.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Xi(t),l)},Al.isNaN=function(e){return Va(e)&&e!=+e},Al.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tn(e)},Al.isNil=function(e){return null==e},Al.isNull=function(e){return null===e},Al.isNumber=Va,Al.isObject=Ha,Al.isObjectLike=ja,Al.isPlainObject=Ga,Al.isRegExp=Ka,Al.isSafeInteger=function(e){return Ua(e)&&e>=-9007199254740991&&e<=9007199254740991},Al.isSet=Ya,Al.isString=$a,Al.isSymbol=qa,Al.isTypedArray=Xa,Al.isUndefined=function(e){return void 0===e},Al.isWeakMap=function(e){return ja(e)&&eo(e)==h},Al.isWeakSet=function(e){return ja(e)&&"[object WeakSet]"==mn(e)},Al.join=function(e,t){return null==e?"":ll.call(e,t)},Al.kebabCase=Lr,Al.last=Fo,Al.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=tr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,ht,i,!0)},Al.lowerCase=wr,Al.lowerFirst=Pr,Al.lt=Qa,Al.lte=Za,Al.max=function(e){return e&&e.length?tn(e,Vr,vn):void 0},Al.maxBy=function(e,t){return e&&e.length?tn(e,$i(t,2),vn):void 0},Al.mean=function(e){return St(e,Vr)},Al.meanBy=function(e,t){return St(e,$i(t,2))},Al.min=function(e){return e&&e.length?tn(e,Vr,Nn):void 0},Al.minBy=function(e,t){return e&&e.length?tn(e,$i(t,2),Nn):void 0},Al.stubArray=lu,Al.stubFalse=nu,Al.stubObject=function(){return{}},Al.stubString=function(){return""},Al.stubTrue=function(){return!0},Al.multiply=du,Al.nth=function(e,t){return e&&e.length?xn(e,tr(t)):void 0},Al.noConflict=function(){return ze._===this&&(ze._=Ae),this},Al.noop=qr,Al.now=va,Al.pad=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Oi(Zt(i),l)+e+Oi(Qt(i),l)},Al.padEnd=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?e+Oi(t-n,l):e},Al.padStart=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?Oi(t-n,l)+e:e},Al.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(or(e).replace(G,""),t||0)},Al.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=er(e),void 0===t?(t=e,e=0):t=er(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Rn(e,t)},Al.reduce=function(e,t,l){var n=La(e)?ct:yt,i=arguments.length<3;return n(e,$i(t,4),l,i,Zl)},Al.reduceRight=function(e,t,l){var n=La(e)?mt:yt,i=arguments.length<3;return n(e,$i(t,4),l,i,Jl)},Al.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),kn(or(e),t)},Al.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Al.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[No(t[n])];void 0===o&&(n=i,o=l),e=Ba(o)?o.call(e):o}return e},Al.round=su,Al.runInContext=e,Al.sample=function(e){return(La(e)?Fl:Fn)(e)},Al.size=function(e){if(null==e)return 0;if(Pa(e))return $a(e)?jt(e):e.length;var t=eo(e);return t==m||t==f?e.size:yn(e).length},Al.snakeCase=Rr,Al.some=function(e,t,l){var n=La(e)?vt:Vn;return l&&oo(e,t,l)&&(t=void 0),n(e,$i(t,3))},Al.sortedIndex=function(e,t){return Gn(e,t)},Al.sortedIndexBy=function(e,t,l){return Kn(e,t,$i(l,2))},Al.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Al.sortedLastIndex=function(e,t){return Gn(e,t,!0)},Al.sortedLastIndexBy=function(e,t,l){return Kn(e,t,$i(l,2),!0)},Al.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(Ia(e[l],t))return l}return-1},Al.startCase=kr,Al.startsWith=function(e,t,l){return e=or(e),l=null==l?0:Yl(tr(l),0,e.length),t=qn(t),e.slice(l,l+t.length)==t},Al.subtract=cu,Al.sum=function(e){return e&&e.length?Nt(e,Vr):0},Al.sumBy=function(e,t){return e&&e.length?Nt(e,$i(t,2)):0},Al.template=function(e,t,l){var n=Al.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=or(e),t=ur({},t,n,Bi);var i,o,a=ur({},t.imports,n.imports,Bi),r=_r(a),u=Dt(a,r),d=0,s=t.interpolate||re,c="__p += '",m=pe((t.escape||re).source+"|"+s.source+"|"+(s===U?J:re).source+"|"+(t.evaluate||re).source+"|$","g"),v="//# sourceURL="+(Te.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(m,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(ue,kt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Te.call(t,"variable")&&t.variable;if(p){if(Q.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(O,""):c).replace(L,"$1").replace(w,"$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 E=Ur(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(E.source=c,Fa(E))throw E;return E},Al.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=Ct(n,t=$i(t));++l<e;)t(l);return i},Al.toFinite=er,Al.toInteger=tr,Al.toLength=lr,Al.toLower=function(e){return or(e).toLowerCase()},Al.toNumber=nr,Al.toSafeInteger=function(e){return e?Yl(tr(e),-9007199254740991,9007199254740991):0===e?e:0},Al.toString=or,Al.toUpper=function(e){return or(e).toUpperCase()},Al.trim=function(e,t,l){if((e=or(e))&&(l||void 0===t))return At(e);if(!e||!(t=qn(t)))return e;var n=zt(e),i=zt(t);return ri(n,Ot(n,i),Lt(n,i)+1).join("")},Al.trimEnd=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=qn(t)))return e;var n=zt(e);return ri(n,0,Lt(n,zt(t))+1).join("")},Al.trimStart=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.replace(G,"");if(!e||!(t=qn(t)))return e;var n=zt(e);return ri(n,Ot(n,zt(t))).join("")},Al.truncate=function(e,t){var l=30,n="...";if(Ha(t)){var i="separator"in t?t.separator:i;l="length"in t?tr(t.length):l,n="omission"in t?qn(t.omission):n}var o=(e=or(e)).length;if(Mt(e)){var a=zt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Ka(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=pe(i.source,or(ee.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(qn(i),r)!=r){var m=u.lastIndexOf(i);m>-1&&(u=u.slice(0,m))}return u+n},Al.unescape=function(e){return(e=or(e))&&k.test(e)?e.replace(P,Gt):e},Al.uniqueId=function(e){var t=++be;return or(e)+t},Al.upperCase=Mr,Al.upperFirst=Fr,Al.each=oa,Al.eachRight=aa,Al.first=Po,$r(Al,(iu={},rn(Al,function(e,t){Te.call(Al.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),Al.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Al[e].placeholder=Al}),nt(["drop","take"],function(e,t){Ol.prototype[e]=function(l){l=void 0===l?1:il(tr(l),0);var n=this.__filtered__&&!t?new Ol(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ol.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Ol.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$i(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ol.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ol.prototype[e]=function(){return this.__filtered__?new Ol(this):this[l](1)}}),Ol.prototype.compact=function(){return this.filter(Vr)},Ol.prototype.find=function(e){return this.filter(e).head()},Ol.prototype.findLast=function(e){return this.reverse().find(e)},Ol.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ol(this):this.map(function(l){return gn(l,e,t)})}),Ol.prototype.reject=function(e){return this.filter(ba($i(e)))},Ol.prototype.slice=function(e,t){e=tr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ol(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=tr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Ol.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ol.prototype.toArray=function(){return this.take(4294967295)},rn(Ol.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Al[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Al.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ol,u=a[0],d=r||La(t),s=function(e){var t=i.apply(Al,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,m=!!this.__actions__.length,v=o&&!c,p=r&&!m;if(!o&&d){t=p?t:new Ol(this);var E=e.apply(t,a);return E.__actions__.push({func:ea,args:[s],thisArg:void 0}),new xl(E,c)}return v&&p?e.apply(this,a):(E=this.thru(s),v?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Al.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[l](function(l){return t.apply(La(l)?l:[],e)})}}),rn(Ol.prototype,function(e,t){var l=Al[t];if(l){var n=l.name+"";Te.call(gl,n)||(gl[n]=[]),gl[n].push({name:t,func:l})}}),gl[Ai(void 0,2).name]=[{name:"wrapper",func:void 0}],Ol.prototype.clone=function(){var e=new Ol(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},Ol.prototype.reverse=function(){if(this.__filtered__){var e=new Ol(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ol.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=La(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,m=0,v=ol(u,this.__takeCount__);if(!l||!n&&i==u&&v==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var E=-1,f=e[d+=t];++E<c;){var g=s[E],_=g.type,h=(0,g.iteratee)(f);if(2==_)f=h;else if(!h){if(1==_)continue e;break e}}p[m++]=f}return p},Al.prototype.at=ta,Al.prototype.chain=function(){return Jo(this)},Al.prototype.commit=function(){return new xl(this.value(),this.__chain__)},Al.prototype.next=function(){void 0===this.__values__&&(this.__values__=Ja(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Al.prototype.plant=function(e){for(var t,l=this;l instanceof Dl;){var n=Ao(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Al.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ol){var t=e;return this.__actions__.length&&(t=new Ol(this)),(t=t.reverse()).__actions__.push({func:ea,args:[Ho],thisArg:void 0}),new xl(t,this.__chain__)}return this.thru(Ho)},Al.prototype.toJSON=Al.prototype.valueOf=Al.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Al.prototype.first=Al.prototype.head,pt&&(Al.prototype[pt]=function(){return this}),Al}();Ge?((Ge.exports=Kt)._=Kt,Ve._=Kt):ze._=Kt}).call(De)});const At=e=>{var t,n,a;let{data:r,OpenImage:u}=e;const{t:d}=o.useTranslation();return i.createElement("div",null,r.date&&i.createElement("p",null,r.date),i.createElement("p",null,r.name),r.mobileNumber&&i.createElement(l.TelePhone,{mobile:r.mobileNumber}),r.source&&i.createElement("p",null,d("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),null!=r&&r.wfComment?i.createElement("div",null,null==r||null===(t=r.wfComment)||void 0===t?void 0:t.map(e=>i.createElement("div",{className:"TLComments"},i.createElement("h3",null,d("WF_COMMON_COMMENTS")),i.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(n=r.thumbnailsToShow)||void 0===n||null===(a=n.thumbs)||void 0===a?void 0:a.length)>0?i.createElement("div",{className:"TLComments"},i.createElement("h3",null,d("CS_COMMON_ATTACHMENTS")),i.createElement(l.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:()=>{u(null==r?void 0:r.thumbnailsToShow)}})):null)},It=e=>{var t,r,u,d,s,c;let m=null==e||null===(t=e.application)||void 0===t?void 0:t.bookingNo.split("-")[0];const{t:v}=o.useTranslation(),p="WT"==m?"watertanker":"MT"===m?"mobileToilet":"TP"===m?"treePruning":"unknown",E="WT"===m?"request-service.water_tanker":"MT"===m?"request-service.mobile_toilet":"TP"===m?"request-service.tree_pruning":"request-service.unknown",{isLoading:f,data:g}=Digit.Hooks.useWorkflowDetails({tenantId:null===(r=e.application)||void 0===r?void 0:r.tenantId,id:null===(u=e.application)||void 0===u?void 0:u.bookingNo,moduleCode:p});function _(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const h=t=>{if("OPEN"===t.state){var l,n;const o={date:null==t||null===(l=t.auditDetails)||void 0===l?void 0:l.lastModified,source:(null===(n=e.application)||void 0===n?void 0:n.channel)||""};return i.createElement(At,{data:o})}if(t.state){var o,a,r,u,d;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===(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 i.createElement(At,{data:e,OpenImage:_})}{var s,c;const l={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 i.createElement(At,{data:l})}};return f?i.createElement(l.Loader,null):i.createElement(i.Fragment,null,!f&&i.createElement(n.Fragment,null,(null==g||null===(d=g.timeline)||void 0===d?void 0:d.length)>0&&i.createElement(l.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=g&&g.timeline&&1===(null==g||null===(s=g.timeline)||void 0===s?void 0:s.length)?i.createElement(l.CheckPoint,{isCompleted:!0,label:v((null==g||null===(c=g.timeline[0])||void 0===c?void 0:c.state)&&""+g.timeline[0].state||"NA"),customChild:h(null==g?void 0:g.timeline[0])}):i.createElement(l.ConnectingCheckPoints,null,(null==g?void 0:g.timeline)&&(null==g?void 0:g.timeline.map((e,t)=>{var n;return i.createElement(i.Fragment,{key:t},i.createElement(l.CheckPoint,{keyValue:t,isCompleted:0===t,label:v(""+(null==g||null===(n=g.processInstances[t].state)||void 0===n?void 0:n.state)),customChild:h(e)}))})))),g&&(t=>{var n,o;let r=t[0];switch(null==r?void 0:r.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?i.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},i.createElement(a.Link,{to:{pathname:`/digit-ui/citizen/payment/my-bills/${E}/${null==e||null===(n=e.application)||void 0===n?void 0:n.bookingNo}`,state:{tenantId:e.application.tenantId,bookingNo:null==e||null===(o=e.application)||void 0===o?void 0:o.bookingNo}}},i.createElement(l.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==g?void 0:g.nextActions))},Dt=e=>i.createElement("span",{className:"cell-text"},e),xt=e=>i.createElement("span",{className:"sla-cell"},e),Ot=e=>{var t;let{searchParams:a,onFilterChange:u,defaultSearchParams:d,...s}=e;const{t:c}=o.useTranslation(),[m,v]=(r.useQueryClient(),n.useState(()=>({...a,services:[]}))),p=e=>{let t=e.delete,l={...m,...e};t&&t.forEach(e=>delete l[e]),delete e.delete,v({...l})},E=()=>{v({...d,services:[]}),u({...d})},f=Digit.ULBService.getCurrentTenantId();return i.createElement(i.Fragment,null,i.createElement("div",{className:"filter-card"},i.createElement("div",{className:"heading",style:{alignItems:"center"}},i.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},i.createElement("span",null,i.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"}))),i.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},c("ES_COMMON_FILTER_BY"),":")),i.createElement("div",{className:"clearAll",onClick:E},c("ES_COMMON_CLEAR_ALL")),"desktop"===s.type&&i.createElement("span",{className:"clear-search",onClick:E,style:{border:"1px solid #e0e0e0",padding:"6px"}},i.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"===s.type&&i.createElement("span",{onClick:s.onClose},i.createElement(l.CloseSvg,null))),i.createElement("form",{id:"filter-form"},i.createElement("div",{className:"filter-form-field"},i.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},c("ES_INBOX_LOCALITY"),":"),i.createElement(l.Localities,{selectLocality:e=>{p({locality:[...(null==m?void 0:m.locality)||[],e]})},tenantId:f,boundaryType:"revenue"}),i.createElement("div",{className:"tag-container hide-x-scrollbar"},null==m||null===(t=m.locality)||void 0===t?void 0:t.map((e,t)=>i.createElement(l.RemoveableTag,{key:t,text:c(e.i18nkey),onClick:()=>{p({locality:null==m?void 0:m.locality.filter(t=>t.code!==e.code)})}})))),i.createElement("div",null,i.createElement(l.SubmitBar,{className:"w-fullwidth",onSubmit:()=>{u(0===m.services.length?{...m,services:d.services}:m)},label:c("ES_COMMON_APPLY")})))))},Lt=e=>i.createElement("h1",{className:"heading-m"},e.label),wt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pt=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(wt,null)),Rt=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:g}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,h]=n.useState({}),[S,T]=n.useState({}),[b,y]=n.useState([]),[N,C]=n.useState(null),[A,I]=n.useState(null),[D,x]=n.useState(null),[O,L]=n.useState(null),[P,R]=n.useState([]),[k,M]=n.useState(null),[F,B]=n.useState(!1);function U(e){I(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&R(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;y(null==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(A){const e=function(){if(A.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",A,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?x(null==e||null===(n=e.data)||void 0===n||null===(i=n.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)}}()},[A]),n.useEffect(()=>{r&&h(null!=r&&r.showFinancialYearsModal?(e=>{let{t:t,action:n,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${n.action}_APPLICATION`,submit:"WF_PT.CREATE_"+n.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:t("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:i.createElement(l.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:n(m||"WF_ROLE_"+(null===(t=o.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PT_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:n("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:N,setSelectedApprover:C,selectFile:U,uploadedFile:D,setUploadedFile:x,businessService:m}))},[r,b,P,k,D]),r&&_.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Lt,{label:a(_.label.heading)}),headerBarEnd:i.createElement(Pt,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:E||(null==r?void 0:r.docUploadRequired)&&!D,formId:"modal-action"},f?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};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==k?void 0:k.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,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:m,moduleName:v};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]),s({Property:{...c,workflow:t}})}},defaultValues:S,formId:"modal-action"})):i.createElement(l.Loader,null)},kt=e=>i.createElement("h1",{className:"heading-m"},e.label),Mt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),Ft=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Mt,null)),Bt=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:p,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[f,g]=n.useState({}),[_,h]=n.useState({}),[S,T]=n.useState([]),[b,y]=n.useState({}),[N,C]=n.useState(null),[A,I]=n.useState(null),[D,x]=n.useState(null),[O,L]=n.useState([]),[P,R]=n.useState(null);function k(e){C(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;T(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{r&&g((e=>{let{t:t,action:n,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(null==n?void 0:n.action)||(m=!1),n.isTerminateState&&(m=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:m?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?i.createElement(l.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:k,uploadedFile:A,setUploadedFile:I,businessService:m}))},[r,S,O,P,A]),r&&f.form?i.createElement(l.Modal,{headerBarMain:i.createElement(kt,{label:a(f.label.heading)}),headerBarEnd:i.createElement(Ft,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},p?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:f.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:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:A}]:null},s({Licenses:[c]})},defaultValues:_,formId:"modal-action"})):i.createElement(l.Loader,null)},Ut=e=>i.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Wt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ht=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Wt,null)),jt=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m}=e;const{data:v,isLoading:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState({}),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function O(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))D(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",y,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==n?void 0:n.action)&&(v=!1),n.isTerminateState&&(v=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?i.createElement(l.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:O,uploadedFile:C,setUploadedFile:A,businessService:m,error:I}))},[r,h,C,I]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Ut,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Ht,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:x?{width:"720px"}:{},style:x?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:x?{paddingLeft:"5px"}:{}},p?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:E.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!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:C}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},zt=e=>i.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Vt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gt=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Vt,null)),Kt=e=>{var t,o,a,u,d,s,c,m,v,p,E,f;let{t:g,action:_,tenantId:h,closeModal:S,submitAction:T,applicationDetails:b,applicationData:y,businessService:N,workflowDetails:C}=e;Digit.Hooks.obps.useObpsAPI(null!==(t=y)&&void 0!==t&&null!==(o=t.landInfo)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.city?null===(u=y)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:h,!1);const{data:A,isLoading:I}=Digit.Hooks.useEmployeeSearch(h,{roles:null==C||null===(c=C.data)||void 0===c||null===(m=c.initialActionState)||void 0===m||null===(v=m.nextActions)||void 0===v||null===(p=v.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===p||null===(E=p[0])||void 0===E||null===(f=E.assigneeRoles)||void 0===f?void 0:f.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[D,x]=(r.useQueryClient(),n.useState({})),[O,L]=n.useState({}),[P,R]=n.useState([]),[k,M]=n.useState({}),[F,B]=n.useState(null),[U,W]=n.useState(null),[H,j]=n.useState(null),[z,V]=n.useState(null),G=!!Digit.Utils.browser.isMobile();function K(e){B(e.target.files[0])}n.useEffect(()=>{var e;R(null==A||null===(e=A.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}}))},[A]),n.useEffect(()=>{!function(){try{j(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)j(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))j(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?W(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):j(g("CS_FILE_UPLOAD_ERROR"))})},function(){j(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)}}()},[F]);const Y=e=>{let t=[];return e&&e.map((e,l)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},q=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Y(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},X=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...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&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},Q=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return n.useEffect(()=>{_&&x((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||E?null:n(m||"WF_ROLE_"+(null===(t=o.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:o.isTerminateState||E?null:i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:g,action:_,approvers:P,selectedApprover:k,setSelectedApprover:M,selectFile:K,uploadedFile:U,setUploadedFile:W,businessService:N,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[_,P,z,U,H]),_&&D.form?i.createElement(l.Modal,{headerBarMain:i.createElement(zt,{label:g(D.label.heading)}),headerBarEnd:i.createElement(Gt,{onClick:S}),actionCancelLabel:g(D.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:g(D.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:G?{width:"720px"}:{},style:G?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:G?{paddingLeft:"5px"}:{}},I?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:D.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a;y={...y,documents:X(),additionalDetails:{...null===(t=y)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(y),pendingapproval:Q()},workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:U?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:U?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null};const r=null==b||null===(i=b.nocData)||void 0===i?void 0:i.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 u={sourceRefId:null==r||null===(o=r[0])||void 0===o||null===(a=o.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(h,u)).then(function(e){var t;let l=!0,n=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=n||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(n=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,u,d,s,c,m,v,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(m=e.Noc)||void 0===m||null===(v=m.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&n)&&i.push(e)}),T({BPA:y},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:O,formId:"modal-action"})):i.createElement(l.Loader,null)},Yt=e=>i.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),$t=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),qt=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement($t,null)),Xt=e=>{var t,o;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:m,applicationData:v,businessService:p}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(t=d.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[g,_]=(r.useQueryClient(),n.useState({})),[h,S]=n.useState({}),[T,b]=n.useState([]),[y,N]=n.useState({}),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function P(e){A(e.target.files[0])}return a.useHistory(),n.useEffect(()=>{var e;b(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",C,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?D(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(u("CS_FILE_UPLOAD_ERROR"))})},function(){O(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{d&&_((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(E=!0);let f=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(f=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||f?null:n(m||"WF_ROLE_"+(null===(t=o.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:o.isTerminateState||f?null:i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:d,approvers:T,selectedApprover:y,setSelectedApprover:N,selectFile:P,uploadedFile:I,setUploadedFile:D,businessService:p,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:x}))},[d,T,I,x]),d&&g.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Yt,{label:u(g.label.heading)}),headerBarEnd:i.createElement(qt,{onClick:c}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(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"}:{}},f?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=v)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=v)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),v={...v,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,documents:I?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:I}]:null},documents:o},m({Noc:v},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):i.createElement(l.Loader,null)};function Qt(e){var t=this.__data__=new st(e);this.size=t.size}Qt.prototype.clear=function(){this.__data__=new st,this.size=0},Qt.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Qt.prototype.get=function(e){return this.__data__.get(e)},Qt.prototype.has=function(e){return this.__data__.has(e)},Qt.prototype.set=function(e,t){var l=this.__data__;if(l instanceof st){var n=l.__data__;if(!ct||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new pt(n)}return l.set(e,t),this.size=l.size,this};var Zt=Qt,Jt=function(){try{var e=et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),el=function(e,t,l){"__proto__"==t&&Jt?Jt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},tl=Object.prototype.hasOwnProperty,ll=function(e,t,l){var n=e[t];tl.call(e,t)&&at(n,l)&&(void 0!==l||t in e)||el(e,t,l)},nl=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?el(l,r,u):ll(l,r,u)}return l},il=function(e){return je(e)&&"[object Arguments]"==He(e)},ol=Object.prototype,al=ol.hasOwnProperty,rl=ol.propertyIsEnumerable,ul=il(function(){return arguments}())?il:function(e){return je(e)&&al.call(e,"callee")&&!rl.call(e,"callee")},dl=function(){return!1},sl=xe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?Pe.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||dl}),cl=/^(?:0|[1-9]\d*)$/,ml=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&cl.test(e))&&e>-1&&e%1==0&&e<t},vl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},pl={};pl["[object Float32Array]"]=pl["[object Float64Array]"]=pl["[object Int8Array]"]=pl["[object Int16Array]"]=pl["[object Int32Array]"]=pl["[object Uint8Array]"]=pl["[object Uint8ClampedArray]"]=pl["[object Uint16Array]"]=pl["[object Uint32Array]"]=!0,pl["[object Arguments]"]=pl["[object Array]"]=pl["[object ArrayBuffer]"]=pl["[object Boolean]"]=pl["[object DataView]"]=pl["[object Date]"]=pl["[object Error]"]=pl["[object Function]"]=pl["[object Map]"]=pl["[object Number]"]=pl["[object Object]"]=pl["[object RegExp]"]=pl["[object Set]"]=pl["[object String]"]=pl["[object WeakMap]"]=!1;var El=function(e){return function(t){return e(t)}},fl=xe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&Le.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),gl=fl&&fl.isTypedArray,_l=gl?El(gl):function(e){return je(e)&&vl(e.length)&&!!pl[He(e)]},hl=Object.prototype.hasOwnProperty,Sl=function(e,t){var l=Ie(e),n=!l&&ul(e),i=!l&&!n&&sl(e),o=!l&&!n&&!i&&_l(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!hl.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ml(d,u))||r.push(d);return r},Tl=Object.prototype,bl=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Tl)},yl=function(e,t){return function(l){return e(t(l))}},Nl=yl(Object.keys,Object),Cl=Object.prototype.hasOwnProperty,Al=function(e){return null!=e&&vl(e.length)&&!Ye(e)},Il=function(e){return Al(e)?Sl(e):function(e){if(!bl(e))return Nl(e);var t=[];for(var l in Object(e))Cl.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Dl=Object.prototype.hasOwnProperty,xl=function(e){return Al(e)?Sl(e,!0):function(e){if(!Ke(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=bl(e),l=[];for(var n in e)("constructor"!=n||!t&&Dl.call(e,n))&&l.push(n);return l}(e)},Ol=xe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?Pe.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Ll=function(){return[]},wl=Object.prototype.propertyIsEnumerable,Pl=Object.getOwnPropertySymbols,Rl=Pl?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];wl.call(e,r)&&(a[o++]=r)}return a}(Pl(e)))}:Ll,kl=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},Ml=yl(Object.getPrototypeOf,Object),Fl=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)kl(t,Rl(e)),e=Ml(e);return t}:Ll,Bl=function(e,t,l){var n=t(e);return Ie(e)?n:kl(n,l(e))},Ul=function(e){return Bl(e,Il,Rl)},Wl=function(e){return Bl(e,xl,Fl)},Hl=et(Pe,"DataView"),jl=et(Pe,"Promise"),zl=et(Pe,"Set"),Vl=et(Pe,"WeakMap"),Gl=Qe(Hl),Kl=Qe(ct),Yl=Qe(jl),$l=Qe(zl),ql=Qe(Vl),Xl=He;(Hl&&"[object DataView]"!=Xl(new Hl(new ArrayBuffer(1)))||ct&&"[object Map]"!=Xl(new ct)||jl&&"[object Promise]"!=Xl(jl.resolve())||zl&&"[object Set]"!=Xl(new zl)||Vl&&"[object WeakMap]"!=Xl(new Vl))&&(Xl=function(e){var t=He(e),l="[object Object]"==t?e.constructor:void 0,n=l?Qe(l):"";if(n)switch(n){case Gl:return"[object DataView]";case Kl:return"[object Map]";case Yl:return"[object Promise]";case $l:return"[object Set]";case ql:return"[object WeakMap]"}return t});var Ql=Xl,Zl=Object.prototype.hasOwnProperty,Jl=Pe.Uint8Array,en=function(e){var t=new e.constructor(e.byteLength);return new Jl(t).set(new Jl(e)),t},tn=/\w*$/,ln=Re?Re.prototype:void 0,nn=ln?ln.valueOf:void 0,on=Object.create,an=function(){function e(){}return function(t){if(!Ke(t))return{};if(on)return on(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),rn=fl&&fl.isMap,un=rn?El(rn):function(e){return je(e)&&"[object Map]"==Ql(e)},dn=fl&&fl.isSet,sn=dn?El(dn):function(e){return je(e)&&"[object Set]"==Ql(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 mn=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!Ke(t))return t;var c=Ie(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Zl.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!u)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var m=Ql(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(sl(t))return Ol(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!o){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||bl(e)?{}:an(Ml(e))}(t),!u)return d?function(e,t){return nl(e,Fl(e),t)}(t,function(e,t){return e&&nl(t,xl(t),e)}(r,t)):function(e,t){return nl(e,Rl(e),t)}(t,function(e,t){return e&&nl(t,Il(t),e)}(r,t))}else{if(!cn[m])return o?t:{};r=function(e,t,l){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return en(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return function(e,t){var l=t?en(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);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 l=t?en(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,tn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new n;case"[object Symbol]":return nn?Object(nn.call(e)):{}}}(t,m,u)}}a||(a=new Zt);var p=a.get(t);if(p)return p;a.set(t,r),sn(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):un(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?Wl:Ul:d?xl:Il)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),ll(r,o,e(i,l,n,o,t,a))}),r},vn=function(e){return mn(e,5)};const pn=e=>i.createElement("h1",{className:"heading-m"},e.label),En=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),fn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(En,null)),gn=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},_n=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,cardClassName:v,cardFormWrapperClassName:E,cardFormClassName:f,formClassName:g}=e;const{data:_,isLoading:h}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,T]=n.useState({}),[b,y]=n.useState({}),[N,C]=n.useState([]),[A,I]=n.useState({}),[D,x]=n.useState(null),[O,L]=n.useState(null),[P,R]=n.useState(null),k=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){x(e.target.files[0])}return n.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))R(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",D,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),R(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)}}()},[D]),n.useEffect(()=>{var e,t,n,o;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=c)||void 0===n||null===(o=n.processInstance)||void 0===o?void 0:o.businessService)?r&&T((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,E=!0,f=!1;return(null!=o&&null!==(t=o.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(E=!1),o.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(f=!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:E?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},f&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>i.createElement(l.DatePicker,p({onChange:e.onChange,date:e.value},t))}:null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:N,selectedApprover:A,setSelectedApprover:I,selectFile:F,uploadedFile:O,setUploadedFile:L,businessService:m,error:P})):r&&T((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,p=!0;return(null!=o&&null!==(t=o.action)&&void 0!==t&&t.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==m?void 0:m.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:N,selectedApprover:A,setSelectedApprover:I,selectFile:F,uploadedFile:O,setUploadedFile:L,businessService:m,error:P}))},[r,N,O,P]),r&&S.form?i.createElement(l.Modal,{headerBarMain:i.createElement(pn,{label:a(S.label.heading)}),headerBarEnd:i.createElement(fn,{onClick:d}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:k&&M?{width:"100%",height:"auto"}:{}},h?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,m,v,p;if(null!==(t=c)&&void 0!==t&&t.isBillAmend){var E,f,g,_,h,S,T,b,y;const t={...null===(E=c)||void 0===E||null===(f=E.billAmendmentDetails)||void 0===f?void 0:f.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(g=c)||void 0===g?void 0:g.billAmendmentDetails,workflow:{businessId:null===(_=c)||void 0===_||null===(h=_.billAmendmentDetails)||void 0===h?void 0:h.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=c)&&void 0!==S&&null!==(T=S.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=c)&&void 0!==b&&null!==(y=b.applicationType)&&void 0!==y&&y.includes("WATER")?"WS":"SW",assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:[]}};s({AmendmentUpdate:l})}else{if(c={...c,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:[],assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:null,processInstance:{...null===(l=c)||void 0===l?void 0:l.processInstance,action:null==r?void 0:r.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:[]}},null!=e&&e.date&&null!==(n=c)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=vn(null==e?void 0:e.date);c.disconnectionExecutionDate=gn(t)}else if(null!=e&&e.date){const t=vn(null==e?void 0:e.date);c.connectionExecutionDate=gn(t)}var N;if("DisconnectWSConnection"==(null===(o=c)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=c)||void 0===d||null===(m=d.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(N=c)||void 0===N?void 0:N.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=c)||void 0===v?void 0:v.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(p=c)||void 0===p?void 0:p.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var C,I,x,L,w,P,R,k,M,F,B,U,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(C=t.value)&&void 0!==C&&C.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(W=c)||void 0===W?void 0:W.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:b,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:E,cardClassName:v,formClassName:g})):i.createElement(l.Loader,null)},hn=e=>i.createElement("h1",{className:"heading-m"},e.label),Sn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Sn,null)),bn=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;console.log("applicationData",c);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_PTR_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:t("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_PTR_ACTION_FILEUPLOADED"):t("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:A,businessService:m}))},[r,h,C]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(hn,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Tn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v};C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,filestoreId:C}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},yn=e=>i.createElement("h1",{className:"heading-m"},e.label),Nn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Nn,null)),An=e=>{var t,o,r;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:m,applicationData:v,businessService:p,moduleCode:E,cardClassName:f,cardFormWrapperClassName:g,cardFormClassName:_,formClassName:h}=e;const{data:S}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(t=d.roles)||void 0===t||null===(o=t[0])||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),T=a.useHistory(),[b,y]=n.useState({}),[N,C]=n.useState({}),[A,I]=n.useState([]),[D,x]=n.useState(null),[O,L]=n.useState(null);return n.useEffect(()=>{var e;I(null==S||null===(e=S.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}}))},[S]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?T.push("/digit-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.applicationNo)):y((e=>{let{t:t,action:l,businessService:n}=e;return console.log("njhsegfdhjsbedwfdwe",l),{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:A,selectedApprover:D,setSelectedApprover:x,uploadedFile:O,setUploadedFile:L,businessService:p}))},[d,A,O]),d&&b.form?i.createElement(l.Modal,{headerBarMain:i.createElement(yn,{label:u(b.label.heading)}),headerBarEnd:i.createElement(Cn,{onClick:c}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:E};O&&(t.documents=[]),m({Asset:{...v,workflow:t}})},defaultValues:N,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:g,cardClassName:f,formClassName:h})):i.createElement(l.Loader,null)},In=e=>i.createElement("h1",{className:"heading-m"},e.label),Dn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),xn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Dn,null)),On=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",y,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r}=e;return{label:{heading:"CHB_"+(null==n?void 0:n.action),submit:"CHB_"+(null==n?void 0:n.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:t("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("ES_CHB_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+t("CS_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:A,businessService:m}))},[r,h,C]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(In,{label:a(E.label.heading)}),headerBarEnd:i.createElement(xn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:v};C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:C}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},Ln=e=>i.createElement("h1",{className:"heading-m"},e.label),wn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(wn,null)),Rn=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;console.log("snjdskbjdfbjskfjkbs",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(null),[L,P]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?D(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;console.log("action",n);const d=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",d),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==n?void 0:n.state)?{label:t("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==n?void 0:n.state)?{label:t("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==n?void 0:n.state)?{label:t("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:t("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_EW_PHOTO")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:t("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_EW_ACTION_FILEUPLOADED"):t("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:R,uploadedFile:I,setUploadedFile:D,businessService:m}))},[r,h,I]),console.log("conggg",E),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Ln,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Pn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v};console.log("applicationData",e),I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:I},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},kn=e=>i.createElement("h1",{className:"heading-m"},e.label),Mn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Fn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Mn,null)),Bn=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(!1);function L(e){O(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",y,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(O(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),console.log("actyhdesh,jhfsefsef",r,c),n.useEffect(()=>{f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const m=()=>i.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:"SV_"+(null==n?void 0:n.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==n?void 0:n.action)||"REJECT"===(null==n?void 0:n.action)||"SENDBACKTOCITIZEN"===(null==n?void 0:n.action)?"":{label:t("SV_ASSIGNEE"),type:"dropdown",populators:i.createElement(l.Dropdown,{option:u,t:t,optionKey:"name",select:s,selected:d})},{label:t("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("SV_ATTATCH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement(m,null),i.createElement("span",null,"Uploading...")):a?"1 "+t("SV_FILE_UPLOADED"):t("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:A,businessService:m,isUploading:x}))},[r,h,C]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(kn,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Fn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null};C&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:C}]),s({streetVendingDetail:{...c,workflow:l}})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},Un=e=>i.createElement("h1",{className:"heading-m"},e.label),Wn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Wn,null)),jn=e=>{var t,o,a,r,u;let{t:d,action:s,tenantId:c,closeModal:m,submitAction:v,applicationData:p,businessService:E,moduleCode:f,cardClassName:g,cardFormWrapperClassName:_,cardFormClassName:h,formClassName:S}=e;const{data:T}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(t=s.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:b}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let y=[];null==b||null===(a=b.vendor)||void 0===a||a.forEach(e=>{var t,l;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.serviceType)){var n;const t=`${null==e?void 0:e.name} (${null==e||null===(n=e.owner)||void 0===n?void 0:n.mobileNumber})`;y.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:N}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let C=[];null==N||null===(r=N.vehicle)||void 0===r||null===(u=r.filter(e=>{var t,l;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.id)}))||void 0===u||u.map(e=>{var t,l;C.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.ownerId)})});const[A,I]=n.useState({}),[D,x]=n.useState({}),[O,L]=n.useState([]),[P,R]=n.useState(null),[k,M]=n.useState(null),[F,B]=n.useState(null),[U,W]=n.useState(null),[H,j]=n.useState(null);function z(e){R(e.target.files[0])}return n.useEffect(()=>{var e;L(null==T||null===(e=T.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}}))},[T]),n.useEffect(()=>{!function(){try{B(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)B(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",P,c)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?M(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(d("CS_FILE_UPLOAD_ERROR"))})},function(){B(d("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)}}()},[P]),n.useEffect(()=>{s&&I((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:m,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==n?void 0:n.action),submit:"RS_"+(null==n?void 0:n.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:t("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==n?void 0:n.state)&&"ASSIGN_VEHICLE_DRIVER"!==(null==n?void 0:n.action)?{label:t("RS_ASSIGN"),type:"dropdown",populators:i.createElement(l.Dropdown,{option:s,t:t,optionKey:"i18nKey",select:d,selected:u})}:"null","DELIVERY_PENDING"===(null==n?void 0:n.state)||"ASSIGN_VEHICLE_DRIVER"===(null==n?void 0:n.action)?{label:t("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:i.createElement(l.Dropdown,{option:c,t:t,optionKey:"i18nKey",select:v,selected:m})}:"null",{label:`${t("ES_RS_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+t("CS_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:d,action:s,selectFile:z,uploadedFile:k,setUploadedFile:M,selectedVendor:U,setSelectedVendor:W,vendorDescription:b?y:void 0,vehicleDescription:N||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?C:void 0,selectVehicle:H,setSelectVehicle:j}))},[s,O,k,b,H,N]),s&&A.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Un,{label:d(A.label.heading)}),headerBarEnd:i.createElement(Hn,{onClick:m}),actionCancelLabel:d(A.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:d(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:A.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:E,moduleName:f};k&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:k}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(p.vendorId=null==U?void 0:U.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(p.vehicleId=null==H?void 0:H.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(p.vehicleId=null==H?void 0:H.vehicleId,p.driverId=null==H?void 0:H.driverId);let l="watertanker"===E?{waterTankerBookingDetail:{...p,workflow:t}}:{mobileToiletBookingDetail:{...p,workflow:t}};v(l)},defaultValues:D,formId:"modal-action",cardFormClassName:h,cardFormWrapperClassName:_,cardClassName:g,formClassName:S})):i.createElement(l.Loader,null)},zn=e=>null!=e&&e.businessService.includes("PT")?i.createElement(Rt,e):null!=e&&e.businessService.includes("ptr")?i.createElement(bn,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")?i.createElement(Bt,e):null!=e&&e.moduleCode.includes("BPAREG")?i.createElement(jt,e):null!=e&&e.moduleCode.includes("BPA")?i.createElement(Kt,e):null!=e&&e.moduleCode.includes("NOC")?i.createElement(Xt,e):null!=e&&e.moduleCode.includes("WS")?i.createElement(_n,e):null!=e&&e.businessService.includes("asset-create")?i.createElement(An,e):null!=e&&e.businessService.includes("ewst")?i.createElement(Rn,e):null!=e&&e.businessService.includes("booking-refund")?i.createElement(On,e):null!=e&&e.businessService.includes("street-vending")?i.createElement(Bn,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?i.createElement(jn,e):void 0;function Vn(e){let{documents:t,svgStyles:n={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return i.createElement("div",{style:{marginTop:"19px"}},!s&&(null==t?void 0:t.map((e,n)=>{var o;return i.createElement(i.Fragment,{key:n},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,i.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((e,t)=>{var n;return i.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:t},i.createElement("div",{style:{display:"flex",justifyContent:"center"}},i.createElement(l.PDFSvg,null)),i.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},d(null==e?void 0:e.title)),a?null!=e&&null!==(n=e.documentType)&&void 0!==n&&n.includes("NOC")?i.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):i.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&i.createElement("div",null,i.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==t?void 0:t.length)!=n+1?i.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==t?void 0:t.map((e,t)=>{var o;return i.createElement(i.Fragment,{key:t},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,i.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>i.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=n&&n.minWidth?null==n?void 0:n.minWidth:"160px",marginRight:"20px"},key:t},i.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},i.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?i.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,i.createElement(l.PDFSvg,null),i.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")&&i.createElement("div",null,i.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Gn=e=>{var t,l;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],m=Digit.ULBService.getStateId(),[v,p]=n.useState((null==a||null===(l=a.documents)||void 0===l?void 0:l.documents)||[]),[E,f]=n.useState(null),[g,_]=n.useState([]),[h,S]=n.useState(!0),[T,b]=n.useState(!1),[y,N]=n.useState(!1),{isLoading:C,data:A}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:I,data:D}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=A&&null!==(e=A.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==A||null===(o=A.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;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===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==D||null===(t=D["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===`${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0]}.${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),_(d)},[!C,!I]),n.useEffect(()=>{let e=0;g.map(t=>{let l=!1;v.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,T]),n.useEffect(()=>{N("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),i.createElement("div",null,null==g?void 0:g.map((e,t)=>i.createElement("div",null,i.createElement(Kn,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:y}))))};function Kn(e){var t,o;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:m}=e;const v=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],p=Digit.ULBService.getStateId(),[E,f]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==r||null===(t=r.dropdownData)||void 0===t?void 0:t.length)?null==r?void 0:r.dropdownData[0]:{}),[g,_]=n.useState(null),[h,S]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[T,b]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==h?void 0:h.length)||null===h?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==E?void 0:E.code,fileStoreId:h,documentUid:h,fileName:(null==g?void 0:g.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[h,E]),n.useEffect(()=>{try{T.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],T.map(e=>{var t,l,n;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[T,E]),n.useEffect(()=>{},[g]),i.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},i.createElement(l.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)&&i.createElement(Vn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?i.createElement("div",{style:{marginTop:"20px"}},i.createElement(l.LabelFieldPair,{style:{width:"100%"}},i.createElement(l.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),i.createElement(l.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>f(e),style:{width:"100%"}})),i.createElement(l.LabelFieldPair,{style:{width:"100%"}},i.createElement(l.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),i.createElement("div",{className:"field",style:{width:"100%"}},i.createElement(l.MultiUploadWrapper,{module:"BPA",tenantId:p,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&b(n),(i=n[n.length-1])&&_(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Yn(e){let{fiReport:t,isCitizen:n=!1}=e;const{t:a}=o.useTranslation();return i.createElement(i.Fragment,null,i.createElement("div",{style:{marginTop:"10px"}},i.createElement(n?l.CardHeader:l.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),t.map((e,n)=>{var o,r,u,d,s,c;return i.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},i.createElement(l.StatusTable,null,i.createElement(l.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==t?void 0:t.length)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${n+1}`),i.createElement(l.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(o=e.date)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.date)||void 0===r?void 0:r.split("-")[1]}/${null===(u=e.date)||void 0===u?void 0:u.split("-")[0]}`:null==e?void 0:e.date:"NA"}),i.createElement(l.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>i.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},i.createElement(l.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),i.createElement(l.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),i.createElement(Vn,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function $n(e){let{t:t,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,m]=n.useState(),[v,p]=n.useState(null),[E,f]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==E?void 0:E.length)||null===E?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:E,documentUid:E,fileName:(null==v?void 0:v.name)||""}]})},[E]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,l=function(){if(v.size>=5242880)r(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const l=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(t("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var l,n,i,o;(null==e||null===(l=e.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?f(null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId):r(t("CS_FILE_UPLOAD_ERROR"))})},function(){r(t("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(l&&l.then)return l.then(function(){})}}();if(l&&l.then)return l.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),i.createElement("div",{style:{}},i.createElement(l.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},i.createElement(l.CardLabel,{style:{width:"100%"}},null!=o&&o.required?t("TL_BUTTON_UPLOAD FILE")+"*":""+t("TL_BUTTON_UPLOAD FILE")),i.createElement("div",{className:"field",style:{width:"100%"}},i.createElement(l.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&p(n.file)})(e),t:t,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const qn=e=>{var t;let{t:o,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const m=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",p=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[_,h]=n.useState([]),[S,T]=n.useState([]),[b,y]=n.useState(!1),[N,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[A,I]=n.useState(null),D=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,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.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==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;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===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[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(n[0].docTypes[0]));let m=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),m.push(e)}),T(m))},[E,_]),n.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===v&&(null==p?void 0:p.length)>0)},[d,c]),i.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},i.createElement(l.StatusTable,null,i.createElement(l.Row,{label:D?""+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,t)=>{if(null!=e&&e.value)return i.createElement(l.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:D?""+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:D?""+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")})})),i.createElement(Vn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>i.createElement($n,{key:t,document:e,t:o,error:A,setError:I,setNocDocuments:C,nocDocuments:N,checkEnablingDocs:b}))))},Xn=e=>{let{permissions:t,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==t?void 0:t.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return i.createElement("div",null,i.createElement(l.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,t)=>i.createElement(l.CheckBox,{key:t,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?{...e,checked:n}:e))})(e,0,t),isLabelFirst:!0,index:t})),null==d?void 0:d.map((e,t)=>i.createElement("div",null,i.createElement(l.TextInput,{key:t,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,t),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),i.createElement(l.LinkButton,{label:i.createElement("div",null,i.createElement("span",null,i.createElement(l.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(t)}))),i.createElement(l.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Qn(e){let{documents:t,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,m]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let l=[];null==t||t.forEach((e,t,n)=>{l=[...l,...e.values?e.values:[]]}),s(null===(e=l)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[t]),n.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==t||null===(e=t[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{m(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{m(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),p=window.location.href.includes("stakeholder");return i.createElement("div",{style:{marginTop:"19px"}},!p&&(null==t?void 0:t.map((e,t)=>{var n;return i.createElement(i.Fragment,{key:t},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:v?{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,i.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n,o;return i.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},i.createElement("div",{style:{display:"flex",justifyContent:"center"}},i.createElement(l.PDFSvg,null)),i.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?i.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):i.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&i.createElement("div",null,i.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),p&&(null==t?void 0:t.map((e,t)=>{var n;return i.createElement(i.Fragment,{key:t},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,i.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return i.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:t},i.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},i.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?i.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,i.createElement(l.PDFSvg,null),i.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")&&i.createElement("div",null,i.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Zn(e){let{taxHeadEstimatesCalculation:t}=e;const{taxHeadEstimates:n}=t,{t:a}=o.useTranslation();return i.createElement("div",{style:{marginTop:"40px"}},i.createElement(l.StatusTable,null,i.createElement(l.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),i.createElement(l.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==n?void 0:n.map((e,t)=>i.createElement(l.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:t===(null==n?void 0:n.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),i.createElement(l.BreakLine,{style:{margin:"16px 0",width:"40%"}}),i.createElement(l.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==t?void 0:t.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Jn(e){let{floors:t}=e;const{t:n}=o.useTranslation();return i.createElement(i.Fragment,null,t.map(e=>{var t;return i.createElement("div",{key:n(null==e?void 0:e.title),style:{marginTop:"19px"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},n(null==e?void 0:e.title)),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,t)=>{var o;return i.createElement(i.Fragment,{key:t},i.createElement(l.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==t?"16px":"revert"}},n(e.title)),i.createElement(l.StatusTable,{style:{position:"relative",padding:"8px"}},i.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>{var o;return i.createElement(l.Row,!0===e.map&&"N/A"!==e.value?{key:n(e.title),label:n(e.title),text:i.createElement("img",{src:n(e.value),alt:""})}:{key:n(e.title),label:n(e.title),text:n(e.value)||"N/A",last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function ei(e){let{owners:t}=e,n={};n=window.location.href.includes("/employee/pt/")?t.slice().reverse():t;const{t:a}=o.useTranslation(),r=(null==t?void 0:t.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),t.sort((e,t)=>{var l,n;return(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.ownerSequence)-(null==t||null===(n=t.additionalDetails)||void 0===n?void 0:n.ownerSequence)}),i.createElement(i.Fragment,null,i.createElement("div",{className:"owner-details"},n.map((e,t)=>{var n;return i.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},i.createElement(l.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)} ${t+1}`:a(null==e?void 0:e.title)),i.createElement(i.Fragment,{key:t},i.createElement(l.StatusTable,{style:d},i.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return!0===e.map&&"N/A"!==e.value?i.createElement(l.Row,{key:a(e.title),label:a(e.title),text:i.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):i.createElement("span",null,i.createElement(l.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const ti=e=>{var t,a,r;let{scrutinyDetails:u,paymentsList:d=[]}=e;const{t:s}=o.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?i.createElement("span",{style:{color:"#00703C"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return i.createElement(n.Fragment,null,!(null!=u&&u.isChecklist)&&i.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},i.createElement(l.StatusTable,null,i.createElement("div",null,null==u||null===(t=u.values)||void 0===t?void 0:t.map((e,t)=>null!=e&&e.isUnit?i.createElement(l.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:""+s(""+e.title),text:null!=e&&e.value?`${c(e)} ${s(null==e?void 0:e.isUnit)}`:s("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?i.createElement(l.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:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):i.createElement(l.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):i.createElement(l.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(a=u.permit)||void 0===a?void 0:a.map((e,t)=>i.createElement(l.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),i.createElement("div",null,null==u||null===(r=u.scruntinyDetails)||void 0===r?void 0:r.map((e,t)=>i.createElement(n.Fragment,null,i.createElement(l.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),i.createElement("a",{href:null==e?void 0:e.value}," ",i.createElement(l.PDFSvg,null)," "),i.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},li=e=>{var t,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:m}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=n.useMemo(()=>p.map(e=>({Header:m(""+e.name),accessor:E(e.id),id:e.id})));function g(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:m("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:m(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.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===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:m("BPA_FLOOR_NAME_"+e.number)})}),l}function _(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+m("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return i.createElement(n.Fragment,null,i.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},i.createElement(l.StatusTable,null,null==s||null===(t=s.values)||void 0===t?void 0:t.map((e,t)=>null!=e&&e.isHeader?i.createElement(l.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},m(null==e?void 0:e.title)):i.createElement(l.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+m(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,t)=>{var n,o,a,r,u;return i.createElement("div",{key:t,style:(null==s||null===(n=s.subOccupancyTableDetails)||void 0===n||null===(o=n[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},m("BPA_BLOCK_SUBHEADER")," ",t+1),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+m("BPA_SUB_OCCUPANCY_LABEL"),text:_(t)})),i.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},i.createElement(l.Table,{className:"customTable table-fixed-first-column table-border-style",t:m,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:f,getCellProps:e=>({style:{}})})))})))},ni=e=>{let{headComment:t,otherComment:l}=e;return i.createElement("div",{className:"checkpoint-comments-wrap"},i.createElement("h4",null,t),i.createElement("p",null,l))},ii=e=>{var t,n,a;let{data:r,OpenImage:u,privacy:d={}}=e;const{t:s}=o.useTranslation();return i.createElement("div",null,r.date&&i.createElement("p",null,r.date),i.createElement("p",null,r.name),r.mobileNumber&&i.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},i.createElement(l.TelePhone,{mobile:r.mobileNumber,privacy:d}),i.createElement("p",null," ")),r.source&&i.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&i.createElement(ni,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?i.createElement("div",null,null==r||null===(t=r.wfComment)||void 0===t?void 0:t.map((e,t)=>i.createElement("div",{className:"TLComments",key:t},i.createElement("h3",null,s("WF_COMMON_COMMENTS")),i.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(n=r.thumbnailsToShow)||void 0===n||null===(a=n.thumbs)||void 0===a?void 0:a.length)>0?i.createElement("div",{className:"TLComments"},i.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),i.createElement(l.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function oi(e){let{units:t}=e;const{t:n}=o.useTranslation();return i.createElement(i.Fragment,null,t.map((e,t)=>{var o;return i.createElement("div",{key:n(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"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${n(null==e?void 0:e.title)} ${t+1}`),i.createElement(i.Fragment,{key:t},i.createElement(l.StatusTable,{style:{position:"relative",marginTop:"19px"}},i.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>{var o;return i.createElement(l.Row,!0===e.map&&"N/A"!==e.value?{key:n(e.title),label:n(e.title),text:i.createElement("img",{src:n(e.value),alt:""})}:{key:n(e.title),label:n(e.title)+":",text:n(e.value)||"N/A",last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function ai(e){let{units:t}=e;const{t:n}=o.useTranslation();return i.createElement(i.Fragment,null,t.map((e,t)=>{var o;return i.createElement("div",{key:n(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"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${n(null==e?void 0:e.title)} ${t+1}`),i.createElement(i.Fragment,{key:t},i.createElement(l.StatusTable,{style:{position:"relative",marginTop:"19px"}},i.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>{var o;return i.createElement(l.Row,!0===e.map&&"N/A"!==e.value?{key:n(e.title),label:n(e.title),text:i.createElement("img",{src:n(e.value),alt:""})}:{key:n(e.title),label:n(e.title)+":",text:n(e.value)||"NA",last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const ri=e=>{var t,n,a,r;let{wsAdditionalDetails:u}=e;const{t:d}=o.useTranslation();let s=(c=location.search)?(/^[?#]/.test(c)?c.slice(1):c).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var c;const m=null==s?void 0:s.mode;var{connectionDetails:v,plumberDetails:p,roadCuttingDetails:E,activationDetails:f}=(null==u?void 0:u.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return i.createElement(i.Fragment,null,i.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==u||null===(t=u.additionalDetails)||void 0===t?void 0:t.connectionDetails)&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_CONNECTION_DETAIL")),i.createElement("div",null,i.createElement("div",{className:"connection-details-new-value-wrapper"},null==v?void 0:v.map((e,t)=>i.createElement("div",{key:t},i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==u||null===(n=u.additionalDetails)||void 0===n?void 0:n.plumberDetails)&&"MODIFY"!=m&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),i.createElement("div",null,i.createElement("div",{className:"plumber-details-new-value-wrapper"},null==p?void 0:p.map((e,t)=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==u||null===(a=u.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=m&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ROAD_CUTTING_DETAILS")),i.createElement("div",null,i.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,t)=>{var n;return i.createElement("div",{key:t,style:(null==E?void 0:E.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=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.activationDetails)&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),i.createElement("div",null,i.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,t)=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},ui=[{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"}],di=[{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"}],si=e=>{var t,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[c,m,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==d||null===(t=d.additionalDetails)||void 0===t||!t.isPaid),[S,T]=n.useState(!1),[b,y]=n.useState(c||{}),[N,C]=n.useState(null),[A,I]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[D,x]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),O=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(O,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,l;const n={...null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==c||null===(l=c.billDetails)||void 0===l?void 0:l.length)>0){var o,a,r,u,s,v,p;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:i.createElement("span",null,"₹",null==c||null===(o=c.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:i.createElement("span",null,"₹",null==c||null===(r=c.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:i.createElement("span",null,"₹",null==c||null===(s=c.billDetails)||void 0===s||null===(v=s[0])||void 0===v?void 0:v.taxAmount)}];x(e),I(null==c||null===(p=c.billDetails)||void 0===p?void 0:p[0])}else m(n),y(n)},[]);let L={};const w=e=>i.createElement("h1",{className:"heading-m"},e.label),P=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),R=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(P,null)),k=function(e,t,l){void 0===t&&(t=!1);let n={...b};if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}y(n)};return i.createElement(n.Fragment,null,i.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},D&&i.createElement(l.StatusTable,null,i.createElement("div",null,null==D?void 0:D.map((e,t)=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),i.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),i.createElement("div",null,i.createElement(l.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:i.createElement("span",null,"₹",(null==A?void 0:A.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),i.createElement(l.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?i.createElement("div",{onClick:e=>{T(!0)}},i.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&i.createElement(l.Modal,{headerBarMain:i.createElement(w,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:i.createElement(R,{onClick:()=>{y(c),T(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{y(c),T(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,l=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var n,i;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,c,v,p,E,g,h;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l={...null==d||null===(c=d.additionalDetails)||void 0===c||null===(v=c.appDetails)||void 0===v?void 0:v.additionalDetails,...b};d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(p=d.additionalDetails)||void 0===p||null===(E=p.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(g=d.additionalDetails)||void 0===g||null===(h=g.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,p,E,g,h;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(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}];f(vn(e.Calculation[0])),I(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),x(S),b.billDetails=null==e?void 0:e.Calculation,m(b),T(!1)}).catch(e=>{var t,l,n,i,o,a;C({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},i.createElement("div",null,i.createElement(l.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},i.createElement(l.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),i.createElement(l.CardLabel,null,s("PT_TX_HEADS")),i.createElement("div",{className:"field"},i.createElement(l.Dropdown,{isMandatory:!0,option:ui,optionKey:"title",select:e=>k("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&i.createElement("div",{className:"field"},i.createElement(l.CardLabel,null,s("PT_REASON")),i.createElement("div",{className:"field"},i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},L={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),i.createElement(l.CardLabel,null,s("PT_HEAD_AMT")),i.createElement("div",{className:"field"},i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},L={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))),i.createElement(l.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},i.createElement(l.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),i.createElement(l.CardLabel,null,s("PT_TX_HEADS")),i.createElement("div",{className:"field"},i.createElement(l.Dropdown,{isMandatory:!0,option:di,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==b||null===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&i.createElement("div",{className:"field"},i.createElement(l.CardLabel,null,s("PT_REASON")),i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},L={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),i.createElement(l.CardLabel,null,s("PT_HEAD_AMT")),i.createElement("div",{className:"field"},i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},L={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),N&&i.createElement(l.Toast,{style:{zIndex:"10000"},warning:null==N?void 0:N.isWarning,error:null==N||!N.isWarning,label:s(null==N?void 0:N.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},ci=e=>{let{style:t}=e;return i.createElement("span",null,i.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"})))},mi=e=>{let{t:t,userType:n=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;n=n||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return i.createElement(i.Fragment,null,i.createElement("div",{style:d?{}:{width:"80%"}},i.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},i.createElement("div",null,i.createElement(l.InfoBannerIcon,null),i.createElement("h2",{style:{color:"#3498DB"}},t(o))),t(a)+" ",i.createElement(ci,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),i.createElement("div",null," "+t(u)))))},vi=e=>{var t,a,r,u,d,s,c;let{wsAdditionalDetails:m}=e;const{t:v}=o.useTranslation(),[p,E]=n.useState(!1),[f,g]=n.useState({}),_=e=>i.createElement("h1",{className:"heading-m"},e.label),h=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(h,null));return i.createElement(n.Fragment,null,i.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=m&&null!==(t=m.additionalDetails)&&void 0!==t&&t.isViewBreakup?i.createElement("div",{onClick:e=>(()=>{var e;let t=m.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),g(t),E(!0)})(),style:{marginTop:"12px"}},i.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&i.createElement(l.Modal,{headerBarMain:i.createElement(_,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:i.createElement(S,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},i.createElement(l.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},i.createElement(l.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==f||null===(a=f.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:i.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),i.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:i.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),i.createElement(l.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==f||null===(u=f.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:i.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),i.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:i.createElement("span",null,"₹",Number(null==f?void 0:f.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==f||null===(s=f.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:i.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),i.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:i.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},pi={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:{}},Ei=e=>{let{className:t="table",headers:l=[],values:n=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return i.createElement(i.Fragment,null,i.createElement("div",{style:pi.root},i.createElement("table",{className:"table-fixed-column-common-pay",style:pi.table},i.createElement("thead",null,i.createElement("tr",null,i.createElement("th",{style:{...pi.cell,...pi.cellLeft,...pi.cellHeader}},r("CS_BILL_PERIOD")),l.map((e,t)=>i.createElement("th",{style:{...pi.cell,...l.length==t+1?pi.cellRight:{},...pi.cellHeader},key:t},r(e))))),i.createElement("tbody",null,Object.values(n).map((e,t)=>i.createElement("tr",{key:t},i.createElement("td",{style:{...pi.cell,...pi.cellLeft},component:"th",scope:"row"},Object.keys(n)[t]),l.map((t,n)=>i.createElement("td",{style:{...pi.cell,textAlign:"left",...l.length==n+1?pi.cellRight:{},whiteSpace:"pre"},key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),i.createElement("tr",null,i.createElement("td",{style:{...pi.cell,...pi.cellLeft}}),l.map((e,t)=>t==l.length-1?i.createElement("td",{style:{...pi.cell,...pi.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==l.length-2?i.createElement("td",{style:{...pi.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):i.createElement("td",{style:pi.cell,key:t,numeric:!0})))))))},fi={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))"}},gi=e=>{var t,l,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(l=s)||void 0===l?void 0:l.reduce((e,t,l)=>0===l?e:e+t.amount,0))||0;let m="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,l,n;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===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?`FY${l.getYear()+1900}-${n.getYear()-100}`:`${l.toLocaleDateString()}-${n.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let p=[];p=Object.keys(v),p.sort((e,t)=>v[e]-v[t]);const[E,f]=n.useState(!1);return 0==c||c<0?i.createElement("span",null):i.createElement(i.Fragment,null,i.createElement("div",{style:fi.headerStyle},u("CS_ARREARS_DETAILS")),E&&i.createElement(Ei,{headers:[...p],values:d,arrears:m}),!E&&i.createElement("div",{style:fi.buttonStyle},i.createElement("button",{type:"button",onClick:()=>{f(!0)}},u("CS_SHOW_CARD"))),E&&i.createElement("div",{style:fi.buttonStyle},i.createElement("button",{type:"button",onClick:()=>{f(!1)}},u("CS_HIDE_CARD"))))},_i=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),hi=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(_i,null)),Si=e=>{let{t:t,closeModal:n}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const o=a.useHistory();return i.createElement(i.Fragment,null,i.createElement(l.Modal,{headerBarMain:i.createElement(e=>i.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:i.createElement(hi,{onClick:n}),actionCancelLabel:t("CS_COMMON_BACK"),actionCancelOnSubmit:n,hideSubmit:!0,formId:"modal-action"},i.createElement(l.Card,{style:{boxShadow:"none"}},i.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},i.createElement(l.SubmitBar,{label:t("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{o.push("renew-application/info")}}),i.createElement(l.SubmitBar,{label:t("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),o.push("renew-application/check/makePayment")}})))))};function Ti(e){var t,r,u,d,s,c,m,v,p,E,f,g,h,S;let{applicationDetails:T,workflowDetails:b,isDataLoading:y,applicationData:N,timelineStatusPrefix:C,showTimeLine:A=!0,statusAttribute:I="status",paymentsList:D,oldValue:x,isInfoLabel:O=!1}=e;const{t:L}=o.useTranslation(),w=(a.useHistory(),a.useLocation()),[P,R]=n.useState(!1),[k,M]=n.useState(null);new URLSearchParams(w.search);let{id:F}=a.useParams();function B(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const[U,W]=n.useState({}),[H,j]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==N?void 0:N.status)||H.loading||H.loaded||H.canLoad||j({loading:!1,loaded:!1,canLoad:!0}),null==H||!H.canLoad||H.loading||H.loaded||(j({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.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==N?void 0:N.tenantId)||tenantId,null==N?void 0:N.propertyId,W,j));const z=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},V=function(e,t,l){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var n;const e={date:z(null==N||null===(n=N.auditDetails)||void 0===n?void 0:n.createdTime),source:(null==N?void 0:N.channel)||""};return i.createElement(ii,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,m,v,p,E,f,g,h,S,b,y,C;const n={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==T?void 0:T.tenantId,businessIds:null==T?void 0:T.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),l}}},A=l[t-1],I={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==N||null===(s=N.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.uuid)&&null!=N&&null!==(E=N.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==N||null===(h=N.processInstance)||void 0===h||null===(S=h.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(C=y[0])||void 0===C?void 0:C.mobileNumber,comment:L(null==e?void 0:e.comment),wfComment:A?A.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return i.createElement(ii,{data:I,OpenImage:B,privacy:n})}{var A,I,D,x,O;const t={date:z(null==N||null===(A=N.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:null==e||null===(I=e.assignes)||void 0===I||null===(D=I[0])||void 0===D?void 0:D.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(x=e.assignes)||void 0===x||null===(O=x[0])||void 0===O?void 0:O.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return i.createElement(ii,{data:t,OpenImage:B})}},G=(e,t)=>e?t?e:L(e):L("NA"),K=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),Y=window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/obps"),q=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||K?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),X=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${G(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?G(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):L("N/A"),[Q,Z]=n.useState(!1);return i.createElement(l.Card,{style:{position:"relative"},className:"employeeCard-override"},O?i.createElement(mi,{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==T||null===(t=T.applicationDetails)||void 0===t?void 0:t.map((e,t)=>{var n,o,r,u,d,s,c,m,v,p,E,f,g,_,h,S,y,N,C,A,I,O,w,P,k,B,W,H,j,z,V,G,Q,Z,J,ee,te,le,ne,ie;return i.createElement(i.Fragment,{key:t},i.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"}:K?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},(null==e||null===(n=e.title)||void 0===n?void 0:n.trim())&&(0!==t||e.asSectionHeader?i.createElement(l.CardSectionHeader,{style:0===t&&K?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},L(e.title),null!=e&&e.Component?i.createElement(e.Component,null):null):i.createElement(l.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},L(e.title))),(null==e?void 0:e.isTable)&&i.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},i.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>i.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},L(e)))),null==e?void 0:e.tableRows.map((t,n)=>i.createElement("tr",{key:n},t.map((t,o)=>Array.isArray(t)&&t.length>1&&!0===e.isMaintenance?i.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:o},i.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},t.map((e,t)=>i.createElement("a",{key:t,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},i.createElement(l.PDFSvg,{style:{width:"25px",height:"25px"}}))))):i.createElement("td",{key:o,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},t&&!0===t.editButton?i.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},i.createElement(a.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+F,state:{data:t.data}}},i.createElement("button",null," ",i.createElement(l.EditIcon,null)," ")),i.createElement("div",{key:n,onClick:()=>(M(t.data),void R(!0)),style:{cursor:"pointer"}},i.createElement(l.ViewsIcon,null))):L(t)))))),i.createElement(l.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||K?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(o=e.values)||void 0===o?void 0:o.map((t,n)=>{var o,r,u;return!0===t.map&&"N/A"!==t.value?i.createElement(l.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:L(t.title),label:L(t.title),text:i.createElement("img",{src:L(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):!0===(null==t?void 0:t.isLink)?i.createElement(l.Row,{key:L(t.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?i.createElement("div",{style:{width:"200%"}},i.createElement(a.Link,{to:null==t?void 0:t.to},i.createElement("span",{className:"link",style:{color:"#a82227"}},L(null==t?void 0:t.title)))):Y||$?""+L(t.title):L(t.title),text:i.createElement("div",null,i.createElement(a.Link,{to:null==t?void 0:t.to},i.createElement("span",{className:"link",style:{color:"#a82227"}},null==t?void 0:t.value))),last:n===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:t.caption,className:"border-none",rowContainerStyle:q(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):i.createElement("div",{key:n},window.location.href.includes("modify")?i.createElement(l.Row,{className:"border-none",key:""+t.title,label:""+L(""+t.title),privacy:null==t?void 0:t.privacy,text:null!=t&&t.oldValue?null==t?void 0:t.oldValue:null!=t&&t.value?null==t?void 0:t.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):i.createElement(l.Row,{key:L(t.title),label:L(t.title),text:X(t),last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:t.caption,className:"border-none",privacy:null==t?void 0:t.privacy,rowContainerStyle:q(),labelStyle:{wordBreak:"break-all",fontWeight:t.isBold?"bold":"normal",fontStyle:t.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:t.isBold?"bold":"normal",fontStyle:t.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===t.title?i.createElement(gi,{bill:null===(r=U.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&i.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&i.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:D}),(null==T||null===(u=T.applicationData)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&i.createElement(Yn,{fiReport:null==T||null===(m=T.applicationData)||void 0===m||null===(v=m.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors)&&i.createElement(Jn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&i.createElement(ei,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&i.createElement(ai,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&i.createElement(oi,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions)&&(null==b||null===(C=b.data)||void 0===C||null===(A=C.nextActions)||void 0===A?void 0:A.length)>0&&i.createElement(Xn,{applicationData:null==T?void 0:T.applicationData,t:L,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)&&i.createElement(Gn,{t:L,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&i.createElement(qn,{t:L,isNoc:!0,NOCdata:e.values,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.noc,noc:null===(P=e.additionalDetails)||void 0===P?void 0:P.data,bpaActionsDetails:b}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.scruntinyDetails)&&i.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&i.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.subOccupancyTableDetails)&&i.createElement(li,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==T?void 0:T.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&i.createElement(Vn,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.documents)&&i.createElement(Qn,{documents:null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documents}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.taxHeadEstimatesCalculation)&&i.createElement(Zn,{taxHeadEstimatesCalculation:null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&i.createElement(ri,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&i.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},i.createElement(a.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(ee=J.redirectUrl)||void 0===ee?void 0:ee.url},i.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(te=e.additionalDetails)||void 0===te||null===(le=te.redirectUrl)||void 0===le?void 0:le.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&i.createElement(si,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(ie=e.additionalDetails)||void 0===ie?void 0:ie.estimationDetails)&&i.createElement(vi,{wsAdditionalDetails:e,workflowDetails:b}))}),A&&(null==b||null===(r=b.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&i.createElement(i.Fragment,null,i.createElement(l.BreakLine,null),((null==b?void 0:b.isLoading)||y)&&i.createElement(l.Loader,null),!(null!=b&&b.isLoading)&&!y&&i.createElement(n.Fragment,null,i.createElement("div",{id:"timeline"},i.createElement(l.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},L("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(d=b.data)&&void 0!==d&&d.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?i.createElement(l.CheckPoint,{isCompleted:!0,label:L(`${C}${null==b||null===(m=b.data)||void 0===m||null===(v=m.timeline[0])||void 0===v?void 0:v.state}`),customChild:V(null==b||null===(p=b.data)||void 0===p?void 0:p.timeline[0],null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)}):i.createElement(l.ConnectingCheckPoints,null,(null==b||null===(f=b.data)||void 0===f?void 0:f.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,t,n)=>{var o;let a="";var r,u,d,s,c,m;return window.location.href.includes("/obps/")&&(a=null!=b&&null!==(r=b.data)&&void 0!==r&&null!==(u=r.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[t-1])&&void 0!==c&&null!==(m=c.state)&&void 0!==m&&m.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===t?"":"_DONE"),i.createElement(i.Fragment,{key:t},i.createElement(l.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:L(`${C}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${a}`),customChild:V(e,t,null==b||null===(o=b.data)||void 0===o?void 0:o.timeline)}))}))),(null==b||null===(h=b.data)||void 0===h||null===(S=h.timeline)||void 0===S?void 0:S.length)>2&&i.createElement(l.LinkButton,{label:L(Q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{Z(e=>!e)}})))),i.createElement("div",null,P&&i.createElement(Si,{t:L,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function bi(e){var t,n,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S;let{t:T,showToast:b,closeToast:y,businessService:N}=e;if(null!=N&&N.includes("NewTL")||null!=N&&N.includes("TL")||null!=N&&N.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===(t=b.error)||void 0===t?void 0:t.message:T("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:T("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:T("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:T("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:T("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:T("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:T("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:T(`ES_${N}_${null==b||null===(c=b.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return i.createElement(i.Fragment,null,b&&i.createElement(l.Toast,{error:"error"===b.key,label:e,onClose:y}))}if(null!=N&&N.includes("BPA")||null!=N&&N.includes("BPA_LOW")||null!=N&&N.includes("BPA_OC")){var A;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=N&&N.includes("BPA_OC")?T(e[1]):T(e[0]),l};let t="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"REVOCATE":t="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":t="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":t="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":t="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":t="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":t="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:t="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:T(`ES_${N}_${null==b||null===(S=b.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return i.createElement(i.Fragment,null,b&&i.createElement(l.Toast,{error:"error"===b.key,label:t,onClose:y}))}{var I,D;const e="error"===(null==b?void 0:b.key)?null==b||null===(I=b.error)||void 0===I?void 0:I.message:`ES_${N}_${null==b||null===(D=b.action)||void 0===D?void 0:D.action}_UPDATE_SUCCESS`;return i.createElement(i.Fragment,null,b&&i.createElement(l.Toast,{error:"error"===b.key,label:T(e),onClose:y}))}}function yi(e){var t,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y;let{workflowDetails:N,displayMenu:C,onActionSelect:A,setDisplayMenu:I,businessService:D,forcedActionPrefix:x,ActionBarStyle:O={},MenuStyle:L={},isAction:w,applicationDetails:P}=e;const{t:R}=o.useTranslation();let k=Digit.UserService.getUser();const M=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):{};k=null==t?void 0:t.value}const F=null===(t=k)||void 0===t||null===(a=t.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let B=!1,U=!1,W=(null==N||null===(u=N.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==F?void 0:F.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==N||null===(c=N.data)||void 0===c||null===(m=c.nextActions)||void 0===m?void 0:m.filter(e=>(null==F?void 0:F.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(M,()=>{I(!1)},C),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==W?void 0:W.length)||null!=W&&null!==(v=W[0])&&void 0!==v&&null!==(p=v.redirectionUrl)&&void 0!==p&&p.pathname.includes("/pt/property-details/")&&1==(null==W?void 0:W.length)?(U=!1,B=!0):(null==W?void 0:W.length)>0&&(U=!0,B=!1);const H=Digit.SessionStorage.get("User"),j=null==H||null===(E=H.info)||void 0===E?void 0:E.uuid,z=null==P||null===(f=P.applicationData)||void 0===f||null===(g=f.auditDetails)||void 0===g?void 0:g.lastModifiedBy;return i.createElement(i.Fragment,null,!(null!=N&&N.isLoading)&&U&&!B&&!w&&i.createElement(l.ActionBar,{style:{...O}},C&&(null!=N&&null!==(_=N.data)&&void 0!==_&&null!==(h=_.actionState)&&void 0!==h&&h.nextActions||null!=N&&null!==(S=N.data)&&void 0!==S&&S.nextActions)?i.createElement(l.Menu,{localeKeyPrefix:x||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:W,optionKey:"action",t:R,onSelect:A,style:L}):null,"ewst"===D?z===j||null==z?i.createElement(l.SubmitBar,{ref:M,label:R("WF_TAKE_ACTION"),onSubmit:()=>I(!C)}):i.createElement(l.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+R("EW_ALERT_ANOTHER_VENDOR")):i.createElement(l.SubmitBar,{ref:M,label:R("WF_TAKE_ACTION"),onSubmit:()=>I(!C)})),!(null!=N&&N.isLoading)&&!U&&B&&!w&&i.createElement(l.ActionBar,{style:{...O}},i.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==W||null===(T=W[0])||void 0===T?void 0:T.action,value:null==W||null===(b=W[0])||void 0===b?void 0:b.action,onClick:e=>{A((null==W?void 0:W[0])||{})}},R(`${x||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase())}_${null==W||null===(y=W[0])||void 0===y?void 0:y.action}`))))}const Ni=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),Ci=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Ni,null));function Ai(e){let{action:t,closeWarningPopup:n}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return i.createElement(i.Fragment,null,i.createElement(l.Modal,{headerBarMain:i.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:i.createElement(Ci,{onClick:()=>{n()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},i.createElement(l.Card,null,i.createElement("div",{style:{marginBottom:"30px"}},i.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==t?void 0:t.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),i.createElement(l.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==t?void 0:t.AmountDueForPay)}),i.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},i.createElement(l.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:n,style:{marginLeft:"10px"}}),i.createElement(l.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==t||null===(e=t.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const Ii=e=>{var t;const u=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=a.useHistory();let{id:m}=a.useParams();const[v,p]=n.useState(!1),[E,f]=n.useState(null),[g,_]=n.useState(!1),[h,S]=n.useState(!1),[T,b]=n.useState(!1),{applicationDetails:y,showToast:N,setShowToast:C,isLoading:A,isDataLoading:I,applicationData:D,mutate:x,nocMutation:O,workflowDetails:L,id:P,businessService:R,closeToast:k,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:B,statusAttribute:U,ActionBarStyle:W,MenuStyle:H,paymentsList:j,showTimeLine:z=!0,oldValue:V,isInfoLabel:G=!1,clearDataDetails:K,isAction:Y=!1}=e;n.useEffect(()=>{N&&L.revalidate()},[N]);const $=r.useQueryClient(),q=()=>{f(null),_(!1)};return A||h?i.createElement(l.Loader,null):i.createElement(i.Fragment,null,A?i.createElement(l.Loader,null):i.createElement(i.Fragment,null,i.createElement(Ti,{applicationDetails:y,id:P,workflowDetails:L,isDataLoading:I,applicationData:D,businessService:R,timelineStatusPrefix:F,statusAttribute:U,paymentsList:j,showTimeLine:z,oldValue:V,isInfoLabel:G}),g?i.createElement(zn,{t:s,action:E,tenantId:u,state:d,id:m,applicationDetails:y,applicationData:null==y?void 0:y.applicationData,closeModal:q,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,d,m,v,p,f,g,_){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)&&0!=(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(m=e.WaterConnection)||void 0===m||null===(v=m.comment)||void 0===v?void 0:v.length)&&0!=(null==e||null===(p=e.SewerageConnection)||void 0===p||null===(f=p.comment)||void 0===f?void 0:f.length)&&0!=(null==e||null===(g=e.BPA)||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length)){function h(t){if(n)return t;x&&(S(!0),x(e,{onError:(e,t)=>{S(!1),C({key:"error",error:e}),setTimeout(k,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u,d,m,v,p,f,g;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),S(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=E,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&c.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0?null!=t&&null!==(r=t.AmendmentUpdate)&&void 0!==r&&null!==(u=r.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(m=d.workflow)&&void 0!==m&&m.action.includes("RE-SUBMIT")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(p=v.workflow)&&void 0!==p&&p.action.includes("APPROVE")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(g=f.workflow)&&void 0!==g&&g.action.includes("REJECT")&&C({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(C({key:"success",action:E}),K&&setTimeout(K,3e3),setTimeout(k,5e3),$.clear(),$.refetchQueries("APPLICATION_SEARCH"))}})),q()}S(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&O){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==O?void 0:O.mutateAsync(e)),i=w(function(){return S(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,c,m,v,p;S(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?s(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(c=e.response)||void 0===c||null===(m=c.data)||void 0===m||null===(v=m.Errors)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.message)||e;q(),C({key:"error",error:{message:E}}),setTimeout(k,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(h):h(i)}alert("Please fill in the comments before submitting")}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==L||null===(t=L.data)||void 0===t?void 0:t.timeline,businessService:R,workflowDetails:L,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,T?i.createElement(Ai,{action:E,workflowDetails:L,businessService:R,isWarningPop:T,closeWarningPopup:()=>{b(!1)}}):null,i.createElement(bi,{t:s,showToast:N,closeToast:k,businessService:R}),i.createElement(yi,{isAction:Y,workflowDetails:L,displayMenu:v,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)C({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(k,5e3);else if(null!=e&&e.isWarningPopUp)b(!0);else if(null!=e&&e.redirectionUrll){var t,l,n,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))c.push(""+(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.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===(l=e.redirectionUrll)||void 0===l?void 0:l.action)){var a,r;c.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var u;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname}`)}}else if(null!=e&&e.redirectionUrl){var d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else _(!0);f(e),p(!1)},setDisplayMenu:p,businessService:R,forcedActionPrefix:B,ActionBarStyle:W,MenuStyle:H,applicationDetails:y})))},Di=()=>i.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("polyline",{points:"20 6 9 17 4 12"})),xi=()=>i.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("circle",{cx:"12",cy:"12",r:"10"}),i.createElement("polyline",{className:"clock-hands2",points:"12 6 12 12 16 14"})),Oi=e=>{var t;let{workflowDetails:n,hideTimeline:a,setHideTimeline:r}=e;const{t:u}=o.useTranslation(),d=null==n||null===(t=n.data)||void 0===t?void 0:t.processInstances;return d&&0!==d.length?i.createElement(l.Card,{className:"workflow-timeline-card2 digit-form-composer",style:{background:"#fafafa",padding:"16px",height:a?"100%":""}},i.createElement("div",{className:"timeline-header-wrapper "+(a?"collapsed":"")},i.createElement(l.CardSubHeader,{style:{marginBottom:"0",fontSize:"16px",fontWeight:"700",color:"#374151"},className:a?"hidden-content":""},u("WORKFLOW_TIMELINE")),i.createElement("button",{onClick:()=>r(!a)},i.createElement("svg",{className:"timeline-arrow "+(a?"collapsed":""),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M11 17l-5-5 5-5M18 17l-5-5 5-5"})))),i.createElement("div",{className:a?"hidden-content":"timeline-container2"},d.map((e,t)=>{var l,n,o,a,r,s,c;const m=(e=>0===e?"current2":"completed2")(t),v=t!==d.length-1&&d.length>1,p=(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.lastModifiedTime)||(null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime);return i.createElement("div",{key:t,className:"timeline-item2 "+m},i.createElement("div",{className:"timeline-marker2"},i.createElement("div",{className:"timeline-circle2"},i.createElement("completed2"===m?Di:xi,null)),v&&i.createElement("div",{className:"timeline-line2"})),i.createElement("div",{className:"timeline-content2"},i.createElement("div",{className:"timeline-header2"},i.createElement("div",{className:"timeline-title2"},u("WF_"+(null==e||null===(o=e.state)||void 0===o?void 0:o.state))),i.createElement("span",{className:"timeline-date2"},(e=>{if(!e)return"N/A";const t=new Date(e);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear().toString().slice(-2)} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`})(p))),i.createElement("div",{className:"timeline-body2"},i.createElement("div",{className:"timeline-status-tag2 status-"+m},u((null==e||null===(a=e.state)||void 0===a?void 0:a.applicationStatus)||(null==e||null===(r=e.state)||void 0===r?void 0:r.state))),(null==e?void 0:e.comment)&&i.createElement("div",{className:"timeline-comment2"},e.comment)),(null==e||null===(s=e.assigner)||void 0===s?void 0:s.name)&&i.createElement("div",{className:"timeline-footer2"},i.createElement("span",null,u("ES_COMMON_ASSIGNED_TO"),": ",i.createElement("strong",null,null==e||null===(c=e.assigner)||void 0===c?void 0:c.name)))))}))):null};var Li=i.memo(()=>{var e,t,l,r;const{t:u}=o.useTranslation(),[d,s]=i.useState("undefined"!=typeof window&&window.innerWidth<768),c=Digit.ULBService.getCurrentTenantId(),{id:m}=a.useParams(),[v,p]=n.useState(null),[E,f]=n.useState({}),[g,_]=n.useState("watertanker"),h=null==m?void 0:m.startsWith("WT"),S=null==m?void 0:m.startsWith("TP"),T=h?"watertanker":S?"treePruning":"mobileToilet",b=Digit.UserService.getUser().info;sessionStorage.setItem(h?"wt":S?"tp":"mt",m);const{isLoading:y,data:N}=h?Digit.Hooks.wt.useWTApplicationDetail(u,c,m):S?Digit.Hooks.wt.useTPApplicationDetail(u,c,m):Digit.Hooks.wt.useMTApplicationDetail(u,c,m),{mutate:C}=h?Digit.Hooks.wt.useWTApplicationAction(c):S?Digit.Hooks.wt.useTPApplicationAction(c):Digit.Hooks.wt.useMTApplicationAction(c);let A=Digit.Hooks.useWorkflowDetails({tenantId:(null==N||null===(e=N.applicationData)||void 0===e?void 0:e.tenantId)||c,id:null==N||null===(t=N.applicationData)||void 0===t||null===(l=t.applicationData)||void 0===l?void 0:l.bookingNo,moduleCode:T,role:h?["WT_CEMP"]:S?["TP_CEMP"]:["MT_CEMP"]});return n.useEffect(()=>{N&&f(Ct.cloneDeep(N))},[N]),n.useEffect(()=>{var e,t,l,n,i;null!=A&&null!==(e=A.data)&&void 0!==e&&e.applicationBusinessService&&!("watertanker"===(null==A||null===(t=A.data)||void 0===t?void 0:t.applicationBusinessService)&&"watertanker"===T||"mobileToilet"===(null==A||null===(l=A.data)||void 0===l?void 0:l.applicationBusinessService)&&"mobileToilet"===T||"treePruning"===(null==A||null===(n=A.data)||void 0===n?void 0:n.applicationBusinessService)&&"treePruning"===T)&&_(null==A||null===(i=A.data)||void 0===i?void 0:i.applicationBusinessService)},[A.data]),i.createElement("div",{className:"employee-form-content-with-action-bar",style:{padding:"CITIZEN"===(null==b?void 0:b.type)?"0 15px":"",height:"100%"}},i.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px",height:"100%"}},i.createElement("div",{className:"workflow-timeline-wrapper "+(d?"hide-workflow":"")},i.createElement(Oi,{hideTimeline:d,setHideTimeline:s,workflowDetails:A})),i.createElement("div",{className:d?"":"hidden-card ",style:{flex:"1",overflowY:"scroll"}},i.createElement(Ii,{applicationDetails:null==E?void 0:E.applicationData,isLoading:y,isDataLoading:y,applicationData:null==E||null===(r=E.applicationData)||void 0===r?void 0:r.applicationData,mutate:C,workflowDetails:A,businessService:T,moduleCode:"request-service",showToast:v,setShowToast:p,closeToast:()=>{p(null)},timelineStatusPrefix:"",forcedActionPrefix:"RS",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"},showTimeLine:!1}))))});const wi=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),Pi=e=>{let{onClick:t}=e;return i.createElement("div",{className:"icon-bg-secondary",onClick:t},i.createElement(wi,null))},Ri=e=>i.createElement("h1",{className:"heading-m"},e.t("SERVICE_TYPE")),ki=e=>e.substr(0,1).toUpperCase()+e.substr(1),Mi=function(e,t,l){try{var n,i,o,a,r,u,d,s,c,m,v,p,E,_;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${h=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),h.toLowerCase().split(" ").map(ki).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("MT_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:l("WT_CITY"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.landmark}].filter(e=>e.value)},{title:l("MT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_NUMBER_OF_MOBILE_TOILETS"),value:null==e?void 0:e.noOfMobileToilet},{title:l("MT_DELIVERY_FROM_DATE"),value:g(null==e?void 0:e.deliveryFromDate)},{title:l("MT_DELIVERY_TO_DATE"),value:g(null==e?void 0:e.deliveryToDate)},{title:l("MT_REQUIREMENT_TIME"),value:`${f(null==e?void 0:e.deliveryFromTime)} - ${f(null==e?void 0:e.deliveryToTime)}`},{title:l("MT_SPECIAL_REQUEST"),value:null==e?void 0:e.description}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var h},Fi=e=>{console.log("GetActionMessage",e);const{t:t}=o.useTranslation();return e.isSuccess?t("MT_SUBMIT_SUCCESSFULL"):e.isLoading?t("MT_APPLICATION_PENDING"):e.isSuccess?void 0:t("MT_APPLICATION_FAILED")},Bi={padding:"4px 0px",justifyContent:"space-between"},Ui=e=>{var t,n;return console.log("BannerPicker",e),i.createElement(l.Banner,{message:Fi(e),applicationNumber:null===(t=e.data)||void 0===t||null===(n=t.mobileToiletBookingDetail)||void 0===n?void 0:n.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Wi=e=>e.substr(0,1).toUpperCase()+e.substr(1),Hi=function(e,t,l){try{var n,i,o,a,r,u,d,s,c,m,v,p,E,f;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${g=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),g.toLowerCase().split(" ").map(Wi).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("TP_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:l("WT_CITY"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:l("TP_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("REASON_FOR_PRUNING"),value:l(null==e?void 0:e.reasonForPruning)},{title:l("LATITUDE_GEOTAG"),value:null==e?void 0:e.latitude},{title:l("LONGITUDE_GEOTAG"),value:null==e?void 0:e.longitude}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var g},ji=e=>{const{t:t}=o.useTranslation();return e.isSuccess?t("TP_SUBMIT_SUCCESSFULL"):e.isLoading?t("TP_APPLICATION_PENDING"):e.isSuccess?void 0:t("TP_APPLICATION_FAILED")},zi={padding:"4px 0px",justifyContent:"space-between"},Vi=e=>{var t,n;return console.log("BannerPicker",e),i.createElement(l.Banner,{message:ji(e),applicationNumber:null===(t=e.data)||void 0===t||null===(n=t.treePruningBookingDetail)||void 0===n?void 0:n.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Gi=e=>{let{stateCode:t,userType:l,tenants:o}=e;const{path:r,url:u}=a.useRouteMatch(),d=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"WT",language:d}),Digit.SessionStorage.set("WT_TENANTS",o),n.useEffect(()=>"employee"===l&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===l?i.createElement(Ce,{path:r,url:u,userType:l}):i.createElement(b,null)},Ki=e=>{let{matchPath:t}=e;const{t:a}=o.useTranslation(),[r,u,d]=Digit.Hooks.useSessionStorage("WT",{});n.useEffect(()=>{d()},[]);const s=[{link:t+"/wt",i18nKey:a("WT_REQUEST_TANKER")},{link:t+"/wt/status",i18nKey:a("WT_VIEW_APPLICATIONS")},{link:t+"/wt/wt-Vendor",i18nKey:a("WT_VENDOR_LOGIN")}];return i.createElement(l.CitizenHomeCard,{header:a("WATER_TANKER_SERVICE"),links:s,Icon:()=>i.createElement(l.PTIcon,{className:"fill-path-primary-main"})})},Yi={ApplicantDetails:l.ApplicantDetails,AddressDetails:l.AddressDetails,WTCreate:()=>{var e,t,l,n,u,d,s,c,p;const E=r.useQueryClient(),f=a.useRouteMatch(),{t:g}=o.useTranslation(),{pathname:_}=a.useLocation(),h=a.useHistory();let S=[];const[T,b,y]=Digit.Hooks.useSessionStorage("WT_Create",{}),N=Digit.UserService.getUser(),C=Digit.ULBService.getCurrentTenantId(),A=null==N||null===(e=N.info)||void 0===e?void 0:e.uuid,{data:I}=Digit.Hooks.useUserSearch(C,{uuid:[A]},{},{enabled:!!A});function D(e,t,l,n,i){if(void 0===i&&(i=!1),"owners"===e){let l=T.owners||[];l[n]=t,b({...T,[e]:[...l]})}else if("units"===e){let e=T.units||[];e=t,b({...T,units:e})}else b({...T,[e]:{...T[e],...t}});((e,t,l,n)=>{let i,o=_.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=_.slice(0,-3),o=o.split("/").pop(),r=!0):(o=_.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=S.find(e=>e.route===o),d=h.push;if(e&&(d=h.replace),l&&(u=n),"request-details"===u){var s,c;const e=null==T||null===(s=T.serviceType)||void 0===s||null===(c=s.serviceType)||void 0===c?void 0:c.code;"MobileToilet"===e?u="toiletRequest-details":"TREE_PRUNING"===e&&(u="treePruningRequest-details")}if(null===u)return d(f.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?`${f.path}/${u}/${t}`:`${f.path}/${u}`,d(i)})(l,n,i,e)}T.serviceType&&0!==Object.keys(T.serviceType).length||!_.includes("employee")||(_.includes("mt")?b({serviceType:{serviceType:{code:"MobileToilet",i18nKey:"Mobile Toilet",value:"Mobile Toilet"}}}):_.includes("tp")?b({serviceType:{serviceType:{code:"TREE_PRUNING",i18nKey:"Tree Pruning",value:"Tree Pruning"}}}):b({serviceType:{serviceType:{code:"WT",i18nKey:"Water Tanker",value:"Water Tanker"}}})),T&&Object.keys(T).length>0&&window.location.href.includes("/service-type")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),E.invalidateQueries("WT_Create"));const x=()=>{y(),E.invalidateQueries("WT_Create")};m.forEach(e=>{S=S.concat(e.body.filter(e=>!e.hideInCitizen))}),S.indexRoute=_.includes("citizen")?"service-type":"info";const O=null===(t=Digit)||void 0===t||null===(l=t.ComponentRegistryService)||void 0===l?void 0:l.getComponent("WTCheckPage"),L=null===(n=Digit)||void 0===n||null===(u=n.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTAcknowledgement"),w=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("MTAcknowledgement"),P=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("TPAcknowledgement");return i.createElement(i.Fragment,null,i.createElement("div",{className:"employee-form-section-wrapper"},!_.includes("/info")&&i.createElement(v,{config:S,showFinalStep:!0}),i.createElement("div",{className:"employee-form-section"},i.createElement(a.Switch,null,S.map((e,t)=>{var l;const{component:n,texts:o,inputs:r,key:u,additionaFields:d}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return i.createElement(a.Route,{path:`${f.path}/${e.route}`,key:t},i.createElement(s,{config:{texts:o,inputs:r,key:u,additionaFields:d},onSelect:D,t:g,formData:T,userDetails:null==I||null===(l=I.user)||void 0===l?void 0:l[0]}))}),i.createElement(a.Route,{path:f.path+"/check"},i.createElement(O,{onSubmit:function(){try{var e,t,l,n,i,o;return"WT"===(null==T||null===(e=T.serviceType)||void 0===e||null===(t=e.serviceType)||void 0===t?void 0:t.code)&&h.push(f.path+"/wt-acknowledgement"),"MobileToilet"===(null==T||null===(l=T.serviceType)||void 0===l||null===(n=l.serviceType)||void 0===n?void 0:n.code)&&h.push(f.path+"/mt-acknowledgement"),"TREE_PRUNING"===(null==T||null===(i=T.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code)&&h.push(f.path+"/tp-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),i.createElement(a.Route,{path:f.path+"/wt-acknowledgement"},i.createElement(L,{data:T,onSuccess:x})),i.createElement(a.Route,{path:f.path+"/mt-acknowledgement"},i.createElement(w,{data:T,onSuccess:x})),i.createElement(a.Route,{path:f.path+"/tp-acknowledgement"},i.createElement(P,{data:T,onSuccess:x})),i.createElement(a.Route,null,i.createElement(a.Redirect,{to:`${f.path}/${S.indexRoute}`}))))))},InfoPage:e=>{var t,o;let{t:a,onSelect:r,formData:u,config:d}=e;const[s,c]=n.useState(""),[m,v]=n.useState(!1),[p,E]=n.useState(!1),f={MobileToilet:"MT_MODULE",WT:"WT_MODULE",TREE_PRUNING:"TREE_PRUNING"}[null==u||null===(t=u.serviceType)||void 0===t||null===(o=t.serviceType)||void 0===o?void 0:o.code],g=()=>{const e={...u.infodetails||{},existingDataSet:s};r(d.key,{...u[d.key],...e})};return i.createElement(i.Fragment,null,i.createElement(l.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px",justifyContent:"flex-start"}},f&&i.createElement(l.CardHeader,null,a(f)),i.createElement("div",null,i.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_HEADER")),i.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_TEXT")),i.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_TEXT"))),i.createElement("span",null,i.createElement(l.SubmitBar,{label:a("COMMON_NEXT"),onSubmit:()=>{p?v(!0):g()}}))),m&&i.createElement(I,{t:a,closeModal:()=>v(!1),actionCancelOnSubmit:()=>v(!1),onSubmit:()=>{g(),v(!1)},setExistingDataSet:c}))},RequestDetails:e=>{var t,o,a,r,u,d,s,c,m;let{t:v,config:E,onSelect:f,formData:g}=e;Digit.UserService.getUser();let _={};const[h,S]=n.useState((null==g||null===(t=g.requestDetails)||void 0===t?void 0:t.tankerType)||""),[T,b]=n.useState((null==g||null===(o=g.requestDetails)||void 0===o?void 0:o.tankerQuantity)||{i18nKey:"1",code:"1",value:"1"}),[y,N]=n.useState((null==g||null===(a=g.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),[C,A]=n.useState((null==g||null===(r=g.requestDetails)||void 0===r?void 0:r.waterType)||""),[I,D]=n.useState((null==g||null===(u=g.requestDetails)||void 0===u?void 0:u.deliveryDate)||""),[x,O]=n.useState((null==g||null===(d=g.requestDetails)||void 0===d?void 0:d.description)||""),[L,P]=n.useState((null==g||null===(s=g.requestDetails)||void 0===s?void 0:s.deliveryTime)||""),[R,k]=n.useState((null==g||null===(c=g.requestDetails)||void 0===c?void 0:c.extraCharge)||!1),[M,F]=n.useState((null==g||null===(m=g.requestDetails)||void 0===m?void 0:m.fileStoreId)||null),[B,U]=n.useState(null),[W,H]=n.useState(null),j=Digit.ULBService.getStateId(),z={width:"100%"},{data:V}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType}}),{data:G}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}),{data:K}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}),{data:Y}=Digit.Hooks.useCustomMDMS(j,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}});let $=[],q=[],X=[],Q=[];Y&&Y.map(e=>{Q.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),K&&K.map(e=>{q.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),V&&V.map(e=>{$.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),G&&G.map(e=>{X.push({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})});const Z=$.map(e=>{if(h.code===e.vehicleType)return{i18nKey:e.capacityName,code:e.code,value:e.capacityName}}).filter(e=>void 0!==e),J=()=>i.createElement("div",{className:"flex items-center"},i.createElement(l.TextInput,{type:"time",value:L,style:z,onChange:e=>P(e.target.value),min:"06:00",max:"23:59"}));return n.useEffect(()=>{!function(){try{H(null);const e=function(){if(B){const e=function(){if(B.size>=2e6)H(v("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("wt",B,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?F(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):H(v("WT_FILE_UPLOAD_ERROR"))})},function(){H(v("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[B]),n.useEffect(()=>{!h&&null!=X&&X.length&&S(X[0])},[X]),i.createElement(i.Fragment,null,i.createElement(l.FormStep,{config:E,onSelect:()=>{let e={...g.requestDetails,tankerType:h,deliveryDate:I,tankerQuantity:T,waterType:C,waterQuantity:y,deliveryTime:L,description:x,extraCharge:R,fileStoreId:M};f(E.key,e,!1)},t:v,isDisabled:!(h&&I&&T&&y&&L&&x&&C),className:"card-form-container"},i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_TANKER_TYPE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.RadioButtons,{t:v,options:X,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"tankerType",value:h,selectedOption:h,onSelect:S,labelKey:"i18nKey",isPTFlow:!0})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_WATER_TYPE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:C,placeholder:v("WT_SELECT_WATER_TYPE"),select:A,option:Q,style:z,optionKey:"i18nKey",t:v})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_WATER_QUANTITY")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:y,placeholder:"Select Water Quantity",select:N,option:Z,style:z,optionKey:"i18nKey",t:v})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_TANKER_QUANTITY")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:T,placeholder:"Select Tanker Quantity",select:b,option:q,style:z,optionKey:"i18nKey",t:v})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_DELIVERY_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:v,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:z,value:I,onChange:function(e){D(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:v("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||v("ERR_DEFAULT_INPUT_FIELD_MSG")}})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_DELIVERY_TIME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(J,null)),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_UPLOAD_DOCUMENT")),i.createElement(l.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){F(null),U(e.target.files[0])},onDelete:()=>{F(null)},message:M?"1 "+v("WT_ACTION_FILEUPLOADED"):v("WT_ACTION_NO_FILEUPLOADED"),error:W})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_DESCRIPTION")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextArea,p({t:v,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:x,onChange:function(e){O(e.target.value)},style:z,ValidationRequired:!0},_={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:v("PT_NAME_ERROR_MESSAGE")}))),W?i.createElement("div",{style:{height:"20px",width:"100%",fontSize:"20px",color:"red",marginTop:"5px"}},W):"",i.createElement(l.CheckBox,{label:v("WT_IMMEDIATE"),onChange:()=>{k(!R)},checked:R})))},WTCheckPage:e=>{var t,a,r,u,d,s,c,m,v,p,_,h;let{onSubmit:S,value:T={}}=e;const{t:b}=o.useTranslation(),{owner:y,requestDetails:N,address:C,serviceType:A,toiletRequestDetails:I,treePruningRequestDetails:D}=T,[x,O]=n.useState(!1),L=null!=N&&N.extraCharge?"YES":"NO",[w,P]=n.useState(null);return i.useEffect(()=>{null!=N&&N.fileStoreId&&Digit.UploadServices.Filefetch([null==N?void 0:N.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n,i;const o=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.url)||void 0===i?void 0:i.split(",")[0];P(o)})},[null==N?void 0:N.fileStoreId]),i.createElement(i.Fragment,null,i.createElement(l.Card,{className:"overflow-y-scroll"},i.createElement(l.CardHeader,null,b("WT_SUMMARY_PAGE")),i.createElement("div",null,i.createElement(l.CardSubHeader,null,b("ES_TITILE_OWNER_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:b("COMMON_APPLICANT_NAME"),text:""+b(E(null==y?void 0:y.applicantName)),actionButton:i.createElement(R,{jumpTo:"/digit-ui/citizen/wt/request-service/applicant-details"})}),i.createElement(l.Row,{label:b("COMMON_MOBILE_NUMBER"),text:""+b(E(null==y?void 0:y.mobileNumber))}),i.createElement(l.Row,{label:b("COMMON_ALT_MOBILE_NUMBER"),text:""+b(E(null==y?void 0:y.alternateNumber))}),i.createElement(l.Row,{label:b("COMMON_EMAIL_ID"),text:""+b(E(null==y?void 0:y.emailId))})),i.createElement(l.CardSubHeader,null,b("ES_TITLE_ADDRESS_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:b("HOUSE_NO"),text:""+b(E(null==C?void 0:C.houseNo)),actionButton:i.createElement(R,{jumpTo:"/digit-ui/citizen/wt/request-service/address-details"})}),i.createElement(l.Row,{label:b("ADDRESS_LINE1"),text:""+b(E(null==C?void 0:C.addressLine1))}),i.createElement(l.Row,{label:b("ADDRESS_LINE2"),text:""+b(E(null==C?void 0:C.addressLine2))}),i.createElement(l.Row,{label:b("CITY"),text:""+b(E(null==C||null===(t=C.city)||void 0===t||null===(a=t.city)||void 0===a?void 0:a.name))}),i.createElement(l.Row,{label:b("LOCALITY"),text:""+b(E(null==C||null===(r=C.locality)||void 0===r?void 0:r.i18nKey))}),i.createElement(l.Row,{label:b("PINCODE"),text:""+b(E(null==C?void 0:C.pincode))}),i.createElement(l.Row,{label:b("LANDMARK"),text:""+b(E(null==C?void 0:C.landmark))}),i.createElement(l.Row,{label:b("STREET_NAME"),text:""+b(E(null==C?void 0:C.streetName))})),"WT"===(null==A||null===(u=A.serviceType)||void 0===u?void 0:u.code)&&i.createElement(n.Fragment,null,i.createElement(l.CardSubHeader,null,b("WT_REQUEST_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:b("WT_TANKER_TYPE"),text:""+b(E(null==N||null===(d=N.tankerType)||void 0===d?void 0:d.value)),actionButton:i.createElement(R,{jumpTo:"/digit-ui/citizen/wt/request-service/request-details"})}),i.createElement(l.Row,{label:b("WT_WATER_TYPE"),text:""+b(E(null==N||null===(s=N.waterType)||void 0===s?void 0:s.code))}),i.createElement(l.Row,{label:b("WT_TANKER_QUANTITY"),text:""+b(E(null==N||null===(c=N.tankerQuantity)||void 0===c?void 0:c.code))}),i.createElement(l.Row,{label:b("WT_WATER_QUANTITY"),text:""+b(E(null==N||null===(m=N.waterQuantity)||void 0===m?void 0:m.value))}),i.createElement(l.Row,{label:b("WT_DELIVERY_DATE"),text:""+b(E(g(null==N?void 0:N.deliveryDate)))}),i.createElement(l.Row,{label:b("WT_DELIVERY_TIME"),text:""+E(f(null==N?void 0:N.deliveryTime))}),i.createElement(l.Row,{label:b("WT_DESCRIPTION"),text:""+b(E(null==N?void 0:N.description))}),(null==N?void 0:N.fileStoreId)&&i.createElement(l.Row,{label:b("WT_UPLOAD_DOCUMENT"),text:i.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>k(null==N?void 0:N.fileStoreId)},i.createElement(l.GenericFileIcon,null))}),i.createElement(l.Row,{label:b("WT_IMMEDIATE"),text:""+b(E(L))}))),"MobileToilet"===(null==A||null===(v=A.serviceType)||void 0===v?void 0:v.code)&&i.createElement(n.Fragment,null,i.createElement(l.CardSubHeader,null,b("ES_REQUEST_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:b("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+b(E(null==I||null===(p=I.mobileToilet)||void 0===p?void 0:p.code)),actionButton:i.createElement(R,{jumpTo:"/digit-ui/citizen/wt/request-service/toiletRequest-details"})}),i.createElement(l.Row,{label:b("MT_DELIVERY_FROM_DATE"),text:""+b(E(g(null==I?void 0:I.deliveryfromDate)))}),i.createElement(l.Row,{label:b("MT_DELIVERY_TO_DATE"),text:""+b(g(E(null==I?void 0:I.deliverytoDate)))}),i.createElement(l.Row,{label:b("MT_REQUIREMNENT_FROM_TIME"),text:E(f(null==I?void 0:I.deliveryfromTime))}),i.createElement(l.Row,{label:b("MT_REQUIREMNENT_TO_TIME"),text:E(f(null==I?void 0:I.deliverytoTime))}),i.createElement(l.Row,{label:b("MT_SPECIAL_REQUEST"),text:""+b(E(null==I?void 0:I.specialRequest))}))),"TREE_PRUNING"===(null==A||null===(_=A.serviceType)||void 0===_?void 0:_.code)&&i.createElement(n.Fragment,null,i.createElement(l.CardSubHeader,null,b("TP_REQUEST_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:b("REASON_FOR_PRUNING"),text:""+b(E(null==D||null===(h=D.reasonOfPruning)||void 0===h?void 0:h.code)),actionButton:i.createElement(R,{jumpTo:"/digit-ui/citizen/wt/request-service/treePruningRequest-details"})}),i.createElement(l.Row,{label:b("LOCATION_GEOTAG"),text:""+b(E(null==D?void 0:D.geoTagLocation))}),i.createElement(l.Row,{label:b("UPLOAD_THE_SITE_PHOTOGRAPH"),text:i.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>k(null==D?void 0:D.supportingDocumentFile)},i.createElement(l.GenericFileIcon,null))}))),i.createElement(l.CheckBox,{label:b("FINAL_DECLARATION_MESSAGE"),onChange:()=>{O(!x)},checked:x})),i.createElement(l.SubmitBar,{label:b("COMMON_BUTTON_SUBMIT"),onSubmit:S,disabled:!x})))},WTAcknowledgement:e=>{let{data:t,onSuccess:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTankerCreateAPI(d),c=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=m||{};return n.useEffect(()=>{try{t.tenantId=d;let e=(e=>{var t,l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,N,C,A,I,D,x,O,L,w,P,R,k,M,F,B;return{waterTankerBookingDetail:{tenantId:null==e?void 0:e.tenantId,tankerType:null==e||null===(t=e.requestDetails)||void 0===t||null===(l=t.tankerType)||void 0===l?void 0:l.code,waterType:null==e||null===(n=e.requestDetails)||void 0===n||null===(i=n.waterType)||void 0===i?void 0:i.code,tankerQuantity:null==e||null===(o=e.requestDetails)||void 0===o||null===(a=o.tankerQuantity)||void 0===a?void 0:a.code,waterQuantity:null==e||null===(r=e.requestDetails)||void 0===r||null===(u=r.waterQuantity)||void 0===u?void 0:u.code,description:null==e||null===(d=e.requestDetails)||void 0===d?void 0:d.description,deliveryDate:null==e||null===(s=e.requestDetails)||void 0===s?void 0:s.deliveryDate,deliveryTime:null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.deliveryTime,extraCharge:null!=e&&null!==(m=e.requestDetails)&&void 0!==m&&m.extraCharge?"Y":"N",addressDetailId:(null==e||null===(v=e.address)||void 0===v?void 0:v.addressDetailId)||"",applicantDetail:{name:null==e||null===(p=e.owner)||void 0===p?void 0:p.applicantName,mobileNumber:null==e||null===(E=e.owner)||void 0===E?void 0:E.mobileNumber,alternateNumber:null==e||null===(f=e.owner)||void 0===f?void 0:f.alternateNumber,emailId:null==e||null===(g=e.owner)||void 0===g?void 0:g.emailId},address:{addressType:null==e||null===(_=e.address)||void 0===_||null===(h=_.addressType)||void 0===h?void 0:h.code,pincode:null==e||null===(S=e.address)||void 0===S?void 0:S.pincode,city:null==e||null===(T=e.address)||void 0===T||null===(b=T.city)||void 0===b||null===(y=b.city)||void 0===y?void 0:y.name,cityCode:null==e||null===(N=e.address)||void 0===N||null===(C=N.city)||void 0===C||null===(A=C.city)||void 0===A?void 0:A.code,addressLine1:null==e||null===(I=e.address)||void 0===I?void 0:I.addressLine1,addressLine2:null==e||null===(D=e.address)||void 0===D?void 0:D.addressLine2,locality:null==e||null===(x=e.address)||void 0===x||null===(O=x.locality)||void 0===O?void 0:O.i18nKey,localityCode:null==e||null===(L=e.address)||void 0===L||null===(w=L.locality)||void 0===w?void 0:w.code,streetName:null==e||null===(P=e.address)||void 0===P?void 0:P.streetName,houseNo:null==e||null===(R=e.address)||void 0===R?void 0:R.houseNo,landmark:null==e||null===(k=e.address)||void 0===k?void 0:k.landmark,latitude:null==e||null===(M=e.address)||void 0===M?void 0:M.latitude,longitude:null==e||null===(F=e.address)||void 0===F?void 0:F.longitude},WTfileStoreId:null==e||null===(B=e.requestDetails)||void 0===B?void 0:B.fileStoreId,bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"watertanker",moduleName:"request-service.water_tanker"}}}})(t);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?i.createElement(l.Loader,null):i.createElement(l.Card,{className:"vehicle-details-card"},i.createElement(W,{t:u,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),i.createElement(l.StatusTable,null,s.isSuccess&&i.createElement(l.Row,{rowContainerStyle:U,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&i.createElement(l.SubmitBar,{label:u("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.waterTankerBookingDetail;const l=v.find(e=>e.code===t.tenantId);return Promise.resolve(F({...t},l,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),i.createElement(a.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},i.createElement(l.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},WTApplicationDetails:()=>{var e,t,r,u,d,s,c,m,v,p,E,_,h;const{t:S}=o.useTranslation(),{acknowledgementIds:T,tenantId:b}=a.useParams(),[y,N]=n.useState(!1),[C,A]=n.useState(null),{data:I}=Digit.Hooks.useStore.getInitData(),{tenants:D}=I||{},{isLoading:x,data:O,refetch:L}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:b,filters:{bookingNo:T}}),w=Nt(O,"waterTankerBookingDetail",[]);Nt(O,"waterTankerBookingDetail[0].bookingNo",[]);let P=w&&w.length>0&&w[0]||{};const R=P;sessionStorage.setItem("wt",JSON.stringify(R));let k="N"===(null==P?void 0:P.extraCharge)?"No":"Yes";const M=Digit.Hooks.wt.useTankerCreateAPI(b,!1),{data:B,isLoading:U}=Digit.Hooks.useRecieptSearch({tenantId:b,businessService:"request-service.water_tanker",consumerCodes:T,isEmployee:!1},{enabled:!!T});let W=[];W.push({label:S("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>H()});const H=function(){try{const e=R||{},t=D.find(t=>t.code===e.tenantId);return Promise.resolve(F({...e},t,S)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return x?i.createElement(l.Loader,null):(B&&(null==B?void 0:B.Payments.length)>0&&0==U&&W.push({label:S("WT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=w[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.water_tanker-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(M.mutateAsync({waterTankerBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],L()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}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]})}}),i.createElement(i.Fragment,null,i.createElement("div",null,i.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},i.createElement(l.Header,{styles:{fontSize:"32px"}},S("WT_BOOKING_DETAILS")),W&&W.length>0&&i.createElement(l.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>N(!y),displayOptions:y,options:W})),i.createElement(l.Card,null,i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_BOOKING_NO"),text:null==P?void 0:P.bookingNo})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},S("WT_APPLICANT_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_APPLICANT_NAME"),text:(null==P||null===(e=P.applicantDetail)||void 0===e?void 0:e.name)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_MOBILE_NUMBER"),text:(null==P||null===(t=P.applicantDetail)||void 0===t?void 0:t.mobileNumber)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_ALT_MOBILE_NUMBER"),text:(null==P||null===(r=P.applicantDetail)||void 0===r?void 0:r.alternateNumber)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_EMAIL_ID"),text:(null==P||null===(u=P.applicantDetail)||void 0===u?void 0:u.emailId)||S("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},S("WT_ADDRESS_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_PINCODE"),text:(null==P||null===(d=P.address)||void 0===d?void 0:d.pincode)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_CITY"),text:(null==P||null===(s=P.address)||void 0===s?void 0:s.city)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_LOCALITY"),text:(null==P||null===(c=P.address)||void 0===c?void 0:c.locality)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_STREET_NAME"),text:(null==P||null===(m=P.address)||void 0===m?void 0:m.streetName)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DOOR_NO"),text:(null==P||null===(v=P.address)||void 0===v?void 0:v.doorNo)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_HOUSE_NO"),text:(null==P||null===(p=P.address)||void 0===p?void 0:p.houseNo)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_ADDRESS_LINE1"),text:(null==P||null===(E=P.address)||void 0===E?void 0:E.addressLine1)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_ADDRESS_LINE2"),text:(null==P||null===(_=P.address)||void 0===_?void 0:_.addressLine2)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_LANDMARK"),text:(null==P||null===(h=P.address)||void 0===h?void 0:h.landmark)||S("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},S("ES_REQUEST_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_TANKER_TYPE"),text:(null==P?void 0:P.tankerType)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_WATER_TYPE"),text:S(null==P?void 0:P.waterType)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_TANKER_QUANTITY"),text:(null==P?void 0:P.tankerQuantity)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_WATER_QUANTITY"),text:(null==P?void 0:P.waterQuantity)+" Ltr"||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DELIVERY_DATE"),text:g(null==P?void 0:P.deliveryDate)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DELIVERY_TIME"),text:f(null==P?void 0:P.deliveryTime)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DESCRIPTION"),text:(null==P?void 0:P.description)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_IMMEDIATE"),text:k||S("CS_NA")})),i.createElement(It,{application:R,id:null==R?void 0:R.bookingNo,userType:"citizen"}),C&&i.createElement(l.Toast,{error:C.key,label:S(C.label),style:{bottom:"0px"},onClose:()=>{A(null)}})))))},MTApplicationDetails:()=>{var e,t,r,u,d,s,c,m,v,p,E,_;const{t:h}=o.useTranslation(),{acknowledgementIds:S,tenantId:T}=a.useParams(),[b,y]=n.useState(!1),[N,C]=n.useState(null),{data:A}=Digit.Hooks.useStore.getInitData(),{tenants:I}=A||{},{isLoading:D,data:x,refetch:O}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:T,filters:{bookingNo:S}}),L=Nt(x,"mobileToiletBookingDetails",[]);Nt(x,"mobileToiletBookingDetails[0].bookingNo",[]);let w=L&&L.length>0&&L[0]||{};const P=w;sessionStorage.setItem("mt",JSON.stringify(P));const R=Digit.Hooks.wt.useMobileToiletCreateAPI(T,!1),{data:k,isLoading:M}=Digit.Hooks.useRecieptSearch({tenantId:T,businessService:"request-service.mobile_toilet",consumerCodes:S,isEmployee:!1},{enabled:!!S});let F=[];if(F.push({label:h("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>B()}),D)return i.createElement(l.Loader,null);k&&(null==k?void 0:k.Payments.length)>0&&0==M&&F.push({label:h("MT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=L[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.mobile_toilet-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(R.mutateAsync({mobileToiletBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],O()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==k||null===(e=k.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==k?void 0:k.Payments[0]})}});const B=function(){try{const e=P||{},t=I.find(t=>t.code===e.tenantId);return Promise.resolve(Mi({...e},t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return i.createElement(i.Fragment,null,i.createElement("div",null,i.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},i.createElement(l.Header,{styles:{fontSize:"32px"}},h("MT_BOOKING_DETAILS")),F.length>0&&i.createElement(l.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>y(!b),displayOptions:b,options:F})),i.createElement(l.Card,null,i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("MT_BOOKING_NO"),text:null==w?void 0:w.bookingNo})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},h("MT_APPLICANT_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("MT_APPLICANT_NAME"),text:(null==w||null===(e=w.applicantDetail)||void 0===e?void 0:e.name)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_MOBILE_NUMBER"),text:(null==w||null===(t=w.applicantDetail)||void 0===t?void 0:t.mobileNumber)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_ALT_MOBILE_NUMBER"),text:(null==w||null===(r=w.applicantDetail)||void 0===r?void 0:r.alternateNumber)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_EMAIL_ID"),text:(null==w||null===(u=w.applicantDetail)||void 0===u?void 0:u.emailId)||h("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},h("ES_TITLE_ADDRESS_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("PINCODE"),text:(null==w||null===(d=w.address)||void 0===d?void 0:d.pincode)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("CITY"),text:(null==w||null===(s=w.address)||void 0===s?void 0:s.city)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("LOCALITY"),text:(null==w||null===(c=w.address)||void 0===c?void 0:c.locality)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("STREET_NAME"),text:(null==w||null===(m=w.address)||void 0===m?void 0:m.streetName)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("HOUSE_NO"),text:(null==w||null===(v=w.address)||void 0===v?void 0:v.houseNo)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("ADDRESS_LINE1"),text:(null==w||null===(p=w.address)||void 0===p?void 0:p.addressLine1)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("ADDRESS_LINE2"),text:(null==w||null===(E=w.address)||void 0===E?void 0:E.addressLine2)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("LANDMARK"),text:(null==w||null===(_=w.address)||void 0===_?void 0:_.landmark)||h("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},h("ES_REQUEST_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("MT_NUMBER_OF_MOBILE_TOILETS"),text:(null==w?void 0:w.noOfMobileToilet)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_DELIVERY_FROM_DATE"),text:g(null==w?void 0:w.deliveryFromDate)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_DELIVERY_TO_DATE"),text:g(null==w?void 0:w.deliveryToDate)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_REQUIREMNENT_FROM_TIME"),text:f(null==w?void 0:w.deliveryFromTime)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_REQUIREMNENT_TO_TIME"),text:f(null==w?void 0:w.deliveryToTime)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_SPECIAL_REQUEST"),text:(null==w?void 0:w.description)||h("CS_NA")})),i.createElement(It,{application:P,id:null==P?void 0:P.bookingNo,userType:"citizen"}),N&&i.createElement(l.Toast,{error:N.key,label:h(N.label),style:{bottom:"0px"},onClose:()=>{C(null)}}))))},TPApplicationDetails:()=>{var e,t,r,u,d,s,c,m,v,p,E,f;const{t:g}=o.useTranslation(),{acknowledgementIds:_,tenantId:h}=a.useParams(),[S,T]=n.useState(!1),[b,y]=n.useState(null),{data:N}=Digit.Hooks.useStore.getInitData(),{tenants:C}=N||{},{isLoading:A,data:I,refetch:D}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:h,filters:{bookingNo:_}}),x=Nt(I,"treePruningBookingDetails",[]);Nt(I,"treePruningBookingDetails[0].bookingNo",[]);let O=x&&x.length>0&&x[0]||{};console.log("tp_details",O);const L=O;sessionStorage.setItem("tp",JSON.stringify(L));const w=Digit.Hooks.wt.useTreePruningCreateAPI(h,!1),{data:P,isLoading:R}=Digit.Hooks.useRecieptSearch({tenantId:h,businessService:"request-service.tree_pruning",consumerCodes:_,isEmployee:!1},{enabled:!!_});let k=[];if(k.push({label:g("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>M()}),A)return i.createElement(l.Loader,null);P&&(null==P?void 0:P.Payments.length)>0&&0==R&&k.push({label:g("TP_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=x[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.tree_pruning-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(w.mutateAsync({treePruningBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],D()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==P||null===(e=P.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==P?void 0:P.Payments[0]})}});const M=function(){try{const e=L||{},t=C.find(t=>t.code===e.tenantId);return Promise.resolve(Hi({...e},t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return i.createElement(i.Fragment,null,i.createElement("div",null,i.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},i.createElement(l.Header,{styles:{fontSize:"32px"}},g("TP_BOOKING_DETAILS")),k.length>0&&i.createElement(l.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>T(!S),displayOptions:S,options:k})),i.createElement(l.Card,null,i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("WT_BOOKING_NO"),text:null==O?void 0:O.bookingNo})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},g("TP_APPLICANT_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("WT_APPLICANT_NAME"),text:(null==O||null===(e=O.applicantDetail)||void 0===e?void 0:e.name)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("WT_MOBILE_NUMBER"),text:(null==O||null===(t=O.applicantDetail)||void 0===t?void 0:t.mobileNumber)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("WT_ALT_MOBILE_NUMBER"),text:(null==O||null===(r=O.applicantDetail)||void 0===r?void 0:r.alternateNumber)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("WT_EMAIL_ID"),text:(null==O||null===(u=O.applicantDetail)||void 0===u?void 0:u.emailId)||g("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},g("ES_TITLE_ADDRESS_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("PINCODE"),text:(null==O||null===(d=O.address)||void 0===d?void 0:d.pincode)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("CITY"),text:(null==O||null===(s=O.address)||void 0===s?void 0:s.city)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LOCALITY"),text:(null==O||null===(c=O.address)||void 0===c?void 0:c.locality)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("STREET_NAME"),text:(null==O||null===(m=O.address)||void 0===m?void 0:m.streetName)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("HOUSE_NO"),text:(null==O||null===(v=O.address)||void 0===v?void 0:v.houseNo)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("ADDRESS_LINE1"),text:(null==O||null===(p=O.address)||void 0===p?void 0:p.addressLine1)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("ADDRESS_LINE2"),text:(null==O||null===(E=O.address)||void 0===E?void 0:E.addressLine2)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LANDMARK"),text:(null==O||null===(f=O.address)||void 0===f?void 0:f.landmark)||g("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},g("TP_REQUEST_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("REASON_FOR_PRUNING"),text:g(null==O?void 0:O.reasonForPruning)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LATITUDE_GEOTAG"),text:(null==O?void 0:O.latitude)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LONGITUDE_GEOTAG"),text:(null==O?void 0:O.longitude)||g("CS_NA")})),i.createElement(It,{application:L,id:null==L?void 0:L.bookingNo,userType:"citizen"}),b&&i.createElement(l.Toast,{error:b.key,label:g(b.label),style:{bottom:"0px"},onClose:()=>{y(null)}}))))},WTMyApplications:()=>{const{t:e}=o.useTranslation(),t=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,[u,d]=n.useState(""),[s,c]=n.useState(null),[m,v]=n.useState(null),[p,E]=n.useState("watertanker"),[f,g]=n.useState("watertanker");let _,h,S=window.location.href.split("/").pop();isNaN(parseInt(S))?_=4:(h=S,_=parseInt(S)+50);let T=isNaN(parseInt(S))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:t,MobileNumber:null==r?void 0:r.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:h,tenantId:t,MobileNumber:null==r?void 0:r.mobileNumber};n.useEffect(()=>{v(T)},[S]);const{isLoading:b,data:y}=Digit.Hooks.wt.useTankerSearchAPI({filters:m},{enabled:!!m&&"watertanker"===p}),{isLoading:N,data:C}=Digit.Hooks.wt.useMobileToiletSearchAPI({filters:m},{enabled:!!m&&"mobileToilet"===p}),{isLoading:A,data:I}=Digit.Hooks.wt.useTreePruningSearchAPI({filters:m},{enabled:!!m&&"treePruning"===p});let D=!1,x=[];if("watertanker"===p?(D=b,x=(null==y?void 0:y.waterTankerBookingDetail)||[]):"mobileToilet"===p?(D=N,x=(null==C?void 0:C.mobileToiletBookingDetails)||[]):"treePruning"===p?(D=A,x=null==I?void 0:I.treePruningBookingDetails):(D=b||N||A,x=[...(null==C?void 0:C.mobileToiletBookingDetails)||[],...(null==y?void 0:y.waterTankerBookingDetail)||[],...(null==I?void 0:I.treePruningBookingDetails)||[]]),D)return i.createElement(l.Loader,null);const O=[{label:e("MOBILE_TOILET"),code:"mobileToilet"},{label:e("WATER_TANKER"),code:"watertanker"},{label:e("TREE_PRUNING"),code:"treePruning"}],L=[{i18nKey:"Booking Created",code:"BOOKING_CREATED",value:e("WT_BOOKING_CREATED")},{i18nKey:"Booking Approved",code:"APPROVED",value:e("WT_BOOKING_APPROVED")},{i18nKey:"Tanker Delivered",code:"TANKER_DELIVERED",value:e("WT_TANKER_DELIVERED")},{i18nKey:"Vendor Assigned",code:"ASSIGN_VENDOR",value:e("WT_ASSIGN_VENDOR")},{i18nKey:"Rejected",code:"REJECT",value:e("WT_BOOKING_REJECTED")}],w=[{i18nKey:"BOOKING_CREATED",code:"BOOKING_CREATED",value:e("TP_BOOKING_CREATED")},{i18nKey:"PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:e("TP_PENDING_FOR_APPROVAL")},{i18nKey:"PAYMENT_PENDING",code:"PAYMENT_PENDING",value:e("TP_PAYMENT_PENDING")},{i18nKey:"TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:e("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:e("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:e("TP_TREE_PRUNING_SERVICE_COMPLETED")}];return i.createElement(i.Fragment,null,i.createElement(l.Header,null,`${e("MY_BOOKINGS")} (${x.length})`),i.createElement(l.Card,null,i.createElement("div",{style:{marginLeft:"16px"}},i.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},i.createElement("div",{style:{flex:1}},i.createElement(l.CardLabel,null,e("SERVICE_TYPE")),i.createElement(l.Dropdown,{selected:O.find(e=>e.code===f),select:e=>{g(e.code),c("")},option:O,placeholder:e("Select Service Type"),optionKey:"label",t:e})),i.createElement("div",{style:{flex:1}},i.createElement(l.CardLabel,null,e("BOOKING_NO")),i.createElement(l.TextInput,{placeholder:e("Enter Booking No."),value:u,onChange:e=>d(e.target.value)})),i.createElement("div",{style:{flex:1}},i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),i.createElement(l.Dropdown,{className:"form-field",selected:s,select:c,option:"treePruning"===f?w:L,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),i.createElement("div",null,i.createElement("div",{style:{marginTop:"17%"}},i.createElement(l.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{E(f);const e=u.trim(),t={...T,bookingNo:e||void 0,status:(null==s?void 0:s.code)||void 0};v(t)}}),i.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{d(""),c("")}},e("ES_COMMON_CLEAR_ALL"))))),i.createElement(a.Link,{to:"request-service/service-type"},i.createElement(l.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("NEW_REQUEST")+" +"})))),i.createElement("div",null,x.length>0&&x.map((l,n)=>i.createElement("div",{key:n},i.createElement(Ae,{application:l,tenantId:t,buttonLabel:e("SUMMARY")}))),0===x.length&&!D&&i.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("NO_APPLICATION_FOUND_MSG")),0!==x.length&&((null==C?void 0:C.count)||0)+((null==y?void 0:y.count)||0)+((null==I?void 0:I.count)||0)>_&&i.createElement("div",null,i.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},i.createElement("span",{className:"link"},i.createElement(a.Link,{to:"/digit-ui/citizen/wt/status/"+_},e("LOAD_MORE_MSG")))))))},ApplicationDetails:Li,WFApplicationTimeline:It,WFCaption:At,WTEmpInbox:Z,WTCitizenCard:()=>{const{t:e}=o.useTranslation(),t=a.useHistory(),[r,u]=n.useState("-"),d=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getCitizenCurrentTenant(!0),{data:s,isFetching:c,isSuccess:m}=Digit.Hooks.useNewInboxGeneral({tenantId:d,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}});n.useEffect(()=>{!c&&m&&u(s)},[c]);const v=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"}],p={Icon:i.createElement(l.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==r?void 0:r.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/citizen/wt/inbox"}],links:v,onDetailsClick:()=>{t.push("/digit-ui/citizen/wt/inbox")}};return i.createElement("div",{className:"wt-citizen-card-premium"},i.createElement(l.EmployeeModuleCard,p))},WTCard:H,ServiceTypes:e=>{var t;let{t:o,config:a,onSelect:r,userType:u,formData:d}=e;const s=Digit.ULBService.getStateId(),{data:c}=Digit.Hooks.useCustomMDMS(s,"request-service",[{name:"ServiceType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ServiceType}}),[m,v]=(Digit.UserService.getUser(),n.useState((null==d||null===(t=d.serviceType)||void 0===t?void 0:t.serviceType)||"")),p=n.useCallback(()=>{let e={...d.serviceType,serviceType:m};r(a.key,e,!1)},[d.serviceType,m,r,a.key]);return n.useEffect(()=>{"citizen"===u&&(console.log("calling meeeeeee"),p())},[m,u,p]),i.createElement(l.Modal,{headerBarMain:i.createElement(Ri,{t:o}),headerBarEnd:i.createElement(Pi,{onClick:()=>window.history.back()}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"50vh",width:"50%",overflowY:"visible"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},i.createElement(i.Fragment,null,i.createElement(l.FormStep,{config:a,onSelect:p,t:o,isDisabled:!m},i.createElement("div",null,i.createElement(l.CardLabel,null,""+o("REQUEST_TYPE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:m,placeholder:"Select Service Type",select:v,option:c,optionKey:"i18nKey",t:o})))))},ToiletRequestDetails:e=>{var t,o,a,r,u,d;let{t:s,config:c,onSelect:m,userType:v,formData:p}=e;const E=Digit.UserService.getUser().info,[f,g]=n.useState((null==p||null===(t=p.toiletRequestDetails)||void 0===t?void 0:t.mobileToilet)||""),[_,h]=n.useState((null==p||null===(o=p.toiletRequestDetails)||void 0===o?void 0:o.deliveryfromTime)||""),[S,T]=n.useState((null==p||null===(a=p.toiletRequestDetails)||void 0===a?void 0:a.deliverytoTime)||""),[b,y]=n.useState((null==p||null===(r=p.toiletRequestDetails)||void 0===r?void 0:r.deliveryfromDate)||""),[N,C]=n.useState((null==p||null===(u=p.toiletRequestDetails)||void 0===u?void 0:u.deliverytoDate)||""),[A,I]=n.useState((null==p||null===(d=p.toiletRequestDetails)||void 0===d?void 0:d.specialRequest)||""),D=Digit.ULBService.getStateId(),x={width:"EMPLOYEE"===E.type?"52%":"100%"},{data:O}=Digit.Hooks.useCustomMDMS(D,"request-service",[{name:"NoOfMobileToilet"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.NoOfMobileToilet}});let L=[];O&&O.map(e=>{L.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const w=()=>i.createElement("div",{className:"flex items-center"},i.createElement(l.TextInput,{type:"time",value:_,style:x,onChange:e=>h(e.target.value),min:"06:00",max:"23:59"})),P=()=>i.createElement("div",{className:"flex items-center"},i.createElement(l.TextInput,{type:"time",value:S,style:x,onChange:e=>T(e.target.value),min:"06:00",max:"23:59"})),R=()=>{let e={...p.toiletRequestDetails,mobileToilet:f,deliveryfromTime:_,deliverytoTime:S,deliveryfromDate:b,deliverytoDate:N,specialRequest:A};m(c.key,e,!1)};return n.useEffect(()=>{"citizen"===v&&R()},[f,_,S,b,N,A]),i.createElement(i.Fragment,null,i.createElement(l.FormStep,{config:c,onSelect:R,t:s,isDisabled:!(f&&_&&S&&b&&N&&A)},i.createElement("div",null,i.createElement(l.CardLabel,null,s("MT_NUMBER_OF_MOBILE_TOILETS")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:f,placeholder:"Select Number of Mobile Toilets",select:g,option:L,style:x,optionKey:"i18nKey",t:s}),i.createElement(l.CardLabel,null,""+s("MT_DELIVERY_FROM_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:x,value:b,onChange:function(e){y(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),i.createElement(l.CardLabel,null,""+s("MT_DELIVERY_TO_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",value:N,style:x,onChange:function(e){C(e.target.value)},min:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),i.createElement(l.CardLabel,null,""+s("MT_REQUIREMNENT_FROM_TIME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(w,null),i.createElement(l.CardLabel,null,""+s("MT_REQUIREMNENT_TO_TIME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(P,null),i.createElement(l.CardLabel,null,""+s("MT_SPECIAL_REQUEST")," ",i.createElement("span",{className:"check-page-link-button"})),i.createElement(l.TextArea,{t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"mobileToilet",style:x,placeholder:"Special Request",value:A,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===E.type?"51.6%":null}}))))},TreePruningRequestDetails:e=>{var t,o,a;let{t:r,config:u,onSelect:d,userType:s,formData:c}=e;const m=Digit.UserService.getUser().info,[v,p]=n.useState((null==c||null===(t=c.treePruningRequestDetails)||void 0===t?void 0:t.reasonOfPruning)||""),[E,f]=n.useState(""),[g,_]=n.useState(""),[h,S]=n.useState((null==c||null===(o=c.treePruningRequestDetails)||void 0===o?void 0:o.geoTagLocation)||""),[T,b]=n.useState((null==c||null===(a=c.treePruningRequestDetails)||void 0===a?void 0:a.supportingDocumentFile)||""),[y,N]=n.useState(!1),[C,A]=n.useState(""),I=Digit.ULBService.getStateId(),D={width:"EMPLOYEE"===m.type?"50%":"100%"},{data:x}=Digit.Hooks.useCustomMDMS(I,"request-service",[{name:"ReasonPruningType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ReasonPruningType}}),O=()=>{let e={...c.treePruningRequestDetails,reasonOfPruning:v,geoTagLocation:h,supportingDocumentFile:T,latitude:E,longitude:g};d(u.key,e,!1)};n.useEffect(()=>{"citizen"===s&&O()},[v,h,T,y]);const L=()=>i.createElement("div",{className:"loading-spinner"});return i.createElement(l.FormStep,{config:u,onSelect:O,t:r,isDisabled:!v||!T},i.createElement("div",null,i.createElement(l.CardLabel,null,r("REASON_FOR_PRUNING")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:v,placeholder:"Select Reason",select:p,option:x,style:D,optionKey:"code",t:r}),i.createElement(l.CardLabel,null,r("LOCATION_GEOTAG")),i.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:"8px",width:"EMPLOYEE"===m.type?"53%":"100%"}},i.createElement(l.TextInput,{t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"geoTagLocation",value:h,placeholder:"Select Location",onChange:e=>{const{name:t,value:l}=e.target?e.target:{name:e.name,value:e};"reasonOfPruning"===t?p(l):"geoTagLocation"===t||"location"===t?S(l):"supportingDocumentFile"===t&&b(l)},max:(new Date).toISOString().split("T")[0],style:{flex:1},rules:{required:r("dddddddd"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||r("hhhhhhh")},className:"location-input"}),i.createElement("div",{className:"butt-icon",onClick:()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{const{latitude:t,longitude:l}=e.coords;S(`${t}, ${l}`),f(t),_(l)},e=>{console.error("Error getting location:",e),alert("Unable to retrieve your location. Please check your browser settings.")}):alert("Geolocation is not supported by your browser.")},style:{cursor:"pointer",width:"25px",marginBottom:"8px"}},i.createElement(l.LocationIcon,{className:"fill-path-primary-main"}))),i.createElement(l.CardLabel,null,r("UPLOAD_THE_SITE_PHOTOGRAPH")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement("div",{style:{marginBottom:"16px",...D}},i.createElement(l.UploadFile,{id:"supportingDocument",onUpload:e=>((e,t)=>{const l=e.target.files[0];l.size>=5242880?(setError("supportingDocument",{message:r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")}),t(null)):(N(!0),Digit.UploadServices.Filestorage("TP",l,Digit.ULBService.getStateId()).then(e=>{var l,n;(null==e||null===(l=e.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?t(e.data.files[0].fileStoreId):setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})}).catch(()=>setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})).finally(()=>N(!1)))})(e,b),onDelete:()=>{b(null)},message:y?i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement(L,null),i.createElement("span",null,"Uploading...")):T?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},accept:"image/*, .pdf, .png, .jpeg, .jpg",buttonType:"button",error:C||!T}))))},MTAcknowledgement:e=>{let{data:t,onSuccess:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useMobileToiletCreateAPI(d),c=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=m||{};return n.useEffect(()=>{try{t.tenantId=d;let e=(e=>{var t,l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,N,C,A,I,D,x,O;return{mobileToiletBookingDetail:{tenantId:null==e?void 0:e.tenantId,description:null==e||null===(t=e.toiletRequestDetails)||void 0===t?void 0:t.specialRequest,noOfMobileToilet:null==e||null===(l=e.toiletRequestDetails)||void 0===l||null===(n=l.mobileToilet)||void 0===n?void 0:n.code,deliveryFromDate:null==e||null===(i=e.toiletRequestDetails)||void 0===i?void 0:i.deliveryfromDate,deliveryToDate:null==e||null===(o=e.toiletRequestDetails)||void 0===o?void 0:o.deliverytoDate,deliveryFromTime:null==e||null===(a=e.toiletRequestDetails)||void 0===a?void 0:a.deliveryfromTime,deliveryToTime:null==e||null===(r=e.toiletRequestDetails)||void 0===r?void 0:r.deliverytoTime,addressDetailId:(null==e||null===(u=e.address)||void 0===u?void 0:u.addressDetailId)||"",applicantDetail:{name:null==e||null===(d=e.owner)||void 0===d?void 0:d.applicantName,mobileNumber:null==e||null===(s=e.owner)||void 0===s?void 0:s.mobileNumber,alternateNumber:null==e||null===(c=e.owner)||void 0===c?void 0:c.alternateNumber,emailId:null==e||null===(m=e.owner)||void 0===m?void 0:m.emailId},address:{addressType:null==e||null===(v=e.address)||void 0===v||null===(p=v.addressType)||void 0===p?void 0:p.code,pincode:null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,city:null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name,cityCode:null==e||null===(h=e.address)||void 0===h||null===(S=h.city)||void 0===S||null===(T=S.city)||void 0===T?void 0:T.code,addressLine1:null==e||null===(b=e.address)||void 0===b?void 0:b.addressLine1,addressLine2:null==e||null===(y=e.address)||void 0===y?void 0:y.addressLine2,locality:null==e||null===(N=e.address)||void 0===N||null===(C=N.locality)||void 0===C?void 0:C.i18nKey,localityCode:null==e||null===(A=e.address)||void 0===A||null===(I=A.locality)||void 0===I?void 0:I.code,streetName:null==e||null===(D=e.address)||void 0===D?void 0:D.streetName,houseNo:null==e||null===(x=e.address)||void 0===x?void 0:x.houseNo,landmark:null==e||null===(O=e.address)||void 0===O?void 0:O.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"mobileToilet",moduleName:"request-service.mobile_toilet"}}}})(t);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?i.createElement(l.Loader,null):i.createElement(l.Card,null,i.createElement(Ui,{t:u,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),i.createElement(l.StatusTable,null,s.isSuccess&&i.createElement(l.Row,{rowContainerStyle:Bi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&i.createElement(l.SubmitBar,{label:u("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const l=v.find(e=>e.code===t.tenantId);return Promise.resolve(Mi({...t},l,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),i.createElement(a.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},i.createElement(l.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},TPAcknowledgement:e=>{let{data:t,onSuccess:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTreePruningCreateAPI(d),c=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=m||{};return n.useEffect(()=>{try{t.tenantId=d;let e=(e=>{var t,l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,N,C,A,I;return{treePruningBookingDetail:{tenantId:null==e?void 0:e.tenantId,latitude:null==e||null===(t=e.treePruningRequestDetails)||void 0===t?void 0:t.latitude,longitude:null==e||null===(l=e.treePruningRequestDetails)||void 0===l?void 0:l.longitude,reasonForPruning:null==e||null===(n=e.treePruningRequestDetails)||void 0===n||null===(i=n.reasonOfPruning)||void 0===i?void 0:i.code,applicantDetail:{name:null==e||null===(o=e.owner)||void 0===o?void 0:o.applicantName,mobileNumber:null==e||null===(a=e.owner)||void 0===a?void 0:a.mobileNumber,alternateNumber:null==e||null===(r=e.owner)||void 0===r?void 0:r.alternateNumber,emailId:null==e||null===(u=e.owner)||void 0===u?void 0:u.emailId},documentDetails:[{documentType:"Site Photograph",fileStoreId:null==e||null===(d=e.treePruningRequestDetails)||void 0===d?void 0:d.supportingDocumentFile}],address:{addressType:null==e||null===(s=e.address)||void 0===s||null===(c=s.addressType)||void 0===c?void 0:c.code,pincode:null==e||null===(m=e.address)||void 0===m?void 0:m.pincode,city:null==e||null===(v=e.address)||void 0===v||null===(p=v.city)||void 0===p||null===(E=p.city)||void 0===E?void 0:E.name,cityCode:null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.code,addressLine1:null==e||null===(h=e.address)||void 0===h?void 0:h.addressLine1,addressLine2:null==e||null===(S=e.address)||void 0===S?void 0:S.addressLine2,locality:null==e||null===(T=e.address)||void 0===T||null===(b=T.locality)||void 0===b?void 0:b.i18nKey,localityCode:null==e||null===(y=e.address)||void 0===y||null===(N=y.locality)||void 0===N?void 0:N.code,streetName:null==e||null===(C=e.address)||void 0===C?void 0:C.streetName,houseNo:null==e||null===(A=e.address)||void 0===A?void 0:A.houseNo,landmark:null==e||null===(I=e.address)||void 0===I?void 0:I.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"treePruning",moduleName:"request-service.tree_pruning"}}}})(t);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?i.createElement(l.Loader,null):i.createElement(l.Card,null,i.createElement(Vi,{t:u,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),i.createElement(l.StatusTable,null,s.isSuccess&&i.createElement(l.Row,{rowContainerStyle:zi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&i.createElement(l.SubmitBar,{label:u("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.treePruningBookingDetail;const l=v.find(e=>e.code===t.tenantId);return Promise.resolve(Hi({...t},l,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),i.createElement(a.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},i.createElement(l.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},MTCitizenCard:()=>{const{t:e}=o.useTranslation(),[t,a]=n.useState("-"),r=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:u,isFetching:d,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:r,ModuleCode:"WT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}});n.useEffect(()=>{!d&&s&&a(u)},[d]);const c=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/mt/my-bookings"}],m={Icon:i.createElement(l.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==t?void 0:t.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"}],links:c};return i.createElement(l.EmployeeModuleCard,m)},FixedPointScheduleManagement:ee,LiveTrackingSystem:Ee,AddFillingPointAddress:he,AddFixPointAddress:Se,AddFillingPointMetaData:fe,WTSearchPointAddress:be,VendorAssign:Ne};exports.WTComponents={WTCard:H,WTModule:Gi,MTCard:()=>{const{t:e}=o.useTranslation(),[t,a]=n.useState("-"),{data:r,isLoading:u,isFetching:d,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"MT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}});if(n.useEffect(()=>{!d&&s&&a(r)},[d]),!Digit.Utils.mtAccess())return null;const c=[{count:u?"-":null==t?void 0:t.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/mt/my-bookings"},{label:e("MT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/mt/request-service"}],m=Digit.UserService.hasAccess(["MT_CEMP"])||!1,v={Icon:i.createElement(l.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==t?void 0:t.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/mt/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||m)};return i.createElement(l.EmployeeModuleCard,v)},TPCard:()=>{const{t:e}=o.useTranslation(),[t,a]=n.useState("-"),{data:r,isLoading:u,isFetching:d,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"TP",filters:{limit:10,offset:0,services:["treePruning"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.tpAccess()}});n.useEffect(()=>{!d&&s&&a(r)},[d]);const c=[{count:u?"-":null==t?void 0:t.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/tp/my-bookings"},{label:e("TP_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/tp/request-service"}],m=Digit.UserService.hasAccess(["TP_CEMP"])||!1,v={Icon:i.createElement(l.CHBIcon,null),moduleName:e("ACTION_TEST_TP"),kpis:[{count:null==t?void 0:t.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||m)};return i.createElement(l.EmployeeModuleCard,v)},WTLinks:Ki,WT_INBOX_FILTER:e=>i.createElement(Ot,e),WTInboxTableConfig:e=>({WT:{inboxColumns:t=>[{Header:e("WT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,n,o,r;let{row:u}=e;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:`${t.detailRoute||t.parentRoute+"/booking-details"}/${null==u||null===(l=u.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.bookingNo}`},null===(o=u.original)||void 0===o||null===(r=o.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return xt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("WT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("WT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n;let{row:i}=t;return Dt(e(""+(null===(l=i.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode)))},mobileCell:t=>{var l;return xt(e(""+(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode)))}},{Header:e("WT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return Dt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return xt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},MT:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,n,o,r;let{row:u}=e;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(l=u.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.bookingNo)},null===(o=u.original)||void 0===o||null===(r=o.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return xt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n;let{row:i}=t;return Dt(e(""+(null===(l=i.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode)))},mobileCell:t=>{var l;return xt(e(""+(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode)))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return Dt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return xt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},TP:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,n,o,r;let{row:u}=e;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(l=u.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.bookingNo)},null===(o=u.original)||void 0===o||null===(r=o.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return xt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n;let{row:i}=t;return Dt(e(""+(null===(l=i.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode)))},mobileCell:t=>{var l;return xt(e(""+(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode)))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return Dt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return xt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}}})},exports.WTLinks=Ki,exports.WTModule=Gi,exports.initWTComponents=()=>{Object.entries(Yi).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var l=require("@djb25/digit-ui-react-components"),n=require("react"),i=e(n),o=require("react-i18next"),a=require("react-router-dom"),r=require("react-query"),u=require("react-hook-form"),d=require("socket.io-client"),s=require("react-leaflet"),c=e(require("leaflet"));require("leaflet/dist/leaflet.css");const m=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"service-type",component:"ServiceTypes",withoutLabel:!0,key:"serviceType",type:"component",nextStep:"info",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT"}},{route:"info",component:"InfoPage",nextStep:"applicant-details",key:"infodetails"},{route:"applicant-details",component:"ApplicantDetails",withoutLabel:!0,key:"owner",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_APPLICANT_DETAILS"},timeLine:[{currentStep:1,actions:"ES_APPLICANT_DETAILS"}]}]},{head:"ES_TITLE_ADDRESS_DETAILS",body:[{route:"address-details",component:"AddressDetails",withoutLabel:!0,key:"address",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"request-details",texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"ES_ADDRESS_DETAILS"},timeLine:[{currentStep:2,actions:"ES_ADDRESS_DETAILS"}]}]},{head:"ES_REQUEST_DETAILS",body:[{route:"request-details",component:"RequestDetails",withoutLabel:!0,key:"requestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"WT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_REQUEST_DETAILS"}]}]},{head:"ES_TOILET_REQUEST_DETAILS",body:[{route:"toiletRequest-details",component:"ToiletRequestDetails",withoutLabel:!0,key:"toiletRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"MT_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TOILET_REQUEST_DETAILS"}]}]},{head:"ES_TREE_PRUNING_REQUEST_DETAILS",body:[{route:"treePruningRequest-details",component:"TreePruningRequestDetails",withoutLabel:!0,key:"treePruningRequestDetails",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:null,texts:{submitBarLabel:"COMMON_SAVE_NEXT",header:"TP_REQUEST_DETAILS"},timeLine:[{currentStep:3,actions:"ES_TREE_PRUNING_REQUEST_DETAILS"}]}]}],v=e=>{let{config:t,showFinalStep:n,...r}=e;const{t:u}=o.useTranslation(),d=a.useLocation().pathname.split("/").pop();if("info"===d)return null;const s=t.filter(e=>e.timeLine&&e.timeLine.length>0).reduce((e,t)=>{const l=t.timeLine[0],n=e.findIndex(e=>e.key===l.currentStep);return-1===n?e.push({key:l.currentStep,label:l.actions,routes:[t.route],stepNumber:l.currentStep}):e[n].routes.push(t.route),e},[]).sort((e,t)=>e.stepNumber-t.stepNumber);n&&s.push({key:"final-submit",label:"Review & Submit",routes:["check","wt-acknowledgement","mt-acknowledgement","tp-acknowledgement"],stepNumber:s.length+1});const c=s.findIndex(e=>e.routes.includes(d)),m=-1!==c?c:0;return i.createElement(i.Fragment,null,i.createElement("div",{className:"vertical-timeline-container"},i.createElement("div",{className:"vertical-timeline-wrapper"},s.map((e,t)=>{const n=t<m;return i.createElement("div",{key:t,className:`vertical-timeline-step ${n?"completed":""} ${t===m?"activeTimeline active":""}`,onClick:()=>{}},i.createElement("div",{className:"vertical-timeline-connector "+(t<m?"completed":"")}),i.createElement("div",{className:"vertical-timeline-pill"},n?i.createElement(l.TickMark,null):e.stepNumber),i.createElement("div",{className:"vertical-timeline-content"},i.createElement("div",{className:"vertical-timeline-label"},u(e.label))))}))))};function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}const E=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"NA"},f=e=>{if(!e)return"NA";const[t,l]=e.split(":").map(Number),n=t>=12?"PM":"AM";return`${t%12||12}:${l.toString().padStart(2,"0")} ${n}`},g=e=>{if(!e)return"NA";const[t,l,n]=e.split("-");return`${n}-${l}-${t}`},h=e=>{let{number:t,title:o,children:a,defaultOpen:r=!1,tabs:u=null,defaultTab:d="",onTabChange:s=(()=>{})}=e;const[c,m]=n.useState(r),[v,p]=n.useState(d||u&&u[0]||"");return i.createElement("div",{className:"collapsible-card"},i.createElement("div",{className:"collapsible-card-header",onClick:()=>m(!c)},i.createElement("h3",{className:"collapsible-card-title"},t?t+". ":"",o),i.createElement("span",{className:"collapsible-card-arrow "+(c?"rotate":"")},i.createElement(l.ArrowDown,null))),c&&i.createElement("div",{className:"collapsible-card-body"},u&&i.createElement("div",{className:"collapsible-card-tabs"},u.map((e,t)=>i.createElement("button",{key:t,onClick:()=>(e=>{p(e),s(e)})(e),className:"collapsible-card-tab-button "+(v===e?"active":"")},e))),i.createElement("div",{className:"collapsible-card-tab-content"},u?i.createElement("div",{key:v},a(v)):i.createElement("div",null,a))))},S=e=>{let{isLoading:t,t:o,onSubmit:r,data:d,count:s,setShowToast:c,moduleCode:m}=e;const v=window.Digit.Utils.browser.isMobile(),p=Digit.UserService.getUser().info,E={offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",bookingNo:"",mobileNumber:"",applicantName:"",status:"",fromDate:"",toDate:""},{register:f,control:g,handleSubmit:_,setValue:S,getValues:T,reset:b,formState:y,watch:N}=u.useForm({defaultValues:E}),C=N("fromDate"),A=e=>i.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:o("WT_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;const l=t.original.bookingNo;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:`/digit-ui/${"EMPLOYEE"===p.type?"employee":"citizen"}/wt/bookingsearch/booking-details/${l}`},l)))}},{Header:o("WT_APPLICANT_NAME"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return A(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:o("WT_MOBILE_NUMBER"),disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;return A(null===(t=n.original)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:o("PT_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return A(o(t.original.bookingStatus))}}],[o,p.type]),D="TP"===m?[{i18nKey:"TP_BOOKING_CREATED",code:"BOOKING_CREATED",value:o("TP_BOOKING_CREATED")},{i18nKey:"TP_PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:o("TP_PENDING_FOR_APPROVAL")},{i18nKey:"TP_PAYMENT_PENDING",code:"PAYMENT_PENDING",value:o("TP_PAYMENT_PENDING")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:o("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TP_TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:o("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TP_TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:o("TP_TREE_PRUNING_SERVICE_COMPLETED")}]:[{i18nKey:"WT_BOOKING_CREATED",code:"BOOKING_CREATED",value:o("WT_BOOKING_CREATED")},{i18nKey:"WT_VENDOR_ASSIGNED",code:"VENDOR_ASSIGNED",value:o("WT_VENDOR_ASSIGNED")},{i18nKey:"WT_DELIVERY_PENDING",code:"DELIVERY_PENDING",value:o("WT_DELIVERY_PENDING")},{i18nKey:"WT_DELIVERED",code:"DELIVERED",value:o("WT_DELIVERED")},{i18nKey:"WT_REQUEST_REJECTED",code:"REQUEST_REJECTED",value:o("WT_REQUEST_REJECTED")}],x=n.useCallback(e=>{0!==e.length&&(S("sortBy",e.id),S("sortOrder",e.desc?"DESC":"ASC"))},[S]),O=()=>{b(E),c(null),_(r)()};return i.createElement(i.Fragment,null,i.createElement("div",{className:"CITIZEN"===(null==p?void 0:p.type)?"citizen-wrapper":"employee-wrapper"},i.createElement(h,{title:o("WT_SEARCH_FILTERS_LABEL")||"Search Filters",defaultOpen:!0,tabs:[o("WT_SMART_SEARCH"),o("WT_ADVANCED_SEARCH")],defaultTab:o("WT_SMART_SEARCH")},e=>{var t,n,a,d;return i.createElement("form",{onSubmit:_(r)},e===o("WT_SMART_SEARCH")&&i.createElement("div",{className:"wt-search-grid",style:{display:"grid",gridTemplateColumns:v?"1fr":"1fr 1fr",gap:"24px"}},i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_MOBILE_NUMBER")),i.createElement(l.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:o("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),i.createElement(l.CardLabelError,null,null==y||null===(t=y.errors)||void 0===t||null===(n=t.mobileNumber)||void 0===n?void 0:n.message))),e===o("WT_ADVANCED_SEARCH")&&i.createElement("div",{className:"formcomposer-section-grid"},i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_BOOKING_NO")),i.createElement(l.TextInput,{name:"bookingNo",inputRef:f({})})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_APPLICANT_NAME")),i.createElement(l.TextInput,{name:"applicantName",inputRef:f({})})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("WT_MOBILE_NUMBER")),i.createElement(l.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:o("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:o("CORE_COMMON_MOBILE_ERROR")}}),type:"number",maxlength:10}),i.createElement(l.CardLabelError,null,null==y||null===(a=y.errors)||void 0===a||null===(d=a.mobileNumber)||void 0===d?void 0:d.message)),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("PT_COMMON_TABLE_COL_STATUS_LABEL")),i.createElement(u.Controller,{control:g,name:"status",render:e=>i.createElement(l.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:D,optionKey:"i18nKey",t:o})})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("FROM_DATE")),i.createElement(u.Controller,{render:e=>i.createElement(l.DatePicker,{date:e.value,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:g})),i.createElement("div",{className:"search-field-wrapper"},i.createElement("label",null,o("TO_DATE")),i.createElement(u.Controller,{render:e=>i.createElement(l.DatePicker,{date:e.value,onChange:e.onChange,min:C}),name:"toDate",control:g}))),i.createElement("div",{className:"wt-search-actions",style:{display:"flex",justifyContent:v?"center":"flex-end",flexDirection:v?"column-reverse":"row",gap:"24px",marginTop:"16px"}},i.createElement("span",{className:"generic-button clear-search",onClick:O,style:{cursor:"pointer",alignSelf:"center"}},o("ES_COMMON_CLEAR_ALL")),i.createElement("div",{style:{minWidth:v?"100%":"160px"}},i.createElement(l.SubmitBar,{label:o("ES_COMMON_SEARCH"),submit:!0}))))}),!t&&null!=d&&d.display?i.createElement(l.Card,{style:{marginTop:20}},o(d.display).split("\\n").map((e,t)=>i.createElement("p",{key:t,style:{textAlign:"center"}},e))):t||""===d?(""!==d||t)&&i.createElement(l.Loader,null):i.createElement(l.Table,{t:o,data:d,totalRecords:s,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===o("WT_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:e=>{S("limit",Number(e.target.value)),_(r)()},currentPage:T("offset")/T("limit"),onNextPage:()=>{S("offset",T("offset")+T("limit")),_(r)()},onPrevPage:()=>{const e=T("offset"),t=T("limit");e-t>=0&&(S("offset",e-t),_(r)())},pageSizeLimit:T("limit"),onSort:x,disableSort:!1,sortParams:[{id:T("sortBy"),desc:"DESC"===T("sortOrder")}]})))},T=e=>{let{moduleCode:t}=e;const{t:a}=o.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[u,d]=n.useState({}),[s,c]=n.useState(null);n.useEffect(()=>{if(s){const e=setTimeout(()=>{c(null)},1e3);return()=>clearTimeout(e)}},[s]);const m={enabled:!!(u&&Object.keys(u).length>0)};let v=[],p=0,E=!1,f=!1,g=!1,_=null;return"WT"===t?({isLoading:E,isSuccess:f,isError:g,error:_,data:{waterTankerBookingDetail:v=[],count:p=0}={}}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:r,filters:u},m)):"MT"===t?({isLoading:E,isSuccess:f,isError:g,error:_,data:{mobileToiletBookingDetails:v=[],Count:p=0}={}}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:r,filters:u},m)):"TP"===t&&({isLoading:E,isSuccess:f,isError:g,error:_,data:{treePruningBookingDetails:v=[],Count:p=0}={}}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:r,filters:u},m)),i.createElement(i.Fragment,null,i.createElement(S,{t:a,isLoading:E,tenantId:r,setShowToast:c,onSubmit:function(e){const{fromDate:t,toDate:l}=e,n={...e,...l?{toDate:l}:{},...t?{fromDate:t}:{}};let i=Object.keys(n).filter(e=>n[e]).reduce((e,t)=>({...e,[t]:"object"==typeof n[t]?n[t].code:n[t]}),{});!(Object.keys(i).length>0)||i.bookingNo||i.fromDate||i.status||i.toDate||i.mobileNumber?i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?c({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):d(i):c({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:f&&!E?v.length>0?v:{display:"ES_COMMON_NO_DATA"}:"",count:p,moduleCode:t}),s&&i.createElement(l.Toast,{error:s.error,warning:s.warning,label:a(s.label),onClose:()=>c(null)}))},b=()=>{var e,t,n,r,u,d,s,c,m,v,E,f;const{t:g}=o.useTranslation(),_=a.useLocation(),{path:h,...S}=a.useRouteMatch(),b=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent("WTCreate"),y=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WTApplicationDetails"),N=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("MTApplicationDetails"),C=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("TPApplicationDetails"),A=null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("WTMyApplications"),I=Digit.ComponentRegistryService.getComponent("WTEmpInbox"),D=Digit.ComponentRegistryService.getComponent("WTCitizenCard"),x=Digit.ComponentRegistryService.getComponent("MTCitizenCard"),O=null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f?void 0:f.getComponent("ApplicationDetails"),L=e=>({searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:[e],applicationStatus:[],locality:[]}}),w=L("watertanker"),P=L("mobileToilet");return i.createElement("span",{style:{width:"100%"}},i.createElement(a.Switch,null,i.createElement(l.AppContainer,null,i.createElement("div",{className:"ground-container employee-app-container form-container"},i.createElement(l.ModuleHeader,{leftContent:i.createElement(i.Fragment,null,i.createElement(l.ArrowLeft,{className:"icon"}),g("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=_.pathname;e.includes("/mt/"),e.includes("/tp/");let t=[{icon:l.HomeIcon,path:"/digit-ui/citizen"},{label:g("WT_MODULE_NAME"),path:h+"/wt-Vendor"}];if(e.includes("/inbox")){let n="ES_COMMON_INBOX";e.includes("/mt/inbox")&&(t=[{icon:l.HomeIcon,path:"/digit-ui/citizen"},{label:g("ACTION_TEST_MT"),path:h+"/mt-Vendor"}]),t.push({label:g(n)})}else if(e.includes("/my-bookings")){let l="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(l="MT_SEARCH_BOOKINGS"),t.push({label:g(l)})}else e.includes("/status")?t.push({label:g("WT_MY_APPLICATIONS")}):(e.includes("/booking/")||e.includes("/booking-details")||e.includes("/bookingsearch/booking-details"))&&(t.push({label:g("ES_COMMON_INBOX"),path:e.includes("/mt/")?h+"/mt/inbox":h+"/inbox"}),t.push({label:g("WT_BOOKING_DETAILS")}));return t})()}),i.createElement("div",{className:"employee-form-content"},i.createElement(l.PrivateRoute,{path:h+"/inbox",component:()=>i.createElement(I,{useNewInboxAPI:!0,parentRoute:h,moduleCode:"WT",businessService:"watertanker",filterComponent:"WT_INBOX_FILTER",initialStates:w,isInbox:!0})}),i.createElement(l.PrivateRoute,{path:h+"/mt/inbox",component:()=>i.createElement(I,{useNewInboxAPI:!0,parentRoute:h,businessService:"mobileToilet",moduleCode:"MT",filterComponent:"WT_INBOX_FILTER",initialStates:P,isInbox:!0})}),i.createElement(l.PrivateRoute,{path:h+"/request-service",component:b}),i.createElement(l.PrivateRoute,{path:h+"/status",component:A}),i.createElement(l.PrivateRoute,{path:h+"/booking/waterTanker/:acknowledgementIds/:tenantId",component:y}),i.createElement(l.PrivateRoute,{path:h+"/booking/mobileToilet/:acknowledgementIds/:tenantId",component:N}),i.createElement(l.PrivateRoute,{path:h+"/booking/treePruning/:acknowledgementIds/:tenantId",component:C}),i.createElement(l.PrivateRoute,{path:h+"/booking-details/:id",component:()=>i.createElement(O,{parentRoute:h})}),i.createElement(l.PrivateRoute,{path:h+"/bookingsearch/booking-details/:id",component:()=>i.createElement(O,{parentRoute:h})}),i.createElement(l.PrivateRoute,{path:h+"/wt-Vendor",component:()=>Digit.UserService.hasAccess(["WT_VENDOR"])?i.createElement(D,{parentRoute:h}):i.createElement(a.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/wt-Vendor",role:"WT_VENDOR"}}})}),i.createElement(l.PrivateRoute,{path:h+"/mt-Vendor",component:()=>Digit.UserService.hasAccess(["MT_VENDOR"])?i.createElement(x,{parentRoute:h}):i.createElement(a.Redirect,{to:{pathname:"/digit-ui/citizen/login",state:{from:h+"/mt-Vendor",role:"MT_VENDOR"}}})}),i.createElement(l.PrivateRoute,{path:h+"/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:h,moduleCode:"WT"}))}),i.createElement(l.PrivateRoute,{path:h+"/mt/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:h,moduleCode:"MT"}))}))))))},y=e=>{let{onSubmit:t,setExistingDataSet:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState(null),[m,v]=n.useState(!1),{offset:p}=a.useParams();n.useEffect(()=>{m&&(t(),v(!1))},[m,t]);let E={limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:p&&!isNaN(parseInt(p))?p:"0",tenantId:d};n.useEffect(()=>{c(E)},[p]);const{isLoading:f,data:g}=Digit.Hooks.wt.useTankerSearchAPI({filters:s});if(f)return i.createElement(l.Loader,null);const _=(null==g?void 0:g.waterTankerBookingDetail)||[],h={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},S={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return i.createElement(i.Fragment,null,i.createElement("div",null,_.length>0&&_.map((e,t)=>{var n;return i.createElement("div",{key:t},i.createElement(l.Card,{style:{...h,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=S.backgroundColor,e.currentTarget.style.boxShadow=S.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{(e=>{var t,l,n,i,o,a,u,d,s,c,m,p,E,f,g,_,h,S;const T={address:{houseNo:null==e||null===(t=e.address)||void 0===t?void 0:t.houseNo,streetName:null==e||null===(l=e.address)||void 0===l?void 0:l.streetName,addressline1:null==e||null===(n=e.address)||void 0===n?void 0:n.addressLine1,addressline2:null==e||null===(i=e.address)||void 0===i?void 0:i.addressLine2,landmark:null==e||null===(o=e.address)||void 0===o?void 0:o.landmark,pincode:null==e||null===(a=e.address)||void 0===a?void 0:a.pincode,cityValue:{code:null==e||null===(u=e.address)||void 0===u?void 0:u.city,value:null==e||null===(d=e.address)||void 0===d?void 0:d.city,i18nKey:null==e||null===(s=e.address)||void 0===s?void 0:s.city,city:{name:null==e||null===(c=e.address)||void 0===c?void 0:c.city,code:null==e||null===(m=e.address)||void 0===m?void 0:m.cityCode}},locality:{code:null==e||null===(p=e.address)||void 0===p?void 0:p.localityCode,value:null==e||null===(E=e.address)||void 0===E?void 0:E.locality,i18nKey:null==e||null===(f=e.address)||void 0===f?void 0:f.locality}},owner:{applicantName:null==e||null===(g=e.applicantDetail)||void 0===g?void 0:g.name,mobileNumber:null==e||null===(_=e.applicantDetail)||void 0===_?void 0:_.mobileNumber,alternateNumber:null==e||null===(h=e.applicantDetail)||void 0===h?void 0:h.alternateNumber,emailId:null==e||null===(S=e.applicantDetail)||void 0===S?void 0:S.emailId},requestDetails:{deliveryDate:null==e?void 0:e.deliveryDate,deliveryTime:null==e?void 0:e.deliveryTime,waterQuantity:{code:null==e?void 0:e.waterQuantity,value:null==e?void 0:e.waterQuantity,i18nKey:null==e?void 0:e.waterQuantity},tankerType:{code:null==e?void 0:e.tankerType,value:null==e?void 0:e.tankerType,i18nKey:null==e?void 0:e.tankerType},description:null==e?void 0:e.description}};r(T),v(!0)})(e)}},i.createElement(l.KeyNote,{keyValue:u("BOOKING_NO"),note:null==e?void 0:e.bookingNo}),i.createElement(l.KeyNote,{keyValue:u("APPLICANT_NAME"),note:null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.name}),i.createElement(l.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u(""+(null==e?void 0:e.bookingStatus))})))}),0===_.length&&!f&&i.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("NO_APPLICATION_FOUND_MSG"))))},N=i.memo(e=>{let{t:t}=e;return i.createElement("h1",{className:"heading-m"},t("MY_BOOKINGS"))}),C=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(C,null)),I=e=>{let{t:t,closeModal:o,onSubmit:a,setExistingDataSet:r}=e;const[u,d]=n.useState(!1),[s,c]=n.useState(!1),m=n.useCallback(()=>{s&&(a(),c(!1))},[s,a]);return n.useEffect(()=>{m()},[m]),i.createElement(i.Fragment,null,i.createElement(l.Modal,{headerBarMain:i.createElement(N,{t:t}),headerBarEnd:i.createElement(A,{onClick:o}),actionCancelLabel:u&&t("CS_COMMON_BACK"),actionCancelOnSubmit:()=>d(!1),hideSubmit:!0,formId:"modal-action"},i.createElement(l.Card,{style:{boxShadow:"none"}},u&&i.createElement(y,{onSubmit:a,setExistingDataSet:r}),i.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&i.createElement(l.SubmitBar,{label:t("USE_EXISTING_DETAILS"),onSubmit:()=>{d(!0)}}),!u&&i.createElement(l.SubmitBar,{label:t("FILL_NEW_DETAILS"),onSubmit:()=>{c(!0)}})))))},D=function(){function e(){}return e.prototype.then=function(t,l){const n=new e,i=this.s;if(i){const e=1&i?t:l;if(e){try{x(n,1,e(this.v))}catch(e){x(n,2,e)}return n}return this}return this.o=function(e){try{const i=e.v;1&e.s?x(n,1,t?t(i):i):l?x(n,1,l(i)):x(n,2,i)}catch(e){x(n,2,e)}},n},e}();function x(e,t,l){if(!e.s){if(l instanceof D){if(!l.s)return void(l.o=x.bind(null,e,t));1&t&&(t=l.s),l=l.v}if(l&&l.then)return void l.then(x.bind(null,e,t),x.bind(null,e,2));e.s=t,e.v=l;const n=e.o;n&&n(e)}}function O(e){return e instanceof D&&1&e.s}function L(e,t,l){for(var n;;){var i=e();if(O(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=l();if(o&&o.then){if(!O(o)){n=1;break}o=o.s}if(t){var a=t();if(a&&a.then&&!O(a)){n=2;break}}}var r=new D,u=x.bind(null,r,2);return(0===n?i.then(s):1===n?o.then(d):a.then(c)).then(void 0,u),r;function d(n){o=n;do{if(t&&(a=t())&&a.then&&!O(a))return void a.then(c).then(void 0,u);if(!(i=e())||O(i)&&!i.v)return void x(r,1,o);if(i.then)return void i.then(s).then(void 0,u);O(o=l())&&(o=o.v)}while(!o||!o.then);o.then(d).then(void 0,u)}function s(e){e?(o=l())&&o.then?o.then(d).then(void 0,u):d(o):x(r,1,o)}function c(){(i=e())?i.then?i.then(s).then(void 0,u):s(i):x(r,1,o)}}function w(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function P(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const R=e=>{let{jumpTo:t}=e;o.useTranslation();const n=a.useHistory();return i.createElement(l.LinkButton,{label:i.createElement(l.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){n.push(t)}})},k=e=>{Digit.UploadServices.Filefetch([e],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},M=e=>e.substr(0,1).toUpperCase()+e.substr(1),F=function(e,t,l){try{var n,i,o,a,r,u,d,s,c,m,v,p,E,_;return console.log("booking",e),console.log("tenantInfo",t),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${h=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),h.toLowerCase().split(" ").map(M).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("WT_ACKNOWLEDGEMENT"),details:[{title:l("WT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("WT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("WT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("WT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:l("WT_CITY"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.landmark}].filter(e=>e.value)},{title:l("WT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_TANKER_TYPE"),value:null==e?void 0:e.tankerType},{title:l("WT_WATER_TYPE"),value:l(null==e?void 0:e.waterType)},{title:l("WT_TANKER_QUANTITY"),value:null==e?void 0:e.tankerQuantity},{title:l("WT_WATER_QUANTITY"),value:(null==e?void 0:e.waterQuantity)+" Ltr"},{title:l("WT_DELIVERY_DATE_TIME"),value:`${g(null==e?void 0:e.deliveryDate)} (${f(null==e?void 0:e.deliveryTime)})`},{title:l("WT_DESCRIPTION"),value:null==e?void 0:e.description},{title:l("WT_IMMEDIATE"),value:l("Y"===(null==e?void 0:e.extraCharge)?"YES":"NO")}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var h},B=e=>{const{t:t}=o.useTranslation();return e.isSuccess?t("WT_SUBMIT_SUCCESSFULL"):e.isLoading?t("WT_APPLICATION_PENDING"):e.isSuccess?void 0:t("WT_APPLICATION_FAILED")},U={padding:"4px 0px",justifyContent:"space-between"},W=e=>{var t,n;return i.createElement(l.Banner,{message:B(e),applicationNumber:null===(t=e.data)||void 0===t||null===(n=t.waterTankerBookingDetail)||void 0===n?void 0:n.bookingNo,info:e.isSuccess?e.t("WT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},H=()=>{const{t:e}=o.useTranslation(),t=Digit.ULBService.getCurrentTenantId(),{data:n,isLoading:a}=Digit.Hooks.useNewInboxGeneral({tenantId:t,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),{data:r,isLoading:u}=Digit.Hooks.useNewInboxGeneral({tenantId:t,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker-fixedpoint"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}}),d=a?"-":(null==n?void 0:n.totalCount)??0,s=u?"-":(null==r?void 0:r.totalCount)??0,c=[{count:d,label:e("ES_COMMON_INBOX"),subLabel:e("CITIZEN"),link:"/digit-ui/employee/wt/inbox"},{count:s,label:e("ES_COMMON_INBOX"),subLabel:e("FIXED_POINT"),link:"/digit-ui/employee/wt/fixed-point/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/my-bookings"},{label:e("WT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/request-service"},{label:e("WT_FIXED_POINT_SCHEDULE_MANAGEMENT"),link:"/digit-ui/employee/wt/fixed-point-schedule"},{label:e("WT_LIVE_TRACKING_SYSTEM"),link:"/digit-ui/employee/wt/live-tracking"},{label:e("WT_SEARCH_FIX_POINT"),link:"/digit-ui/employee/wt/search-filling-fix-point"},{label:e("Vendor_Assign"),link:"/digit-ui/employee/wt/vendor-assignment"}],m=Digit.UserService.hasAccess(["WT_CEMP"])||!1,v={Icon:i.createElement(l.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:d,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||m)};return i.createElement(l.EmployeeModuleCard,v)},j=e=>{let{t:t,currentPage:n,columns:o,data:a,getCellProps:r,disableSort:u,onSort:d,onNextPage:s,onPrevPage:c,onPageSizeChange:m,isPaginationRequired:v,pageSizeLimit:E,sortParams:f,totalRecords:g,showCSVExport:_,csvExportFileName:h,csvExportData:S,getCSVExportData:T,csvExportColumns:b,csvExportButtonLabel:y,...N}=e;return i.createElement(l.Table,p({t:t,data:a,currentPage:n,columns:o,getCellProps:r,onNextPage:s,onPrevPage:c,pageSizeLimit:E,disableSort:u,isPaginationRequired:v,onPageSizeChange:m,onSort:d,sortParams:f,totalRecords:g,showCSVExport:_,csvExportFileName:h,csvExportData:S,getCSVExportData:T,csvExportColumns:b,csvExportButtonLabel:y,inboxStyles:{overflowX:"scroll"}},N))},z=e=>{let{businessService:t}=e;const{t:r}=o.useTranslation(),u=[],[d,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===t).filter(e=>{let{roles:t}=e;return t.some(e=>c.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});s(e)},[]),i.createElement(l.Card,{className:"filter inboxLinks"},i.createElement("div",{className:"complaint-links-container"},"CITIZEN"!==Digit.UserService.getUser().info.type&&i.createElement("div",{className:"header"},i.createElement("span",{className:"logo"},i.createElement(l.HomeIcon,null))," ",i.createElement("span",{className:"text"},r(t+"_REQUEST"))),i.createElement("div",{className:"body"},d.map((e,t)=>{let{link:l,text:n,hyperlink:o=!1,roles:u=[]}=e;return i.createElement("span",{className:"link",key:t},o?i.createElement("a",{href:l},n):i.createElement(a.Link,{to:l},r(n)))}))))},V={mobileNumber:l.MobileNumber},G=e=>{var t;let{onSearch:n,type:a,onClose:r,searchFields:d,searchParams:s,isInboxPage:c,clearSearch:m}=e;const{t:v}=o.useTranslation(),{handleSubmit:p,reset:E,watch:f,control:g,formState:_,setValue:h}=u.useForm({defaultValues:c?s:{locality:null,city:null,...s}}),S=f(),T=innerWidth<=640;function b(){const e=d.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(E(e),c){const e={...s};e.delete=[],d.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),n({...e})}else m()}const y=e=>i.createElement(l.LinkLabel,{style:{display:"inline",...e?{margin:0}:{}},onClick:b},v("ES_COMMON_CLEAR_SEARCH"));return i.createElement("form",{id:"search-form",onSubmit:p(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],d.forEach(t=>{e[t.name]||e.delete.push(t.name)}),n(e),"mobile"===a&&r()}),className:"search-form-wrapper search-complaint-container"},i.createElement(i.Fragment,null,("mobile"===a||T)&&i.createElement("div",{className:"complaint-header"},i.createElement("h2",null,v("ES_COMMON_SEARCH_BY")),i.createElement("span",{onClick:r},i.createElement(l.CloseSvg,null))),i.createElement("div",{className:"formcomposer-section-grid"},null==d||null===(t=d.filter(e=>!0))||void 0===t?void 0:t.map((e,t)=>{var n,o,a,r,d;return i.createElement("div",{key:e.name,className:"input-fields"},i.createElement("span",{className:"mobile-input"},i.createElement(l.Label,null,v(e.label)+" "+(e.isMendatory?"*":"")),i.createElement(u.Controller,e.type?{render:t=>i.createElement(null==V?void 0:V[e.type],{formValue:S,setValue:h,onChange:t.onChange,value:t.value}),name:e.name,control:g,defaultValue:""}:{render:e=>i.createElement(l.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:g,defaultValue:""})),null!=_&&null!==(n=_.dirtyFields)&&void 0!==n&&n[e.name]&&null!=_&&null!==(o=_.errors)&&void 0!==o&&null!==(a=o[e.name])&&void 0!==a&&a.message?i.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==_||null===(r=_.errors)||void 0===r||null===(d=r[e.name])||void 0===d?void 0:d.message):null)})),i.createElement("div",{className:"formcomposer-section-button"},c?i.createElement("div",{className:"generic-button clear-search"},i.createElement("p",{onClick:b},v("ES_COMMON_CLEAR_SEARCH"))):i.createElement("div",null,y()),"desktop"===a&&!T&&i.createElement(l.SubmitBar,{className:"generic-button",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==d||!d.find(e=>"locality"===e.name)||null!=S&&null!==(e=S.locality)&&void 0!==e&&e.code||(t=!0),t})(),label:v("ES_COMMON_SEARCH"),submit:!0,form:"search-form"})),("mobile"===a||T)&&i.createElement(l.ActionBar,{className:"clear-search-container"},i.createElement("button",{className:"clear-search",style:{flex:1}},y(T)),i.createElement(l.SubmitBar,{disabled:!!Object.keys(_.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},K=e=>{var t;let{tableConfig:a,filterComponent:r,...u}=e;const{data:d,useNewInboxAPI:s}=u,{t:c}=o.useTranslation(),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[p,E]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(u.EmptyResultInboxComp)}),[f,g]=n.useState(!1),_=i.useMemo(()=>u.isSearch?a.searchColumns(u):a.inboxColumns(u)||[],[]),h=i.useMemo(()=>{var e,t,l,n,i;return[{Header:(null==_||null===(e=_[0])||void 0===e?void 0:e.Header)||c("WT_BOOKING_NO"),exportAccessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""}},{Header:(null==_||null===(t=_[1])||void 0===t?void 0:t.Header)||c("WT_APPLICANT_NAME"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""}},{Header:(null==_||null===(l=_[2])||void 0===l?void 0:l.Header)||c("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""}},{Header:(null==_||null===(n=_[3])||void 0===n?void 0:n.Header)||c("LOCALITY"),exportAccessor:e=>{var t;return null!=e&&null!==(t=e.searchData)&&void 0!==t&&t.localityCode?c(e.searchData.localityCode):""}},{Header:(null==_||null===(i=_[4])||void 0===i?void 0:i.Header)||c("WT_STATUS"),exportAccessor:e=>{var t,l;return null!=e&&null!==(t=e.workflowData)&&void 0!==t&&null!==(l=t.state)&&void 0!==l&&l.applicationStatus?c(e.workflowData.state.applicationStatus):""}}]},[_,c]);let S;if(u.isLoading)S=i.createElement(l.Loader,null);else if(f)S=null;else if(!d||0===(null==d?void 0:d.length)||s&&null!=d&&null!==(t=d[0])&&void 0!==t&&t.dataEmpty){var T;S=p?i.createElement(p,{data:d}):0===(null==d?void 0:d.length)||s&&null!=d&&null!==(T=d[0])&&void 0!==T&&T.dataEmpty?i.createElement(l.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\n").map((e,t)=>i.createElement("p",{key:t,style:{textAlign:"center"}},e))):i.createElement(l.Loader,null)}else(null==d?void 0:d.length)>0&&(S=i.createElement(j,{t:c,data:d,columns:_,getCellProps:e=>({style:{padding:"8px 12px",fontSize:"13.5px"}}),onPageSizeChange:u.onPageSizeChange,currentPage:u.currentPage,onNextPage:u.onNextPage,onPrevPage:u.onPrevPage,pageSizeLimit:u.pageSizeLimit,onSort:u.onSort,disableSort:u.disableSort,sortParams:u.sortParams,autoSort:!1,totalRecords:u.totalRecords,showCSVExport:!0,getCSVExportData:u.getCSVExportData,csvExportColumns:h,csvExportFileName:String(u.moduleCode||"wt").toLowerCase()+"-inbox"}));return i.createElement("div",{className:"inbox-container"},!u.isSearch&&i.createElement("div",{className:"side-panel-item"},i.createElement(z,{parentRoute:u.parentRoute,businessService:u.moduleCode}),i.createElement("div",{className:"filter-form "},i.createElement(m,{defaultSearchParams:u.defaultSearchParams,onFilterChange:u.onFilterChange,searchParams:u.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==d?void 0:d[0].statusMap:null,moduleCode:u.moduleCode}))),i.createElement("div",{className:"employee-form-content",style:{flex:1}},i.createElement(G,{defaultSearchParams:u.defaultSearchParams,onSearch:e=>{u.onSearch(e),g(!1)},type:"desktop",searchFields:u.searchFields,isInboxPage:!(null!=u&&u.isSearch),searchParams:u.searchParams,clearSearch:()=>g(!0)}),i.createElement("div",{className:"result",style:{flex:1}},S)))},Y=e=>{const{t:t}=o.useTranslation(),[a,r]=n.useState(()=>{var l,n;return null!==(l=e.sortParams)&&void 0!==l&&null!==(n=l[0])&&void 0!==n&&n.desc?{code:"DESC",name:t("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:t("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return i.createElement(i.Fragment,null,i.createElement("div",{className:"filter"},i.createElement("div",{className:"filter-card"},i.createElement("div",{className:"heading"},i.createElement("div",{className:"filter-label"},t("SORT_BY"),":"),i.createElement("div",{className:"clearAll",onClick:u},t("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&i.createElement("span",{className:"clear-search",onClick:u},t("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&i.createElement("span",{onClick:e.onClose},i.createElement(l.CloseSvg,null))),i.createElement("div",null,i.createElement(l.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:t("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:t("ES_INBOX_DATE_LATEST_LAST")}]})))))},$=e=>{let{t:t,data:o,onFilterChange:a,onSearch:r,onSort:u,serviceRequestIdKey:d,isFstpOperator:s,isLoading:c,isSearch:m,searchParams:v,searchFields:p,sortParams:E,linkPrefix:f,filterComponent:g}=e;const[_,h]=n.useState(m?"SEARCH":""),[S,T]=n.useState(!!m),[b,y]=n.useState(E),[N]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{_&&T(!0)},[_]);const C=()=>{T(!1),h(""),y(E)};if(c)return i.createElement(l.Loader,null);let A;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(A=i.createElement(l.DetailsCard,{data:o,serviceRequestIdKey:d,linkPrefix:f||"/digit-ui/employee/chb/"})):A=i.createElement(l.Card,{style:{marginTop:20}},t("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>i.createElement("p",{key:t,style:{textAlign:"center"}},e))),i.createElement(i.Fragment,null,i.createElement("div",{className:"searchBox"},r&&i.createElement(l.SearchAction,{text:"SEARCH",handleActionClick:()=>{h("SEARCH"),T(!0)}}),!m&&a&&i.createElement(l.FilterAction,{text:"FILTER",handleActionClick:()=>{h("FILTER"),T(!0)}}),i.createElement(l.FilterAction,{text:"SORT",handleActionClick:()=>{h("SORT"),T(!0)}})),A,S&&i.createElement(l.PopUp,null,"FILTER"===_&&i.createElement("div",{className:"popup-module"},i.createElement(N,{onFilterChange:e=>{a(e),T(!1)},Close:C,type:"mobile",searchParams:v})),"SORT"===_&&i.createElement("div",{className:"popup-module"},i.createElement(Y,{type:"mobile",sortParams:E,onClose:C,onSort:u})),"SEARCH"===_&&i.createElement("div",{className:"popup-module"},i.createElement(G,{type:"mobile",onClose:C,onSearch:r,isFstpOperator:s,searchParams:v,searchFields:p}))))},q=e=>{let{classNameForMobileView:t=""}=e;const{t:r}=o.useTranslation(),u=[],[d,s]=n.useState([]),{roles:c}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var l;t.accessTo?(l=t.accessTo,c.filter(e=>l.includes(e.code)).length&&e.push(t)):e.push(t)}),s(e)},[]),i.createElement(l.Card,{className:"employeeCard filter"},i.createElement("div",{className:"complaint-links-container "+t},i.createElement("div",{className:"header"},i.createElement("span",{className:"logo"},i.createElement(l.ShippingTruck,null))," ",i.createElement("span",{className:"text"},r("ES_TITLE_WT_REGISTRATION"))),i.createElement("div",{className:"body"},d.map((e,t)=>{let{link:l,text:n}=e;return i.createElement("span",{className:"link",key:t},i.createElement(a.Link,{to:l},n))}))))},X=e=>{let{data:t,isLoading:l,isSearch:n,searchFields:a,onFilterChange:r,onSearch:u,onSort:d,parentRoute:s,searchParams:c,sortParams:m,linkPrefix:v,tableConfig:p,filterComponent:E}=e;const{t:f}=o.useTranslation();return i.createElement("div",{style:{padding:0}},i.createElement("div",{className:"inbox-container"},i.createElement("div",{className:"filters-container"},!n&&i.createElement(q,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),i.createElement($,{t:f,data:null==t?void 0:t.map(e=>{const t={};return(n?p.searchColumns():p.inboxColumns()).forEach(l=>{l.mobileCell&&(t[l.Header]=l.mobileCell(e))}),t}),onFilterChange:r,isLoading:l,isSearch:n,onSearch:u,onSort:d,searchParams:c,searchFields:a,linkPrefix:v,sortParams:m,serviceRequestIdKey:null==p?void 0:p.serviceRequestIdKey,filterComponent:E}))))},Q={bookingNo:"bookingNo",applicantName:"applicantName",mobileNumber:"mobileNumber",localityCode:"localityCode",applicationStatus:"applicationStatus",bookingStatus:"bookingStatus",createdTime:"createdTime"},Z=e=>{var t,l,a,r,u;let{useNewInboxAPI:d,parentRoute:s,moduleCode:c,detailRoute:m,initialStates:v={},filterComponent:p,isInbox:E,rawWfHandler:f,rawSearchHandler:g,combineResponse:_,wfConfig:h,searchConfig:S,middlewaresWf:T,middlewareSearch:b,EmptyResultInboxComp:y}=e;const N=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),C=Digit.UserService.getUser().info,{t:A}=o.useTranslation(),[I,D]=n.useState(()=>E?{}:{enabled:!1}),[x,O]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("WTInboxTableConfig")}),[w,P]=n.useState(v.pageOffset||0),[R,k]=n.useState(v.pageSize||10),[M,F]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(v.searchParams||{}),W=Q[null==M||null===(t=M[0])||void 0===t?void 0:t.id]||(null==M||null===(l=M[0])||void 0===l?void 0:l.id)||"createdTime";let H=window.Digit.Utils.browser.isMobile(),j=H?{limit:100,offset:0,sortBy:W,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:R,offset:w,sortBy:W,sortOrder:null!=M&&null!==(r=M[0])&&void 0!==r&&r.desc?"DESC":"ASC"};const{isLoading:z,data:V,searchFields:G,...Y}=d?Digit.Hooks.useNewInboxGeneral({tenantId:N,ModuleCode:c,filters:{...B,...j,sortParams:M}}):Digit.Hooks.useInboxGeneral({tenantId:N,businessService:c,isInbox:E,filters:{...B,...j,sortParams:M},rawWfHandler:f,rawSearchHandler:g,combineResponse:_,wfConfig:h,searchConfig:{...I,...S},middlewaresWf:T,middlewareSearch:b});n.useEffect(()=>{P(0)},[B]);const $=e=>{let t=e.delete,l={...B,...e};t&&t.forEach(e=>delete l[e]),delete e.delete,U({...l}),D({enabled:!0})},q=n.useCallback(e=>{var t;Array.isArray(e)&&0!==e.length&&null!==(t=e[0])&&void 0!==t&&t.id&&F(e)},[]),Z=n.useCallback(()=>{var e,t,l,n;const i={WT:"request-service.water_tanker",MT:"request-service.mobile_toilet",TP:"request-service.tree_pruning"},o={moduleName:i[c]||i.WT},a={isInboxSearch:!0,creationReason:[""]},r="ASSIGNED_TO_ME"===(null==B||null===(e=B.uuid)||void 0===e?void 0:e.code),u=null===(t=Digit.UserService.getUser())||void 0===t||null===(l=t.info)||void 0===l?void 0:l.uuid;if(r&&u&&(o.assignee=u),Array.isArray(null==B?void 0:B.services)&&B.services.length>0&&(o.businessService=B.services),Array.isArray(null==B?void 0:B.applicationStatus)&&B.applicationStatus.length>0){const e=B.applicationStatus.map(e=>null==e?void 0:e.uuid).filter(Boolean);e.length>0&&(o.status=e)}return null!=B&&B.mobileNumber&&(a.mobileNumber=B.mobileNumber),null!=B&&B.bookingNo&&(a.bookingNo=B.bookingNo),Array.isArray(null==B?void 0:B.locality)&&B.locality.length>0&&(a.locality=B.locality.map(e=>String((null==e?void 0:e.code)||"").split("_").pop()).filter(Boolean)),Array.isArray(M)&&null!==(n=M[0])&&void 0!==n&&n.id&&(a.sortBy=Q[M[0].id]||M[0].id,a.sortOrder=M[0].desc?"DESC":"ASC"),{workflowFilters:o,moduleSearchCriteria:a}},[c,B,M]),J=n.useCallback(function(){try{var e,t;let l=!1;if(!d||"function"!=typeof(null===(e=Digit)||void 0===e||null===(t=e.InboxGeneral)||void 0===t?void 0:t.Search))return Promise.resolve(Array.isArray(V)?V:[]);const{workflowFilters:n,moduleSearchCriteria:i}=Z(),o=200;let a=0,r=Number.POSITIVE_INFINITY;const u=[],s=L(function(){return!l&&a<r},void 0,function(){return Promise.resolve(Digit.InboxGeneral.Search({inbox:{tenantId:N,processSearchCriteria:n,moduleSearchCriteria:i,limit:o,offset:a}})).then(function(e){const t=Array.isArray(null==e?void 0:e.items)?e.items:[],n=t.map(t=>({searchData:(null==t?void 0:t.businessObject)||{},workflowData:(null==t?void 0:t.ProcessInstance)||{},statusMap:null==e?void 0:e.statusMap,totalCount:null==e?void 0:e.totalCount}));u.push(...n);const i=Number(null==e?void 0:e.totalCount);r=Number.isFinite(i)&&i>=0?i:u.length,0===t.length||t.length<o?l=!0:a+=t.length})});return Promise.resolve(s&&s.then?s.then(function(){return u}):u)}catch(e){return Promise.reject(e)}},[Z,V,N,d]);var ee;if(null!==(null==Y||null===(u=Y.data)||void 0===u?void 0:u.length))return H?i.createElement(X,{data:V,isLoading:z,isSearch:!E,searchFields:G,onFilterChange:$,onSearch:$,onSort:q,parentRoute:s,searchParams:B,sortParams:M,linkPrefix:s+"/application-details/",tableConfig:null!=Y&&Y.tableConfig?Y.tableConfig:x(A)[c],filterComponent:p,EmptyResultInboxComp:y,useNewInboxAPI:d}):i.createElement("div",{className:"app-container",style:{padding:"CITIZEN"===(null==C?void 0:C.type)?"0 24px":""}},i.createElement(K,{moduleCode:c,detailRoute:m,data:V,tableConfig:x(A)[c],isLoading:z,defaultSearchParams:v.searchParams,isSearch:!E,onFilterChange:$,searchFields:G,onSearch:$,onSort:q,onNextPage:()=>{P(e=>e+R)},onPrevPage:()=>{P(e=>e-R)},currentPage:Math.floor(w/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:s,searchParams:B,sortParams:M,totalRecords:Number(null==V||null===(ee=V[0])||void 0===ee?void 0:ee.totalCount),filterComponent:p,EmptyResultInboxComp:y,useNewInboxAPI:d,getCSVExportData:J}))},J=e=>{var t;let{t:n,closeModal:o,onSubmit:a,initialValues:r}=e;const d=new Date,s=`${String(d.getHours()).padStart(2,"0")}:${String(d.getMinutes()).padStart(2,"0")}`,c=r?{...r,arrivalTimeFpl:r.arrivalTimeFpl||s,departureTimeFpl:r.departureTimeFpl||s,arrivalFixedPoint:r.arrivalFixedPoint||s,departureFixedPoint:r.departureFixedPoint||s,returnFpl:r.returnFpl||s,frequencyNo:r.frequencyNo,vehicleId:r.vehicleId,fixedPointCode:r.fixedPointCode,day:r.day||[],volume:r.volume||"",active:r.active||null,remarks:r.remarks||""}:{fixedPointCode:"",day:[],arrivalTimeFpl:s,departureTimeFpl:s,arrivalFixedPoint:s,departureFixedPoint:s,returnFpl:s,volume:"",active:null,remarks:"",frequencyNo:1},{handleSubmit:m,control:v,formState:{},watch:p}=u.useForm({defaultValues:c}),E=Digit.ULBService.getCurrentTenantId(),{isLoading:f,data:g}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:E,filters:{limit:1e3}}),_=((null==g?void 0:g.waterTankerBookingDetail)||[]).map(e=>{var t,l,i,o,a,r,u,d,s,c,m;return{name:(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA",mobileNumber:(null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.mobileNumber)||"NA",locality:(null==e||null===(i=e.address)||void 0===i?void 0:i.locality)||"NA",displayLabel:`${(null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.name)||"NA"} | ${(null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.mobileNumber)||"NA"} | ${(null==e||null===(r=e.address)||void 0===r?void 0:r.locality)||"NA"}`,value:e.fixedPointCode||(null==e||null===(u=e.applicantDetail)||void 0===u?void 0:u.fixedPointId)||e.bookingId,fullAddress:[(null==e||null===(d=e.address)||void 0===d?void 0:d.houseNo)&&`${n("WT_HOUSE_NO")} = ${e.address.houseNo}`,(null==e||null===(s=e.address)||void 0===s?void 0:s.streetName)&&`${n("WT_STREET_NAME")} = ${e.address.streetName}`,(null==e||null===(c=e.address)||void 0===c?void 0:c.landmark)&&`${n("WT_LANDMARK")} = ${e.address.landmark}`,(null==e||null===(m=e.address)||void 0===m?void 0:m.locality)&&`${n("WT_LOCALITY")} = ${e.address.locality}`].filter(Boolean).join(", ")}}),h=p("fixedPointCode"),S=_.find(e=>e.value===h),T=[{label:n("MONDAY"),value:"MONDAY"},{label:n("TUESDAY"),value:"TUESDAY"},{label:n("WEDNESDAY"),value:"WEDNESDAY"},{label:n("THURSDAY"),value:"THURSDAY"},{label:n("FRIDAY"),value:"FRIDAY"},{label:n("SATURDAY"),value:"SATURDAY"},{label:n("SUNDAY"),value:"SUNDAY"}],b=[{label:n("YES"),value:"Yes"},{label:n("NO"),value:"No"}],y=p(),N=(null==y?void 0:y.fixedPointCode)&&(null==y?void 0:y.day)&&Array.isArray(null==y?void 0:y.day)&&(null==y||null===(t=y.day)||void 0===t?void 0:t.length)>0&&(null==y?void 0:y.arrivalTimeFpl)&&(null==y?void 0:y.departureTimeFpl)&&(null==y?void 0:y.arrivalFixedPoint)&&(null==y?void 0:y.departureFixedPoint)&&(null==y?void 0:y.returnFpl)&&""!==(null==y?void 0:y.volume)&&null!=(null==y?void 0:y.volume)&&(null==y?void 0:y.active);return i.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},i.createElement("style",null,"\n .custom-modal-content {\n background-color: #fff;\n border-radius: 8px;\n width: 70%;\n max-width: 800px;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n position: relative;\n }\n .add-trip-form {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 20px;\n }\n @media (max-width: 768px) {\n .custom-modal-content {\n width: 90%;\n max-height: 85vh;\n }\n .add-trip-form {\n grid-template-columns: 1fr;\n gap: 15px;\n }\n }\n @media (max-width: 480px) {\n .custom-modal-content {\n width: 95%;\n max-height: 95vh;\n }\n .custom-modal-body {\n padding: 15px !important;\n }\n .custom-modal-footer {\n padding: 12px 15px !important;\n flex-direction: row;\n justify-content: flex-end;\n }\n .custom-modal-header {\n padding: 12px 15px !important;\n }\n .custom-modal-header h1 {\n font-size: 18px !important;\n }\n }\n @media (max-width: 320px) {\n .custom-modal-footer {\n flex-direction: column-reverse;\n align-items: stretch;\n }\n .custom-modal-footer button {\n width: 100%;\n }\n }\n "),i.createElement("div",{className:"custom-modal-content"},i.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},n(r?"WT_EDIT_TRIP":"WT_ADD_TRIP")),i.createElement("button",{onClick:o,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),i.createElement("div",{className:"custom-modal-body",style:{padding:"24px",overflowY:"auto"}},i.createElement("div",{className:"add-trip-form"},i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_FIXED_POINT_CODE")),f?i.createElement(l.Loader,null):i.createElement(u.Controller,{control:v,name:"fixedPointCode",defaultValue:c.fixedPointCode,render:e=>i.createElement(l.CustomNameDropdown,{option:_,optionKey:"displayLabel",selected:_.find(t=>t.value===e.value),select:t=>e.onChange(t.value),t:n,optionsHeader:{name:"WT_NAME",mobileNumber:"WT_MOBILE_NUMBER",locality:"WT_LOCALITY"}})}),S&&i.createElement("div",{style:{marginTop:"8px",padding:"10px",backgroundColor:"#f9f9f9",border:"1px solid #ddd",borderRadius:"4px",fontSize:"14px",color:"#555"}},i.createElement("strong",null,n("WT_ADDRESS"),":")," ",S.fullAddress)),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_DAY")),i.createElement(u.Controller,{control:v,name:"day",render:e=>i.createElement(l.MultiSelectDropdown,{options:T,optionsKey:"label",selected:T.filter(t=>(e.value||[]).some(e=>e===t.value||(null==e?void 0:e.value)===t.value)),onSelect:t=>{const l=(t||[]).map(e=>null!=e&&e[1]?e[1]:(null==e?void 0:e.value)||e);e.onChange(l)},t:n,defaultLabel:n("WT_SELECT_DAYS"),defaultUnit:n("WT_DAYS")})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_ARRIVAL_TIME_TO_FPL")),i.createElement(u.Controller,{control:v,name:"arrivalTimeFpl",defaultValue:c.arrivalTimeFpl,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_DEPARTURE_TIME_FROM_FPL")),i.createElement(u.Controller,{control:v,name:"departureTimeFpl",defaultValue:c.departureTimeFpl,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_ARRIVAL_AT_FIXED_POINT")),i.createElement(u.Controller,{control:v,name:"arrivalFixedPoint",defaultValue:c.arrivalFixedPoint,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_DEPARTURE_AT_FIXED_POINT")),i.createElement(u.Controller,{control:v,name:"departureFixedPoint",defaultValue:c.departureFixedPoint,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_RETURN_TO_FPL")),i.createElement(u.Controller,{control:v,name:"returnFpl",defaultValue:c.returnFpl,render:e=>i.createElement(l.TextInput,{type:"time",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_VOLUME")),i.createElement(u.Controller,{control:v,name:"volume",defaultValue:c.volume,render:e=>i.createElement(l.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})),i.createElement("div",{className:"field-group"},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_ACTIVE")),i.createElement(u.Controller,{control:v,name:"active",render:e=>i.createElement(l.Dropdown,{option:b,optionKey:"label",selected:e.value,select:e.onChange,t:n})})),i.createElement("div",{className:"field-group remarks-field-group",style:{gridColumn:"span 2"}},i.createElement(l.CardLabel,{style:{marginBottom:"8px",fontWeight:"500"}},n("WT_REMARKS")),i.createElement(u.Controller,{control:v,name:"remarks",defaultValue:c.remarks,render:e=>i.createElement(l.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})})))),i.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},i.createElement("button",{className:"button-cancel",onClick:o,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},n("CS_COMMON_CANCEL")),i.createElement("button",{className:"button-save",disabled:!N,onClick:m(e=>{a({...r,...e})}),style:{padding:"8px 20px",background:N?"#1D4E7F":"#ccc",color:"#fff",border:"none",borderRadius:"4px",cursor:N?"pointer":"not-allowed",opacity:N?1:.7}},n(r?"WT_UPDATE":"CS_COMMON_SAVE")))))},ee=e=>{var t;let{...a}=e;const{t:u}=o.useTranslation(),d=r.useQueryClient(),s=Digit.ULBService.getCurrentTenantId(),[c,m]=n.useState(!1),[v,p]=n.useState(null),[E,f]=n.useState("all"),[g,_]=n.useState({label:"All Fixed Points",value:"all"}),[h,S]=n.useState({label:"All Days",value:"all"}),[T,b]=n.useState({label:"All Status",value:"all"}),[y,N]=n.useState(null),[C,A]=n.useState(0),[I,D]=n.useState(10),[x,O]=n.useState({limit:10,offset:0}),{isLoading:w,data:P}=Digit.Hooks.wt.useFixedPointScheduleSearch(s,x),{data:R}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:s,filters:{offset:0,limit:100}}),k=i.useMemo(()=>({...x,limit:1e3,offset:0}),[x]),{data:M}=Digit.Hooks.wt.useFixedPointScheduleSearch(s,k),F=i.useMemo(()=>{const e=[...(null==R?void 0:R.fixedPointTimeTableDetails)||(null==R?void 0:R.waterTankerBookingDetail)||(null==R?void 0:R.fixedPoints)||[],...(null==M?void 0:M.fixedPointTimeTableDetails)||[]].map(e=>{var t,l,n;return{label:e.fixedPointCode||(null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||e.name||(null===(l=e.applicantDetail)||void 0===l?void 0:l.name)||e.bookingId,value:e.fixedPointCode||(null===(n=e.applicantDetail)||void 0===n?void 0:n.fixedPointId)||e.bookingId}}).filter(e=>e.label&&e.value).filter((e,t,l)=>l.findIndex(t=>t.value===e.value)===t);return[{label:"WT_ALL_FIXED_POINTS"!==u("WT_ALL_FIXED_POINTS")?u("WT_ALL_FIXED_POINTS"):"All Fixed Points",value:"all"},...e]},[R,M,u]);console.log(F,"fixedPoints"),console.log(R,"fixedPointData");const{mutate:B}=Digit.Hooks.wt.useCreateFixedPointSchedule(s),{mutate:U}=Digit.Hooks.wt.useUpdateFixedPointSchedule(s),W=()=>{p(null)},H=i.useCallback(function(e){return void 0===e&&(e=[]),e.map(e=>({scheduleId:e.systemAssignedScheduleId,fixedPointName:e.fixedPointName,fixedPoint:e.fixedPointCode||e.fixedPointId,day:e.day,freq:e.tripNo,arrToFpl:e.arrivalTimeToFpl,depFromFpl:e.departureTimeFromFpl,arrAtFixedPoint:e.arrivalTimeDeliveryPoint,depAtFixedPoint:e.departureTimeDeliveryPoint,returnToFpl:e.timeOfArrivingBackFplAfterDelivery,volume:e.volumeWaterTobeDelivery,vehicle:e.vehicleId,active:e.isEnable?"Y":"N",totalCount:e.totalCount}))},[]),z=i.useMemo(()=>H((null==P?void 0:P.fixedPointTimeTableDetails)||[]),[P,H]),V=function(e,t){var l;void 0===e&&(e=null),void 0===t&&(t=null);const n=e||{fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==h?void 0:h.value)?"":null==h||null===(l=h.value)||void 0===l?void 0:l.toUpperCase(),status:"all"===(null==T?void 0:T.value)?"":null==T?void 0:T.value},i=null!==t?t:0;null===t&&A(0),O({...n,limit:I,offset:i})};i.useEffect(()=>{0!==C&&V(null,C)},[C,I]);const G=i.useMemo(()=>[{Header:u("WT_FIXED_POINT_CODE"),accessor:"fixedPoint"},{Header:u("WT_FIXED_POINT_NAME"),accessor:"fixedPointName"},{Header:u("WT_DAY"),accessor:"day"},{Header:u("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:u("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:u("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:u("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:u("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:u("WT_VOLUME"),accessor:"volume"},{Header:u("WT_ACTIVE"),accessor:"active",Cell:e=>{let{value:t}=e;return i.createElement("span",{style:{background:"Y"===t?"#E6F4EA":"#FCE8E6",padding:"2px 8px",borderRadius:"10px",color:"Y"===t?"#1E8E3E":"#D93025"}},t)}},{Header:u("WT_ACTION"),Cell:e=>{let{row:t}=e;return i.createElement("div",{style:{display:"flex",gap:"5px"}},i.createElement("button",{onClick:()=>{N(t.index),m(!0)},style:{color:"#1D4E7F",border:"1px solid #1D4E7F",background:"none",padding:"2px 8px",cursor:"pointer"}},u("WT_EDIT")))}}],[u]),K=i.useCallback(function(){try{let t=!1;function e(){return H(a)}const l={...x||{}};delete l.limit,delete l.offset;const n=200;let i=0,o=Number.POSITIVE_INFINITY;const a=[],r=L(function(){return!t&&i<o},void 0,function(){return Promise.resolve(Digit.WTService.SearchFixedPointSchedule({tenantId:s,filters:{...l,limit:n,offset:i}})).then(function(e){const l=(null==e?void 0:e.fixedPointTimeTableDetails)||[];a.push(...l);const r=Number((null==e?void 0:e.count)??(null==e?void 0:e.totalCount)??(null==e?void 0:e.Count));o=Number.isFinite(r)&&r>=0?r:a.length,!l.length||l.length<n?t=!0:i+=l.length})});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},[x,H,s]),Y=i.useMemo(()=>[{Header:u("WT_SCHEDULE_ID"),accessor:"scheduleId"},{Header:u("WT_FIXED_POINT"),accessor:"fixedPoint"},{Header:u("WT_DAY"),accessor:"day"},{Header:u("WT_FREQ"),accessor:"freq"},{Header:u("WT_ARR_TO_FPL"),accessor:"arrToFpl"},{Header:u("WT_DEP_FROM_FPL"),accessor:"depFromFpl"},{Header:u("WT_ARR_AT_FIXED_POINT"),accessor:"arrAtFixedPoint"},{Header:u("WT_DEP_AT_FIXED_POINT"),accessor:"depAtFixedPoint"},{Header:u("WT_RETURN_TO_FPL"),accessor:"returnToFpl"},{Header:u("WT_VOLUME"),accessor:"volume"},{Header:u("WT_ACTIVE"),accessor:"active"}],[u]);return i.createElement("div",{className:"fixed-point-schedule-management"},i.createElement(l.Card,{style:{padding:"20px"}},i.createElement("div",{className:"finance-mainlayout",style:{marginBottom:"20px"}},i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_EXPORT")),i.createElement(l.Dropdown,{option:[{label:u("WT_EXCEL_WEEKWISE"),value:"Weekwise"},{label:u("WT_EXCEL_MONTHWISE"),value:"Monthwise"},{label:u("WT_EXCEL_YEARWISE"),value:"Yearwise"}],optionKey:"label",placeholder:u("WT_EXPORT"),t:u,select:e=>{const t=new Date,l=`${t.getDate()}-${t.getMonth()+1}-${t.getFullYear()}`,n=`FixedPointSchedule_${e.value}_${l}`,i=(null==M?void 0:M.fixedPointTimeTableDetails)||[],o=[[u("WT_SCHEDULE_ID"),u("WT_FIXED_POINT"),u("WT_DAY"),u("WT_FREQ"),u("WT_ARR_TO_FPL"),u("WT_DEP_FROM_FPL"),u("WT_ARR_AT_FIXED_POINT"),u("WT_DEP_AT_FIXED_POINT"),u("WT_RETURN_TO_FPL"),u("WT_VOLUME"),u("WT_VEHICLE"),u("WT_ACTIVE")],...i.map(e=>[e.systemAssignedScheduleId,e.fixedPointCode,u(e.day),e.tripNo,e.arrivalTimeToFpl,e.departureTimeFromFpl,e.arrivalTimeDeliveryPoint,e.departureTimeDeliveryPoint,e.timeOfArrivingBackFplAfterDelivery,e.volumeWaterTobeDelivery,e.vehicleId,e.isEnable?"Y":"N"])];if(window.Digit&&window.Digit.Download&&window.Digit.Download.Excel)window.Digit.Download.Excel(o,n);else{const e=o.map(e=>e.map(e=>`"${(""+(null==e?"":e)).replace(/"/g,'\\"')}"`).join(",")),t=new Blob([e.join("\n")],{type:"text/csv"}),l=window.URL.createObjectURL(t),i=document.createElement("a");i.setAttribute("hidden",""),i.setAttribute("href",l),i.setAttribute("download",n+".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}}})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_FIXED_POINT")),i.createElement(l.Dropdown,{option:F,optionKey:"label",selected:g,t:u,select:e=>{_(e)},placeholder:u("WT_ALL_FIXED_POINTS")})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_DAY")),i.createElement(l.Dropdown,{option:[{label:"All Days",value:"all"},{label:u("MONDAY"),value:"MONDAY"},{label:u("TUESDAY"),value:"TUESDAY"},{label:u("WEDNESDAY"),value:"WEDNESDAY"},{label:u("THURSDAY"),value:"THURSDAY"},{label:u("FRIDAY"),value:"FRIDAY"},{label:u("SATURDAY"),value:"SATURDAY"},{label:u("SUNDAY"),value:"SUNDAY"}],optionKey:"label",selected:h,t:u,select:e=>{var t;S(e),f(e.value),V({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==e?void 0:e.value)?"":null==e||null===(t=e.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==T?void 0:T.value)?"":null==T?void 0:T.value})},placeholder:"All Days"})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.CardLabel,null,u("WT_STATUS")),i.createElement(l.Dropdown,{option:[{label:"All Status",value:"all"},{label:"Active",value:"Active"},{label:"Inactive",value:"Inactive"}],optionKey:"label",selected:T,t:u,select:e=>{var t;b(e),V({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:"all"===(null==h?void 0:h.value)?"":null==h||null===(t=h.value)||void 0===t?void 0:t.toUpperCase(),status:"all"===(null==e?void 0:e.value)?"":null==e?void 0:e.value})},placeholder:"All Status"})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement("span",{className:"generic-button clear-search",onClick:()=>{f("all"),S({label:"All Days",value:"all"}),_({label:"All Fixed Points",value:"all"}),b({label:"All Status",value:"all"}),A(0),O({limit:I,offset:0})},style:{alignSelf:"center"}},u("ES_COMMON_CLEAR_SEARCH"))),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement(l.SubmitBar,{label:u("ES_COMMON_SEARCH"),onSubmit:()=>V()}))),i.createElement("div",{style:{display:"flex",gap:"5px",marginBottom:"20px",flexWrap:"wrap"}},["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"].map(e=>i.createElement("button",{key:e,onClick:()=>{f(e),S({label:e,value:e}),V({fixedPointCode:"all"===(null==g?void 0:g.value)?"":null==g?void 0:g.value,day:e.toUpperCase(),status:"all"===(null==T?void 0:T.value)?"":null==T?void 0:T.value})},style:{padding:"8px 16px",border:"1px solid #ccc",borderRadius:"4px",background:E===e?"#1D4E7F":"#fff",color:E===e?"#fff":"#333",cursor:"pointer"}},u(e.toUpperCase())))),i.createElement("div",{style:{width:"100%",overflowX:"auto"}},i.createElement(j,{t:u,data:z,columns:G,getCellProps:e=>({}),styles:{minWidth:"1200px"},inboxStyles:{overflowX:"auto"},isLoading:w,onPageSizeChange:e=>{D(Number(e.target.value))},currentPage:Math.floor(C/I),onNextPage:()=>{A(e=>e+I)},onPrevPage:()=>{A(e=>e-I)},pageSizeLimit:I,onSort:a.onSort,disableSort:a.disableSort,sortParams:a.sortParams,totalRecords:(null==P?void 0:P.count)||(null==P?void 0:P.totalCount)||(null==z||null===(t=z[0])||void 0===t?void 0:t.totalCount),showCSVExport:!0,getCSVExportData:K,csvExportColumns:Y,csvExportFileName:"wt-fixed-point-schedule"})),i.createElement("span",null,i.createElement("button",{onClick:()=>{N(null),m(!0)},style:{background:"#1E8E3E",color:"#fff",border:"none",padding:"10px 20px",borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",gap:"5px",marginBottom:"10px"}},i.createElement("span",null,"+")," ",u("WT_ADD_TRIP")))),c&&i.createElement(J,{t:u,closeModal:()=>{m(!1),N(null)},initialValues:null!==y?{scheduleId:z[y].scheduleId,fixedPointCode:z[y].fixedPoint,day:[{label:u(z[y].day),value:z[y].day}],frequencyNo:z[y].freq,arrivalTimeFpl:z[y].arrToFpl,departureTimeFpl:z[y].depFromFpl,arrivalFixedPoint:z[y].arrAtFixedPoint,departureFixedPoint:z[y].depAtFixedPoint,returnFpl:z[y].returnToFpl,volume:z[y].volume,vehicleId:z[y].vehicle,active:{label:u("Y"===z[y].active?"YES":"NO"),value:"Y"===z[y].active?"Yes":"No"}}:null,onSubmit:e=>{var t,l;const n=null==e?void 0:e.day;let i=[];if(Array.isArray(n))i=n.map(e=>"string"==typeof e?e:(null==e?void 0:e.value)||(Array.isArray(e)?e[1]:e)).filter(e=>"string"==typeof e&&"WT_SELECT_ALL"!==e),0===i.length&&n.some(e=>"WT_SELECT_ALL"===("string"==typeof e?e:(null==e?void 0:e.value)||(Array.isArray(e)?e[1]:e)))&&(i=["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]);else if(n){const e="string"==typeof n?n:(null==n?void 0:n.value)||(Array.isArray(n)?n[1]:n);e&&"WT_SELECT_ALL"!==e&&(i=[e])}const o={tenantId:s,system_assigned_schedule_id:e.scheduleId,fixed_point_code:e.fixedPointCode,day:i.map(e=>{var t;return(null==e||null===(t=e.toUpperCase)||void 0===t?void 0:t.call(e))||e}),trip_no:Number(e.frequencyNo)||Number(e.tripNo)||1,arrival_time_to_fpl:e.arrivalTimeFpl,departure_time_from_fpl:e.departureTimeFpl,arrival_time_delivery_point:e.arrivalFixedPoint,departure_time_delivery_point:e.departureFixedPoint,time_of_arriving_back_fpl_after_delivery:e.returnFpl,volume_water_tobe_delivery:e.volume||"0",active:"Yes"===(null===(t=e.active)||void 0===t?void 0:t.value)||"Yes"===e.active,is_enable:"Yes"===(null===(l=e.active)||void 0===l?void 0:l.value)||"Yes"===e.active,remarks:e.remarks,vehicle_id:e.vehicleId},a=null!==y?{fixedPointDetailsList:[o]}:{fixedPointDetails:o};null!==y?U(a,{onError:(e,t)=>{var l,n,i,o;p({key:"error",label:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"ERROR_WHILE_UPDATING_SCHEDULE"}),setTimeout(W,5e3)},onSuccess:(e,t)=>{p({label:u("WT_SCHEDULE_UPDATE_SUCCESS")}),setTimeout(W,5e3),m(!1),N(null),d.invalidateQueries(["FIXED_POINT_SCHEDULE_SEARCH",s])}}):B(a,{onError:(e,t)=>{var l,n,i,o;p({key:"error",label:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"ERROR_WHILE_CREATING_SCHEDULE"}),setTimeout(W,5e3)},onSuccess:(e,t)=>{p({label:u("WT_SCHEDULE_CREATE_SUCCESS")}),setTimeout(W,5e3),m(!1),N(null),d.invalidateQueries(["FIXED_POINT_SCHEDULE_SEARCH",s])}})}}),v&&i.createElement(l.Toast,{error:"error"===v.key,label:v.label,onClose:W}))},te=new Map,le=function(e,t){try{if(null==e||null==t)return Promise.resolve(null);const l=`${e.toFixed(5)},${t.toFixed(5)}`;return te.has(l)?Promise.resolve(te.get(l)):Promise.resolve(w(function(){return Promise.resolve(fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&zoom=18&addressdetails=1`,{headers:{"Accept-Language":"en","User-Agent":"Digit-UI-WT-Module"}})).then(function(e){if(!e.ok)throw new Error("Geocoding failed: "+e.statusText);return Promise.resolve(e.json()).then(function(e){return te.set(l,e),e})})},function(e){return console.error("Error in reverseGeocode:",e),null}))}catch(e){return Promise.reject(e)}},ne=e=>{if(!e||!e.address)return"Unknown Address";const{address:t}=e,l=[t.house_number||t.amenity,t.road,t.suburb||t.neighbourhood||t.village,t.city_district||t.city||t.town,t.state,t.postcode].filter(Boolean);return l.length>0?l.join(", "):e.display_name||"Unknown Address"},ie=(e,t,l,n)=>{const i=oe(l-e),o=oe(n-t),a=Math.sin(i/2)*Math.sin(i/2)+Math.cos(oe(e))*Math.cos(oe(l))*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))*6371};function oe(e){return e*(Math.PI/180)}delete c.Icon.Default.prototype._getIconUrl,c.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"});const ae=new c.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),re=new c.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),ue=new c.Icon({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),de=e=>{let{lat:t,lng:l,fallback:o="Resolving area"}=e;const[a,r]=n.useState(o);return n.useEffect(()=>{!function(){try{const e=function(){if(null!=t&&null!=l)return Promise.resolve(le(t,l)).then(function(e){r(ne(e))})}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t,l]),i.createElement("span",{title:`${null==t?void 0:t.toFixed(6)}, ${null==l?void 0:l.toFixed(6)}`},a)},se=e=>{let{selectedDriver:t,mapZoom:l,mapCenter:i}=e;const o=s.useMap();return n.useEffect(()=>{null!=t&&t.lat&&null!=t&&t.lng&&o.setView([t.lat,t.lng],l||15,{animate:!0,duration:1})},[t,o]),n.useEffect(()=>{Array.isArray(i)&&2===i.length&&o.setView(i,l||15,{animate:!0,duration:1})},[i,o]),n.useEffect(()=>{l&&o.setZoom(l)},[l,o]),null},ce=e=>{let{start:l,end:o,color:a="#2196f3",weight:r=6}=e;const{routeData:u,loading:d,error:m}=((e,l)=>{const[i,o]=n.useState(null),[a,r]=n.useState(!1),[u,d]=n.useState(null);return n.useEffect(()=>{e&&l&&function(){try{r(!0),Promise.resolve(P(function(){return w(function(){return Promise.resolve(fetch(`https://router.project-osrm.org/route/v1/driving/${e.lng},${e.lat};${l.lng},${l.lat}?overview=full&geometries=geojson&steps=true`)).then(function(e){if(!e.ok)throw new Error(t("FAILED_TO_FETCH_ROUTE"));return Promise.resolve(e.json()).then(function(e){if(e.routes&&e.routes[0]){const t=e.routes[0],l=t.geometry.coordinates.map(e=>[e[1],e[0]]);o({coordinates:l,distance:t.distance,duration:t.duration,legs:t.legs})}})})},function(e){console.error(t("Error fetching route:"),e),d(e.message)})},function(e,t){if(r(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}()},[null==e?void 0:e.lat,null==e?void 0:e.lng,null==l?void 0:l.lat,null==l?void 0:l.lng]),{routeData:i,loading:a,error:u}})(l,o),[v,p]=n.useState(!1),[E,f]=n.useState(null);return d?i.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"white",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},t("LOADING_ROUTE")):m?i.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",background:"#ffebee",color:"#c62828",padding:"8px 16px",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:1e3}},t("ERROR_LOADING_ROUTE"),m):u?i.createElement(i.Fragment,null,(()=>{if(!u.legs)return null;const e=[];return u.legs.forEach((t,l)=>{t.steps.forEach((t,n)=>{const o=t.geometry.coordinates.map(e=>[e[1],e[0]]);let u=a;"turn"===t.maneuver.type?u="#ff9800":"straight"===t.maneuver.type?u="#4caf50":"arrive"===t.maneuver.type&&(u="#f44336"),e.push(i.createElement(i.Fragment,{key:`${l}-${n}`},i.createElement(s.Polyline,{positions:o,color:u,weight:r+2,opacity:.3,lineCap:"round"}),i.createElement(s.Polyline,{positions:o,color:u,weight:r,opacity:.9,lineCap:"round",eventHandlers:{mouseover:()=>f(t),mouseout:()=>f(null),click:()=>p(!v)}}),o.map((e,t)=>{if(t%5==0&&t<o.length-1){const a=o[t+1],r=180*Math.atan2(a[0]-e[0],a[1]-e[1])/Math.PI;return i.createElement(s.Marker,{key:`dot-${l}-${n}-${t}`,position:e,icon:c.divIcon({className:"direction-dot",html:`<div style="\n width: 6px;\n height: 6px;\n background: white;\n border: 2px solid ${u};\n border-radius: 50%;\n transform: rotate(${r}deg);\n "></div>`,iconSize:[10,10],iconAnchor:[5,5]})})}return null})))})}),e})(),(E||v)&&i.createElement("div",{style:{position:"absolute",bottom:"80px",left:"10px",right:"10px",background:"white",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:1e3,maxWidth:"calc(100% - 20px)",border:"1px solid #e0e0e0",maxHeight:"50vh",overflowY:"auto"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},i.createElement("h4",{style:{margin:0,color:"#1F5FA8"}},t("ROUTE_INFORMATION")),i.createElement("button",{onClick:()=>p(!1),style:{background:"none",border:"none",cursor:"pointer",fontSize:"24px",color:"#666",padding:"0 8px"}},"×")),i.createElement("div",{style:{marginBottom:"12px"}},i.createElement("div",null,i.createElement("strong",null,t("TOTAL_DISTANCE"),":")," ",(u.distance/1e3).toFixed(2)," km"),i.createElement("div",null,i.createElement("strong",null,t("ESTIMATED_TIME"),":")," ",Math.round(u.duration/60)," minutes")),E&&i.createElement("div",{style:{padding:"8px",background:"#f5f5f5",borderRadius:"4px",marginBottom:"8px"}},i.createElement("div",null,i.createElement("strong",null,t("CURRENT_STEP"),":")," ",E.maneuver.type),i.createElement("div",null,i.createElement("strong",null,t("INSTRUCTION"),":")," ",E.maneuver.instruction||E.name),i.createElement("div",null,i.createElement("strong",null,t("DISTANCE"),":")," ",(E.distance/1e3).toFixed(2)," km"),i.createElement("div",null,i.createElement("strong",null,t("DURATION"),":")," ",Math.round(E.duration/60)," min")),v&&u.legs&&i.createElement("div",{style:{maxHeight:"200px",overflowY:"auto"}},i.createElement("h5",{style:{margin:"8px 0",color:"#666"}},t("TURN_BY_TURN_DIRECTIONS"),":"),u.legs[0].steps.map((e,t)=>i.createElement("div",{key:t,style:{padding:"8px",borderBottom:"1px solid #eee",fontSize:"12px",cursor:"pointer",background:E===e?"#e3f2fd":"transparent"},onMouseEnter:()=>f(e),onMouseLeave:()=>f(null)},i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement("span",{style:{width:"20px",height:"20px",borderRadius:"50%",background:"#1F5FA8",color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",flexShrink:0}},t+1),i.createElement("div",null,i.createElement("div",{style:{fontWeight:"500"}},e.maneuver.instruction||e.name),i.createElement("div",{style:{color:"#666"}},(e.distance/1e3).toFixed(2)," km · ",Math.round(e.duration/60)," min"))))))),u.distance>1e3&&u.coordinates&&i.createElement(me,{coordinates:u.coordinates,totalDistance:u.distance})):null},me=e=>{let{coordinates:t,totalDistance:l}=e;const n=[];for(let e=1e3;e<l;e+=1e3){const o=Math.floor(t.length*(e/l));o<t.length&&n.push(i.createElement(s.Marker,{key:"dist-"+e,position:t[o],icon:c.divIcon({className:"distance-marker",html:`<div style="\n background: white;\n border: 2px solid #1F5FA8;\n border-radius: 12px;\n padding: 2px 6px;\n font-size: 10px;\n font-weight: bold;\n color: #1F5FA8;\n white-space: nowrap;\n ">${(e/1e3).toFixed(0)} km</div>`,iconSize:[40,20],iconAnchor:[20,10]})}))}return i.createElement(i.Fragment,null,n)},ve=e=>{let{isOnline:t}=e;return i.createElement("span",{style:{display:"inline-block",padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",backgroundColor:t?"#e6f7e6":"#ffe6e6",color:t?"#2e7d32":"#c62828",border:"1px solid "+(t?"#a5d6a7":"#ef9a9a")}},i.createElement("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:t?"#4caf50":"#f44336",marginRight:"6px"}}),t?"ONLINE":"OFFLINE")},pe=e=>{let{driver:t,isSelected:l,onClick:a,vendorList:r}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState("Resolving area..."),[c,m]=n.useState("Resolving area..."),v=n.useRef({lat:null,lng:null}),p=n.useRef({lat:null,lng:null});n.useEffect(()=>{!function(){try{const e=function(){if(t.lat&&t.lng){const e=v.current.lat?ie(v.current.lat,v.current.lng,t.lat,t.lng):Infinity,l=function(){if(e>.2)return Promise.resolve(le(t.lat,t.lng)).then(function(e){s(ne(e)),v.current={lat:t.lat,lng:t.lng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.lat,t.lng]),n.useEffect(()=>{!function(){try{const e=function(){if(t.deliveryLat&&t.deliveryLng){const e=p.current.lat?ie(p.current.lat,p.current.lng,t.deliveryLat,t.deliveryLng):Infinity,l=function(){if(e>.2)return Promise.resolve(le(t.deliveryLat,t.deliveryLng)).then(function(e){m(ne(e)),p.current={lat:t.deliveryLat,lng:t.deliveryLng}})}();if(l&&l.then)return l.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[t.deliveryLat,t.deliveryLng]);const E=n.useMemo(()=>{if(!r||!r.length)return{name:"Unknown",vehicle:"N/A"};for(const o of r){var e;const a=null===(e=o.drivers)||void 0===e?void 0:e.find(e=>{var l,n;return e.id===t.driverId||(null===(l=e.owner)||void 0===l?void 0:l.mobileNumber)===t.driverId||(null===(n=e.owner)||void 0===n?void 0:n.uuid)===t.driverId});var l,n,i;if(a)return{name:(null===(l=a.owner)||void 0===l?void 0:l.name)||"Unknown",vehicle:(null===(n=o.vehicles)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.registrationNumber)||"N/A"}}return{name:"Unknown",vehicle:"N/A"}},[r,t.driverId]);return i.createElement("div",{onClick:a,style:{padding:"16px",borderRadius:"12px",background:l?"#f0f4ff":"white",border:"2px solid "+(l?"#1F5FA8":"#f0f0f0"),cursor:"pointer",position:"relative",transition:"all 0.2s ease"}},i.createElement("div",{style:{display:"flex",gap:"12px",marginBottom:"12px"}},i.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"8px",background:"#f0f2f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px"}},"👤"),i.createElement("div",{style:{flex:1}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},i.createElement("div",null,i.createElement("div",{style:{fontWeight:"700",fontSize:"14px",color:"#0d47a1"}},"DRV-",t.driverId.substring(0,4).toUpperCase()),i.createElement("div",{style:{fontSize:"11px",color:"#666"}},E.name," • ",E.vehicle)),i.createElement("div",{style:{fontSize:"10px",fontWeight:"700",padding:"2px 8px",borderRadius:"4px",background:t.isOnline?"#e8f5e9":"#ffebee",color:t.isOnline?"#2e7d32":"#c62828"}},t.isOnline?"ONLINE":"OFFLINE")))),i.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"}},i.createElement("div",null,i.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},u("CURRENT_LOCATION")),i.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},d))),i.createElement("div",null,i.createElement("div",null,i.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#aaa",marginBottom:"2px"}},u("DESTINATION")),i.createElement("div",{style:{fontSize:"11px",fontWeight:"700",color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},c))))};function Ee(){const{t:e}=o.useTranslation(),t=Digit.ULBService.getCurrentTenantId(),[a,r]=n.useState({}),[u,c]=n.useState(!1),[m,v]=n.useState(null),[p,E]=n.useState(""),[f,g]=n.useState("all"),[_,h]=n.useState(!0),[S,T]=n.useState([28.6139,77.209]),[b,y]=n.useState(12),[N,C]=n.useState(!0),[A,I]=n.useState(window.innerWidth<=768),[D,x]=n.useState(null),[O,L]=n.useState(null),{data:w}=Digit.Hooks.wt.useFillPointSearch({tenantId:t,filters:{status:"ACTIVE"}}),P=n.useMemo(()=>(null==w?void 0:w.fillingPoints)||[],[w]),{data:R}=Digit.Hooks.fsm.useVendorSearch({tenantId:t,filters:{status:"ACTIVE"},config:{select:e=>(null==e?void 0:e.vendor)||[]}}),k=n.useMemo(()=>R&&R.length?D?R.filter(e=>{var t;return(null==e||null===(t=e.fillingPoint)||void 0===t?void 0:t.id)===(null==D?void 0:D.id)}):R:[],[R,D]);n.useEffect(()=>{var e,t,l;null!=R&&R.length&&Object.keys(a).length&&(console.log("=== VENDOR DEBUG ==="),console.log("Vendor[0] vehicles:",null===(e=R[0])||void 0===e?void 0:e.vehicles),console.log("Vendor[0] drivers:",null===(t=R[0])||void 0===t||null===(l=t.drivers)||void 0===l?void 0:l.map(e=>{var t,l;return{id:e.id,mobile:null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,uuid:null===(l=e.owner)||void 0===l?void 0:l.uuid}})),console.log("Socket driverId example:",Object.keys(a)[0]))},[R,a]),n.useEffect(()=>{const e=()=>{I(window.innerWidth<=768),window.innerWidth<=768?C(!1):C(!0)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]);const M=n.useMemo(()=>d.io("https://dev-djb.nitcon.in",{path:"/driver-tanker-tracker-service/socket.io",transports:["websocket"],autoConnect:!1}),[]);n.useEffect(()=>(M.connect(),M.on("connect",()=>{console.log("Admin connected:",M.id),c(!0),M.emit("admin-join")}),M.on("disconnect",()=>{console.log("Admin disconnected"),c(!1)}),M.on("drivers-snapshot",e=>{if(console.log("drivers-snapshot",e),!Array.isArray(e))return;const t={};e.forEach(e=>{e&&e.driverId&&(t[e.driverId]={...e,lastUpdate:(new Date).toISOString()})}),r(t)}),M.on("driver-location-update",e=>{console.log("driver-location-update",e),e&&e.driverId&&r(t=>{const l=t[e.driverId]||{};return{...t,[e.driverId]:{...l,...e,lastUpdate:(new Date).toISOString()}}})}),M.on("driver-status",e=>{console.log("driver-status",e),e&&e.driverId&&r(t=>({...t,[e.driverId]:{...t[e.driverId],...e,lastUpdate:(new Date).toISOString()}}))}),()=>{M.disconnect()}),[M]),n.useEffect(()=>{null!=m&&m.lat&&null!=m&&m.lng&&(T([m.lat,m.lng]),y(15))},[m]);const F=Object.values(a).filter(e=>{const t=e.driverId.toLowerCase().includes(p.toLowerCase()),l="all"===f||"online"===f&&e.isOnline||"offline"===f&&!e.isOnline,n=!D||!(!R||!R.length)&&R.some(t=>{var l,n;return(null==t||null===(l=t.fillingPoint)||void 0===l?void 0:l.id)===(null==D?void 0:D.id)&&(null===(n=t.drivers)||void 0===n?void 0:n.some(t=>{var l,n,i,o;return(null===(l=t.owner)||void 0===l?void 0:l.mobileNumber)===e.driverId||(null===(n=t.owner)||void 0===n?void 0:n.uuid)===e.driverId||t.id===e.driverId||String(null===(i=t.owner)||void 0===i?void 0:i.mobileNumber)===String(e.driverId)||String(null===(o=t.owner)||void 0===o?void 0:o.uuid)===String(e.driverId)}))}),i=!O||((null===(o=O.drivers)||void 0===o?void 0:o.map(e=>{var t,l,n,i;return[null===(t=e.owner)||void 0===t?void 0:t.mobileNumber,null===(l=e.owner)||void 0===l?void 0:l.uuid,e.id,String(null===(n=e.owner)||void 0===n?void 0:n.mobileNumber),String(null===(i=e.owner)||void 0===i?void 0:i.uuid)]}).flat().filter(Boolean))||[]).some(t=>e.driverId===t);var o;return t&&l&&n&&i}),B=Object.values(a).filter(e=>e.isOnline).length,U=Object.values(a).filter(e=>!e.isOnline).length,W=Object.values(a).filter(e=>e.isOnline&&e.deliveryLat&&e.deliveryLng).length;return i.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100vh",width:"100%",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, sans-serif",background:"#f0f2f5",padding:"16px",boxSizing:"border-box"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",background:"white",padding:"16px 24px",borderRadius:"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"2px solid #1F5FA844"}},i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},i.createElement("h1",{style:{margin:0,fontSize:"24px",fontWeight:"700",color:"#0d47a1"}},e("WT_LIVE_DRIVER_TRACKING")),i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",background:"#e8f5e9",color:"#2e7d32",padding:"4px 12px",borderRadius:"20px",fontSize:"12px",fontWeight:"700",border:"1px solid #c8e6c9"}},i.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:u?"#4caf50":"#f44336",boxShadow:u?"0 0 8px #4caf50":"none"}}),u?"CONNECTED":"DISCONNECTED")),i.createElement("p",{style:{margin:"4px 0 0 0",fontSize:"14px",color:"#666"}},e("REAL_TIME_TELEMETRY_AND_FLEET_COORDINATION"))),i.createElement("div",{style:{display:"flex",gap:"12px"}},[{label:e("TOTAL_FLEET"),value:Object.keys(a).length,color:"#0d47a1"},{label:e("ONLINE"),value:B,color:"#2e7d32"},{label:e("OFFLINE"),value:U,color:"#c62828"},{label:e("ACTIVE"),value:W,color:"#0d47a1"}].map((e,t)=>i.createElement("div",{key:t,style:{background:"#f8f9fa",padding:"8px 16px",borderRadius:"8px",minWidth:"100px",display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"}},i.createElement("div",{style:{fontSize:"10px",fontWeight:"600",color:"#888",marginBottom:"4px"}},e.label),i.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:e.color}},e.value))))),i.createElement("div",{style:{display:"flex",flex:1,gap:"16px",overflow:"hidden"}},A&&i.createElement("button",{onClick:()=>{C(!N)},style:{position:"absolute",top:"80px",left:"20px",zIndex:2e3,background:"#1F5FA8",color:"white",border:"none",borderRadius:"8px",padding:"8px 12px",fontSize:"12px",cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"}},N?"Close":"Menu"),i.createElement("div",{style:{width:A?N?"100%":"0":"360px",height:"100%",display:"flex",flexDirection:"column",background:"transparent",position:A?"absolute":"relative",top:0,left:0,zIndex:1500,transition:"all 0.3s ease-in-out",...A&&!N&&{width:"0",opacity:0,pointerEvents:"none"}}},N&&i.createElement(i.Fragment,null,i.createElement("div",{style:{padding:"20px",background:"white",borderRadius:"12px",display:"flex",flexDirection:"column",height:"100%",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"}},i.createElement("h3",{style:{margin:0,fontSize:"14px",fontWeight:"700",color:"#888",letterSpacing:"1px"}},e("WT_FILTER_FLEET")),i.createElement("button",{onClick:()=>{x(null),L(null),E(""),g("all")},style:{background:"none",border:"none",color:"#1F5FA8",fontSize:"12px",fontWeight:"700",cursor:"pointer"}},e("WT_RESET_ALL"))),i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginBottom:"20px"}},i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},i.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_FILLING_POINT")),i.createElement(l.Dropdown,{t:e,option:P,optionKey:"fillingPointName",select:e=>{x(e),L(null)},selected:D,placeholder:e("WT_SELECT_FILLING_POINT"),style:{width:"100%",margin:0}})),i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},i.createElement("label",{style:{fontSize:"12px",fontWeight:"700",color:"#888"}},e("WT_SELECT_VENDOR")),i.createElement(l.Dropdown,{t:e,option:k,optionKey:"name",select:L,selected:O,placeholder:e("WT_SELECT_VENDOR"),style:{width:"100%",margin:0}})),i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},i.createElement("label",{style:{fontSize:"10px",fontWeight:"700",color:"#888"}},e("WT_SEARCH_DRIVER_BY_ID")),i.createElement("div",{style:{position:"relative"}},i.createElement("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},"🔍"),i.createElement("input",{type:"text",placeholder:e("WT_SEARCH_DRIVER_BY_ID"),value:p,onChange:e=>E(e.target.value),style:{width:"100%",padding:"10px 10px 10px 36px",border:"1px solid #e0e0e0",borderRadius:"8px",fontSize:"12px",outline:"none",background:"#f8f9fa",boxSizing:"border-box"}})))),i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"}},i.createElement("div",{style:{display:"flex",gap:"8px"}},["all","online","offline"].map(e=>i.createElement("button",{key:e,onClick:()=>g(e),style:{padding:"4px 12px",borderRadius:"4px",background:f===e?"#1F5FA8":"transparent",color:f===e?"white":"#666",border:f===e?"none":"1px solid #e0e0e0",cursor:"pointer",fontSize:"12px",fontWeight:"600",textTransform:"capitalize"}},e))),i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},i.createElement("input",{type:"checkbox",id:"showRoutes",checked:_,onChange:e=>h(e.target.checked),style:{cursor:"pointer"}}),i.createElement("label",{htmlFor:"showRoutes",style:{fontSize:"12px",color:"#666",cursor:"pointer"}},"Routes"))),i.createElement("div",{style:{flex:1,overflowY:"auto",padding:"4px",marginTop:"8px",display:"flex",flexDirection:"column",gap:"12px"}},0===F.length?i.createElement("div",{style:{textAlign:"center",padding:"40px 20px",color:"#999"}},i.createElement("p",null,e("WT_NO_DRIVERS_FOUND"))):F.map(e=>i.createElement(pe,{key:e.driverId,driver:e,isSelected:(null==m?void 0:m.driverId)===e.driverId,vendorList:R,onClick:()=>{v(e),A&&C(!1)}})))))),i.createElement("div",{style:{flex:1,position:"relative",background:"white",borderRadius:"12px",overflow:"hidden",boxShadow:"0 2px 8px rgba(0,0,0,0.05)",border:"1px solid #e0e0e0"}},i.createElement(s.MapContainer,{center:S,zoom:b,style:{height:"100%",width:"100%"},zoomControl:!1},i.createElement(s.TileLayer,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}),i.createElement(se,{selectedDriver:m,mapZoom:b,mapCenter:S}),F.filter(e=>e.driverId!==(null==m?void 0:m.driverId)).map(e=>i.createElement(s.Marker,{key:e.driverId,position:[Number(e.lat),Number(e.lng)],icon:e.isOnline?ae:re,eventHandlers:{click:()=>{v(e)}}})),m&&null!=m.lat&&null!=m.lng&&i.createElement(s.Marker,{key:m.driverId,position:[Number(m.lat),Number(m.lng)],icon:m.isOnline?ae:re},i.createElement(s.Popup,null,i.createElement("div",{style:{minWidth:A?"200px":"250px",padding:"8px"}},i.createElement("div",{style:{fontWeight:"bold",fontSize:A?"14px":"16px",color:"#1F5FA8",marginBottom:"8px",borderBottom:"1px solid #eee",paddingBottom:"4px"}},"Driver #",m.driverId.substring(0,8),"... (Selected)"),i.createElement("div",{style:{marginBottom:"8px"}},i.createElement(ve,{isOnline:m.isOnline})),i.createElement("div",{style:{fontSize:A?"12px":"13px"}},i.createElement("div",{style:{marginBottom:"8px"}},i.createElement("strong",null,"Current Location"),i.createElement("div",null,i.createElement(de,{lat:m.lat,lng:m.lng}))),m.deliveryLat&&m.deliveryLng&&i.createElement("div",{style:{marginBottom:"8px"}},i.createElement("strong",null,e("DELIVERY_DESTINATION")),i.createElement("div",null,i.createElement(de,{lat:m.deliveryLat,lng:m.deliveryLng}))),i.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",background:"#f5f5f5",padding:"8px",borderRadius:"4px",marginTop:"8px"}},m.speed&&i.createElement(i.Fragment,null,i.createElement("span",null,e("WT_SPEED"),":"),i.createElement("span",null,(3.6*m.speed).toFixed(1)," ",e("WT_KM_PER_HOUR"))),m.heading&&i.createElement(i.Fragment,null,i.createElement("span",null,e("WT_HEADING"),":"),i.createElement("span",null,Math.round(m.heading),"°")),m.accuracy&&i.createElement(i.Fragment,null,i.createElement("span",null,e("WT_ACCURACY"),":"),i.createElement("span",null,Math.round(m.accuracy),"m"))),m.lastUpdate&&i.createElement("div",{style:{marginTop:"8px",color:"#666",fontSize:"10px"}},e("WT_LAST_UPDATE"),": ",new Date(m.lastUpdate).toLocaleString()))))),m&&null!=m.deliveryLat&&null!=m.deliveryLng&&i.createElement(s.Marker,{key:"dest-"+m.driverId,position:[Number(m.deliveryLat),Number(m.deliveryLng)],icon:ue}),_&&m&&m.lat&&m.lng&&m.deliveryLat&&m.deliveryLng&&i.createElement(ce,{start:{lat:m.lat,lng:m.lng},end:{lat:m.deliveryLat,lng:m.deliveryLng},color:"#2196f3",weight:6})),i.createElement("div",{style:{position:"absolute",top:A?"60px":"20px",right:"10px",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",padding:"4px",display:"flex",flexDirection:A?"column":"row",gap:"4px"}},m&&i.createElement(i.Fragment,null,i.createElement("button",{onClick:()=>{if(null!=m&&m.lat&&null!=m&&m.lng){const e=[Number(m.lat),Number(m.lng)];T(e),y(15)}},style:{padding:A?"10px 12px":"8px 16px",background:"#1F5FA8",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:A?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CENTER")),i.createElement("button",{onClick:()=>v(null),style:{padding:A?"10px 12px":"8px 16px",background:"#f44336",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:A?"12px":"14px",fontWeight:"500",whiteSpace:"nowrap"}},e("WT_CLEAR"))),!m&&i.createElement("div",{style:{padding:A?"10px 12px":"8px 16px",background:"#f5f5f5",color:"#666",borderRadius:"4px",fontSize:A?"12px":"14px"}},A?"Select driver":"Select a driver from the list")),m&&i.createElement("div",{style:{position:"absolute",bottom:A?"10px":"20px",left:A?"10px":"20px",right:A?"10px":"auto",zIndex:1e3,background:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:A?"12px":"16px",maxWidth:A?"calc(100% - 20px)":"300px",border:"2px solid #2196f3"}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"}},i.createElement("h4",{style:{margin:0,color:"#1F5FA8",fontSize:A?"14px":"16px"}},e("WT_SELECTED_DRIVER")),i.createElement(ve,{isOnline:m.isOnline})),i.createElement("div",{style:{fontSize:A?"12px":"13px"}},i.createElement("div",null,i.createElement("strong",null,e("WT_ID"),":")," ",m.driverId.substring(0,6).toUpperCase(),"..."),i.createElement("div",null,i.createElement("strong",null,e("WT_LOCATION"),":")," ",i.createElement(de,{lat:m.lat,lng:m.lng})),m.speed&&i.createElement("div",null,i.createElement("strong",null,e("WT_SPEED"),":")," ",Math.round(3.6*m.speed)," ",e("km/h")),m.lastSeen&&i.createElement("div",null,i.createElement("strong",null,e("WT_LAST_SEEN"),":")," ",new Date(m.lastSeen).toLocaleTimeString()))),i.createElement("div",{style:{position:"absolute",top:"20px",left:"20px",zIndex:1e3,display:"flex",flexDirection:"column",gap:"8px"}},i.createElement("button",{onClick:()=>y(e=>e+1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"+"),i.createElement("button",{onClick:()=>y(e=>e-1),style:{width:"32px",height:"32px",background:"white",border:"1px solid #e0e0e0",borderRadius:"4px",fontSize:"18px",fontWeight:"700",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},"−")),i.createElement("div",{style:{position:"absolute",top:"20px",right:"20px",zIndex:1e3,display:"flex",gap:"12px"}}))))}const fe=e=>{let{t:t,formData:n={},onSelect:o,config:a={},visibleFields:r=[]}=e;const u=(null==a?void 0:a.key)||"metaData",d=[{label:"WT_FILLING_POINT_NAME",name:"fillingPointName",isMandatory:!0},{label:"WT_AE_NAME",name:"aeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_AE_MOBILE_NUMBER",name:"aeMobile",isMandatory:!0,componentInFront:i.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_AE_EMAIL_ID",name:"aeEmail",isMandatory:!0,validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_JE_NAME",name:"jeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_JE_MOBILE_NUMBER",name:"jeMobile",isMandatory:!0,componentInFront:i.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_JE_EMAIL_ID",name:"jeEmail",isMandatory:!0,validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}},{label:"WT_EE_NAME",name:"eeName",isMandatory:!0,validation:{pattern:"^[a-zA-Z]+( [a-zA-Z]+)*$"}},{label:"WT_EE_MOBILE_NUMBER",name:"eeMobile",isMandatory:!0,componentInFront:i.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),validation:{pattern:"[6-9]{1}[0-9]{9}",type:"tel",maxLength:10}},{label:"WT_EE_EMAIL_ID",name:"eeEmail",isMandatory:!0,validation:{pattern:"^[a-zA-Z0-9._%+-]+@[a-z.-]+\\.(com|org|in)$"}}],s=r&&r.length>0?d.filter(e=>r.includes(e.name)):d;return i.createElement(l.CollapsibleCardPage,{title:t("WT_FILLING_POINT_APPLICANT_DETAILS"),defaultOpen:!0},i.createElement("div",{className:"formcomposer-section-grid"},s.map(e=>{var a,r;return i.createElement("div",{key:e.name},i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,{className:"card-label-smaller"},t(e.label),e.isMandatory?" *":""),i.createElement("div",{style:{display:"flex"}},e.componentInFront||null,i.createElement(l.TextInput,p({value:(null==n||null===(a=n[u])||void 0===a?void 0:a[e.name])||"",onChange:t=>((e,t)=>{if(!o)return;let l=e;["aeMobile","jeMobile","eeMobile","alternateNumber"].includes(t)&&(l=e.slice(0,10).replace(/[^0-9]/g,"")),o(u,{...null==n?void 0:n[u],[t]:l})})(t.target.value,e.name),maxLength:null===(r=e.validation)||void 0===r?void 0:r.maxLength},e.validation)))))})))},ge=[{name:"Correspondence",code:"CORRESPONDENCE",i18nKey:"COMMON_ADDRESS_TYPE_CORRESPONDENCE"},{name:"Permanent",code:"PERMANENT",i18nKey:"COMMON_ADDRESS_TYPE_PERMANENT"},{name:"Other",code:"OTHER",i18nKey:"COMMON_ADDRESS_TYPE_OTHER"}],_e=e=>{var t,o,r,u,d,s,c,m,v,p,E,f,g,_,h;let{t:S,config:T,formData:b,onSelect:y,isEdit:N,userDetails:C}=e;const{data:A}=Digit.Hooks.useTenants(),I=a.useLocation(),D=Digit.ULBService.getCurrentTenantId(),x=(null===(t=I.state)||void 0===t?void 0:t.usedAddressTypes)||[],[O,L]=n.useState((null==b||null===(o=b.address)||void 0===o?void 0:o.pincode)||""),[w,P]=n.useState((null==b||null===(r=b.address)||void 0===r?void 0:r.city)||null),[R,k]=n.useState((null==b||null===(u=b.address)||void 0===u?void 0:u.locality)||null),[M,F]=n.useState((null==b||null===(d=b.address)||void 0===d?void 0:d.houseNo)||""),[B,U]=n.useState((null==b||null===(s=b.address)||void 0===s?void 0:s.streetName)||""),[W,H]=n.useState((null==b||null===(c=b.address)||void 0===c?void 0:c.landmark)||""),[j,z]=n.useState((null==b||null===(m=b.address)||void 0===m?void 0:m.addressLine1)||""),[V,G]=n.useState((null==b||null===(v=b.address)||void 0===v?void 0:v.addressLine2)||""),[K,Y]=n.useState((null==b||null===(p=b.address)||void 0===p?void 0:p.addressType)||null),[$,q]=n.useState((null==b||null===(E=b.address)||void 0===E?void 0:E.zone)||""),[X,Q]=n.useState((null==b||null===(f=b.address)||void 0===f?void 0:f.block)||""),[Z,J]=n.useState((null==b||null===(g=b.address)||void 0===g?void 0:g.latitude)||""),[ee,te]=n.useState((null==b||null===(_=b.address)||void 0===_?void 0:_.longitude)||""),[le,ne]=n.useState(""),ie=n.useRef(!N),oe=n.useRef(null),ae=n.useRef(null),re=n.useMemo(()=>ge.filter(3===x.length?e=>"OTHER"===e.code:e=>!x.includes(e.code)),[x]),{data:ue}=Digit.Hooks.useCommonMDMS(D,"egov-location",["TenantBoundary"]);n.useEffect(()=>{if(!w&&A&&A.length>0){const e=A.find(e=>e.code===D)||A[0];P(e)}},[A,w,D]);const de=n.useMemo(()=>{var e;const t=((null==ue||null===(e=ue["egov-location"])||void 0===e?void 0:e.TenantBoundary)||[]).find(e=>{var t;return"REVENUE"===(null==e||null===(t=e.hierarchyType)||void 0===t?void 0:t.code)}),l=(null==t?void 0:t.boundary)||[];return Array.isArray(l)?l:[l]},[ue]),se=n.useMemo(()=>{let e=[];const t=Array.isArray(de)?de:de?[de]:[],l=function(t,n,i){if(void 0===n&&(n=null),void 0===i&&(i=null),!t)return;let o=n,a=i;"Zone"!==t.label&&"ZONE"!==t.label||(o=t.localname||t.code||t.name),"Ward"!==t.label&&"WARD"!==t.label&&"Block"!==t.label&&"BLOCK"!==t.label||(a=t.code||t.localname||t.name),"Locality"!==t.label&&"LOCALITY"!==t.label||e.push({...t,name:t.localname||t.name||t.code,i18nkey:t.i18nkey||`${D.replace(".","_")}_REVENUE_${t.code}`.toUpperCase(),zone:o,ward:a}),t.children&&t.children.length>0&&t.children.forEach(e=>l(e,o,a))};return t.forEach(e=>l(e)),e},[de,D]),ce=n.useMemo(()=>{const e=new Set;return se.forEach(t=>{t.pincode&&(Array.isArray(t.pincode)?t.pincode:[t.pincode]).forEach(t=>{if(t){const l=t.toString().split(".")[0];e.add(l)}})}),0===e.size&&null!=w&&w.pincode&&(Array.isArray(w.pincode)?w.pincode:[w.pincode]).forEach(t=>{if(t){const l=t.toString().split(".")[0];e.add(l)}}),Array.from(e).sort().map(e=>({code:e,name:e,i18nKey:e}))},[se,w]),me=n.useMemo(()=>O?se.filter(e=>!!e.pincode&&(Array.isArray(e.pincode)?e.pincode:[e.pincode]).some(e=>e.toString()===O)):se,[se,O]);return n.useEffect(()=>{var e;const t=(null==b?void 0:b.id)||(null==b?void 0:b.bookingId)||(null==b||null===(e=b.address)||void 0===e?void 0:e.id);if(t&&ae.current!==t&&(ie.current=!1,ae.current=t),null!=b&&b.address&&!ie.current&&A){var l;const e=b.address,t=A.find(t=>t.code===e.cityCode||t.code===e.city||t.name===e.city)||e.city;if(t&&(!w||w.code!==t.code&&w!==t)&&P(t||null),L((null===(l=e.pincode)||void 0===l?void 0:l.toString().split(".")[0])||""),F(e.houseNo||""),U(e.streetName||""),H(e.landmark||""),z(e.addressLine1||""),G(e.addressLine2||""),Y(ge.find(t=>t.code===e.addressType)||e.addressType||null),q(e.zone||""),Q(e.block||""),J(e.latitude||""),te(e.longitude||""),de||!e.cityCode){if(Array.isArray(de)){const t=de.find(t=>t.code===e.localityCode||t.code===e.locality||t.i18nkey===e.locality);k(t||e.locality||null)}else k(!de||"object"!=typeof de||de.code!==e.localityCode&&de.code!==e.locality&&de.i18nkey!==e.locality?e.locality||null:de);ie.current=!0,oe.current=JSON.stringify(e)}}},[null==b?void 0:b.address,w,A,de]),n.useEffect(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{J(e.coords.latitude),te(e.coords.longitude)},()=>{})},[]),n.useEffect(()=>{le&&Object.keys(le).length&&(L(le.pinCode),P(null==A?void 0:A.find(e=>e.name===le.city)),k(Array.isArray(de)?de.find(e=>e.i18nkey===le.locality):null),F(le.houseNumber),U(le.streetName),H(le.landmark),z(le.address),G(le.address2),q(le.zone),Q(le.block),J(le.latitude),te(le.longitude),Y(ge.find(e=>e.code===le.addressType)))},[le]),n.useEffect(()=>{if(!y||!ie.current)return;const e={pincode:O||"",city:(null==w?void 0:w.code)||w||null,locality:(null==R?void 0:R.code)||R||null,houseNo:M||"",landmark:W||"",addressLine1:j||"",addressLine2:V||"",streetName:B||"",addressType:(null==K?void 0:K.code)||K||null,zone:$||"",block:X||"",latitude:Z||"",longitude:ee||""},t=JSON.stringify(e);oe.current!==t&&(oe.current=t,y((null==T?void 0:T.key)||"address",e))},[O,w,R,M,W,j,V,B,K,$,X,Z,ee]),i.createElement(l.CollapsibleCardPage,{title:S("WT_ADDRESS_DETAILS"),defaultOpen:!0},i.createElement("div",{className:"formcomposer-section-grid"},(null==C||null===(h=C.addresses)||void 0===h?void 0:h.length)>0&&i.createElement("div",null,i.createElement(l.CardLabel,null,S("COMMON_ADDRESS_TYPE")),i.createElement(l.Dropdown,{selected:le,select:ne,option:C.addresses||[],optionKey:"address",t:S,style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("COMMON_ADDRESS_TYPE")),i.createElement(l.Dropdown,{selected:K,select:Y,option:re||[],optionKey:"i18nKey",t:S,style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("CITY")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{selected:w,select:P,option:A||[],optionKey:"i18nKey",t:S,disable:!0})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("PINCODE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{selected:(null==ce?void 0:ce.find(e=>e.code===O))||(O?{code:O,name:O,i18nKey:O}:null),select:e=>{const t=null==e?void 0:e.code;t!==O&&(k(null),q(""),Q(""),J(""),te(""),z(""),G("")),L(t)},option:ce||[],optionKey:"i18nKey",t:S,style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("LOCALITY")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{selected:R,select:e=>{if(k(e),null!=e&&e.latitude&&J(e.latitude),null!=e&&e.longitude&&te(e.longitude),null!=e&&e.localname&&z(e.localname),null!=e&&e.name&&G(e.name),null!=e&&e.zone&&q(e.zone),null!=e&&e.ward&&Q(e.ward),null!=e&&e.pincode){const t=Array.isArray(e.pincode)?e.pincode[0]:e.pincode;if(t){const e=t.toString().split(".")[0];L(e)}}},option:me,optionKey:"i18nkey",t:S,style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("HOUSE_NO"),i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:M,onChange:e=>F(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("STREET_NAME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:B,onChange:e=>U(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("ADDRESS_LINE1")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:j,onChange:e=>z(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("ADDRESS_LINE2")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:V,onChange:e=>G(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("BLOCK")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:X,onChange:e=>Q(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("ZONE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:$,onChange:e=>q(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("LATITUDE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:Z,onChange:e=>J(e.target.value),style:{width:"100%"}})),i.createElement("div",null,i.createElement(l.CardLabel,null,S("LONGITUDE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{value:ee,onChange:e=>te(e.target.value),style:{width:"100%"}})),i.createElement("div",{style:{gridColumn:"span 2"}},i.createElement(l.CardLabel,null,S("LANDMARK")),i.createElement(l.TextInput,{value:W,onChange:e=>H(e.target.value),style:{width:"100%"}}))))},he=()=>{var e,t,r,u,d,s,c,m,p,E,f,g,_,h,S,T,b,y;const{t:N}=o.useTranslation(),C=a.useLocation(),A=a.useHistory(),I=new URLSearchParams(C.search).get("id"),[D,x]=n.useState({}),[O,L]=n.useState(null),w=Digit.ULBService.getCurrentTenantId(),{isLoading:P,data:R}=Digit.Hooks.wt.useFillPointSearch({tenantId:w,filters:{id:I}},{enabled:!!I});n.useEffect(()=>{if(I&&null!=R&&R.fillingPoints){const e=R.fillingPoints.find(e=>e.id===I);e&&x({id:e.id,tenantId:e.tenantId,owner:{fillingPointName:e.fillingPointName,emergencyName:e.emergencyName,aeName:e.aeName,aeMobile:e.aeMobile,aeEmail:e.aeEmail,jeName:e.jeName,jeMobile:e.jeMobile,jeEmail:e.jeEmail,eeName:e.eeName,eeMobile:e.eeMobile,eeEmail:e.eeEmail},address:{...e.address}})}},[R,I]);const{mutate:k}=Digit.Hooks.wt.useCreateFillPoint(w),{mutate:M}=Digit.Hooks.wt.useUpdateFillPoint(w),F=window.Digit.Utils.browser.isMobile(),B=!(null!=D&&null!==(e=D.owner)&&void 0!==e&&e.aeName&&null!=D&&null!==(t=D.owner)&&void 0!==t&&t.aeMobile&&null!=D&&null!==(r=D.owner)&&void 0!==r&&r.aeEmail&&null!=D&&null!==(u=D.owner)&&void 0!==u&&u.jeName&&null!=D&&null!==(d=D.owner)&&void 0!==d&&d.jeMobile&&null!=D&&null!==(s=D.owner)&&void 0!==s&&s.jeEmail&&null!=D&&null!==(c=D.owner)&&void 0!==c&&c.eeName&&null!=D&&null!==(m=D.owner)&&void 0!==m&&m.eeMobile&&null!=D&&null!==(p=D.owner)&&void 0!==p&&p.eeEmail&&null!=D&&null!==(E=D.address)&&void 0!==E&&E.houseNo&&null!=D&&null!==(f=D.address)&&void 0!==f&&f.streetName&&null!=D&&null!==(g=D.address)&&void 0!==g&&g.addressLine1&&null!=D&&null!==(_=D.address)&&void 0!==_&&_.addressLine2&&null!=D&&null!==(h=D.address)&&void 0!==h&&h.city&&null!=D&&null!==(S=D.address)&&void 0!==S&&S.locality&&null!=D&&null!==(T=D.address)&&void 0!==T&&T.latitude&&null!=D&&null!==(b=D.address)&&void 0!==b&&b.longitude&&null!=D&&null!==(y=D.address)&&void 0!==y&&y.pincode);return P?i.createElement(l.Loader,null):i.createElement("div",{className:"employee-form-section-wrapper"},i.createElement(v,{config:[{timeLine:[{actions:"Add Filling Point",currentStep:1}]}],showFinalStep:!1}),i.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},i.createElement(fe,{t:N,config:{key:"owner"},onSelect:(e,t)=>{x(l=>({...l,[e]:t}))},formData:D,visibleFields:["fillingPointName","emergencyName","aeName","aeMobile","aeEmail","jeName","jeMobile","jeEmail","eeName","eeMobile","eeEmail"]}),i.createElement(_e,{t:N,config:{key:"address"},onSelect:(e,t)=>{x(l=>({...l,[e]:{...l[e]||{},...t}}))},formData:D,isEdit:!!I}),i.createElement("div",{style:{display:"flex",marginBottom:"24px",justifyContent:F?"center":"flex-end"}},i.createElement(l.SubmitBar,{label:N(I?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{e&&e.preventDefault&&e.preventDefault();const t=(l={...D,tenantId:w},{RequestInfo:{userInfo:{uuid:(null===(n=Digit.UserService.getUser())||void 0===n||null===(i=n.info)||void 0===i?void 0:i.uuid)||"user-123"}},fillingPoints:[{id:null==l?void 0:l.id,bookingId:null==l?void 0:l.bookingId,tenantId:null==l?void 0:l.tenantId,fillingPointName:null==l||null===(o=l.owner)||void 0===o?void 0:o.fillingPointName,emergencyName:null==l||null===(a=l.owner)||void 0===a?void 0:a.emergencyName,eeName:null==l||null===(r=l.owner)||void 0===r?void 0:r.eeName,eeEmail:null==l||null===(u=l.owner)||void 0===u?void 0:u.eeEmail,eeMobile:null==l||null===(d=l.owner)||void 0===d?void 0:d.eeMobile,aeName:null==l||null===(s=l.owner)||void 0===s?void 0:s.aeName,aeEmail:null==l||null===(c=l.owner)||void 0===c?void 0:c.aeEmail,aeMobile:null==l||null===(m=l.owner)||void 0===m?void 0:m.aeMobile,jeName:null==l||null===(v=l.owner)||void 0===v?void 0:v.jeName,jeEmail:null==l||null===(p=l.owner)||void 0===p?void 0:p.jeEmail,jeMobile:null==l||null===(E=l.owner)||void 0===E?void 0:E.jeMobile,address:{houseNo:null==l||null===(f=l.address)||void 0===f?void 0:f.houseNo,streetName:null==l||null===(g=l.address)||void 0===g?void 0:g.streetName,addressLine1:null==l||null===(_=l.address)||void 0===_?void 0:_.addressLine1,addressLine2:null==l||null===(h=l.address)||void 0===h?void 0:h.addressLine2,landmark:null==l||null===(S=l.address)||void 0===S?void 0:S.landmark,city:(null==l||null===(T=l.address)||void 0===T||null===(b=T.city)||void 0===b?void 0:b.name)||(null==l||null===(y=l.address)||void 0===y?void 0:y.city)||"",cityCode:(null==l||null===(C=l.address)||void 0===C?void 0:C.cityCode)||(null==l||null===(x=l.address)||void 0===x||null===(O=x.city)||void 0===O?void 0:O.code)||"",locality:(null==l||null===(P=l.address)||void 0===P?void 0:P.localityCode)||(null==l||null===(R=l.address)||void 0===R||null===(F=R.locality)||void 0===F?void 0:F.code)||"",localityCode:(null==l||null===(B=l.address)||void 0===B?void 0:B.localityCode)||(null==l||null===(U=l.address)||void 0===U||null===(W=U.locality)||void 0===W?void 0:W.code)||"",pincode:null==l||null===(H=l.address)||void 0===H?void 0:H.pincode,latitude:null==l||null===(j=l.address)||void 0===j?void 0:j.latitude,longitude:null==l||null===(z=l.address)||void 0===z?void 0:z.longitude,type:"FILLING-POINT"}}]});var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,C,x,O,P,R,F,B,U,W,H,j,z;(I?M:k)(t,{onSuccess:()=>{L({label:N(I?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),setTimeout(()=>{L(null),A.push("/digit-ui/employee/wt/search-filling-fix-point")},3e3)},onError:e=>{var t,l,n,i;L({label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||N(I?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR"),isError:!0}),setTimeout(()=>L(null),5e3)}})},disabled:B}))),O&&i.createElement(l.Toast,{error:O.isError,label:O.label,onClose:()=>L(null)}))},Se=()=>{var e,t,u,d,s,c,m,p,E,f,g,_,h,S,T,b;const{t:y}=o.useTranslation(),N=a.useLocation(),C=a.useHistory(),A=r.useQueryClient(),I=new URLSearchParams(N.search).get("id"),[D,x]=n.useState({}),[O,L]=n.useState(null),w=Digit.ULBService.getCurrentTenantId(),P=i.useMemo(()=>({tenantId:w,filters:{id:I}}),[w,I]),R=i.useMemo(()=>({enabled:!!I}),[I]),{isLoading:k,data:M}=Digit.Hooks.wt.useFixedPointSearchAPI(P,R),[F,B]=n.useState(!1);n.useEffect(()=>{if(I&&null!=M&&M.waterTankerBookingDetail&&!F){const r=M.waterTankerBookingDetail.find(e=>{var t;return(null===(t=e.applicantDetail)||void 0===t?void 0:t.applicantId)===I});var e,t,l,n,i,o,a;r&&(x({owner:{name:null===(e=r.applicantDetail)||void 0===e?void 0:e.name,mobileNumber:null===(t=r.applicantDetail)||void 0===t?void 0:t.mobileNumber,alternateNumber:null===(l=r.applicantDetail)||void 0===l?void 0:l.alternateNumber,emailId:null===(n=r.applicantDetail)||void 0===n?void 0:n.emailId,applicantId:null===(i=r.applicantDetail)||void 0===i?void 0:i.applicantId},address:{...r.address,addressId:null===(o=r.address)||void 0===o?void 0:o.addressId,applicantId:null===(a=r.address)||void 0===a?void 0:a.applicantId},bookingId:r.bookingId,bookingNo:r.bookingNo,auditDetails:r.auditDetails}),B(!0))}},[M,I,F]);const U=i.useMemo(()=>({key:"address"}),[]),W=i.useCallback((e,t)=>{x(l=>({...l,[e]:{...l[e]||{},...t}}))},[]),{mutate:H}=Digit.Hooks.wt.useCreateFixedPoint(w),{mutate:j}=Digit.Hooks.wt.useUpdateFixedPoint(w),z=window.Digit.Utils.browser.isMobile(),V=!(null!=D&&null!==(e=D.owner)&&void 0!==e&&e.name&&null!=D&&null!==(t=D.owner)&&void 0!==t&&t.mobileNumber&&null!=D&&null!==(u=D.owner)&&void 0!==u&&u.emailId&&null!=D&&null!==(d=D.address)&&void 0!==d&&d.houseNo&&null!=D&&null!==(s=D.address)&&void 0!==s&&s.streetName&&null!=D&&null!==(c=D.address)&&void 0!==c&&c.addressLine1&&null!=D&&null!==(m=D.address)&&void 0!==m&&m.addressLine2&&null!=D&&null!==(p=D.address)&&void 0!==p&&p.city&&null!=D&&null!==(E=D.address)&&void 0!==E&&E.locality&&null!=D&&null!==(f=D.address)&&void 0!==f&&f.latitude&&null!=D&&null!==(g=D.address)&&void 0!==g&&g.longitude&&null!=D&&null!==(_=D.address)&&void 0!==_&&_.pincode);return k?i.createElement(l.Loader,null):i.createElement("div",{className:"employee-form-section-wrapper"},i.createElement(v,{config:[{timeLine:[{actions:"Add Fixed Point",currentStep:1}]}],showFinalStep:!1}),i.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"16px"}},i.createElement(l.CollapsibleCardPage,{title:y("WT_FIXING_POINT_APPLICANT_DETAILS"),defaultOpen:!0},i.createElement("div",{className:"formcomposer-section-grid"},i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("WT_FIXING_POINT_APPLICANT_DETAILS")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:y,type:"text",name:"name",value:null==D||null===(h=D.owner)||void 0===h?void 0:h.name,style:{width:"100%"},onChange:e=>W("owner",{name:e.target.value})})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("COMMON_MOBILE_NUMBER")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.MobileNumber,{value:null==D||null===(S=D.owner)||void 0===S?void 0:S.mobileNumber,name:"mobileNumber",onChange:e=>W("owner",{mobileNumber:e}),style:{width:"100%"}})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("COMMON_EMAIL_ID")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:y,type:"email",name:"emailId",value:null==D||null===(T=D.owner)||void 0===T?void 0:T.emailId,style:{width:"100%"},onChange:e=>W("owner",{emailId:e.target.value})})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,""+y("COMMON_ALT_MOBILE_NUMBER")),i.createElement(l.MobileNumber,{value:null==D||null===(b=D.owner)||void 0===b?void 0:b.alternateNumber,name:"alternateNumber",onChange:e=>W("owner",{alternateNumber:e}),style:{width:"100%"}})))),i.createElement("div",null,i.createElement(_e,{t:y,config:U,onSelect:W,formData:D,isEdit:!!I})),i.createElement("div",{style:{display:"flex",justifyContent:z?"center":"flex-end"}},i.createElement(l.SubmitBar,{label:y(I?"ES_COMMON_UPDATE":"ES_COMMON_SAVE"),onSubmit:e=>{const t={waterTankerBookingDetail:{bookingId:(null==(l={...D,tenantId:w})?void 0:l.bookingId)||"",bookingNo:(null==l?void 0:l.bookingNo)||null,tenantId:null==l?void 0:l.tenantId,mobileNumber:(null==l||null===(n=l.owner)||void 0===n?void 0:n.mobileNumber)||"",applicantDetail:{applicantId:(null==l||null===(i=l.owner)||void 0===i?void 0:i.applicantId)||null,bookingId:(null==l?void 0:l.bookingId)||"",name:(null==l||null===(o=l.owner)||void 0===o?void 0:o.name)||(null==l||null===(a=l.owner)||void 0===a?void 0:a.applicantName)||"",mobileNumber:(null==l||null===(r=l.owner)||void 0===r?void 0:r.mobileNumber)||"",alternateNumber:(null==l||null===(u=l.owner)||void 0===u?void 0:u.alternateNumber)||"",emailId:(null==l||null===(d=l.owner)||void 0===d?void 0:d.emailId)||"",type:"FIXED-POINT"},address:{addressId:(null==l||null===(s=l.address)||void 0===s?void 0:s.addressId)||null,applicantId:(null==l||null===(c=l.address)||void 0===c?void 0:c.applicantId)||null,houseNo:(null==l||null===(m=l.address)||void 0===m?void 0:m.houseNo)||"",streetName:(null==l||null===(v=l.address)||void 0===v?void 0:v.streetName)||"",addressLine1:(null==l||null===(p=l.address)||void 0===p?void 0:p.addressLine1)||"",addressLine2:(null==l||null===(E=l.address)||void 0===E?void 0:E.addressLine2)||"",landmark:(null==l||null===(f=l.address)||void 0===f?void 0:f.landmark)||"",city:(null==l||null===(g=l.address)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name)||(null==l||null===(h=l.address)||void 0===h?void 0:h.city)||"",cityCode:(null==l||null===(S=l.address)||void 0===S?void 0:S.cityCode)||(null==l||null===(T=l.address)||void 0===T||null===(b=T.city)||void 0===b?void 0:b.code)||"DJB",locality:(null==l||null===(N=l.address)||void 0===N||null===(x=N.locality)||void 0===x?void 0:x.label)||(null==l||null===(O=l.address)||void 0===O||null===(P=O.locality)||void 0===P?void 0:P.name)||(null==l||null===(R=l.address)||void 0===R?void 0:R.locality)||"",localityCode:(null==l||null===(k=l.address)||void 0===k||null===(M=k.locality)||void 0===M?void 0:M.code)||(null==l||null===(F=l.address)||void 0===F?void 0:F.localityCode)||"",latitude:(null==l||null===(B=l.address)||void 0===B?void 0:B.latitude)||"",longitude:(null==l||null===(U=l.address)||void 0===U?void 0:U.longitude)||"",pincode:(null==l||null===(W=l.address)||void 0===W?void 0:W.pincode)||"",type:"FIXED-POINT"}}};var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,N,x,O,P,R,k,M,F,B,U,W;(I?j:H)(t,{onSuccess:()=>{L({label:y(I?"WT_FILLING_POINT_UPDATED_SUCCESS":"WT_FILLING_POINT_CREATED_SUCCESS")}),A.invalidateQueries("wtFixedPointSearchList"),setTimeout(()=>{L(null),C.push("/digit-ui/employee/wt/search-filling-fix-point")},3e3)},onError:e=>{var t,l,n,i;L({label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||y(I?"WT_FILLING_POINT_UPDATED_ERROR":"WT_FILLING_POINT_CREATED_ERROR"),isError:!0}),setTimeout(()=>L(null),5e3)}})},disabled:V}))),O&&i.createElement(l.Toast,{error:O.isError,label:O.label,onClose:()=>L(null)}))},Te=e=>{var t,o;let{t:a,closeModal:r,onSubmit:u,initialValues:d,tenantId:s,modalMode:c}=e;const m="VIEW"===c,v="UPDATE"===c,[p,E]=n.useState(null),[f,g]=n.useState([]),{data:_,isLoading:h}=Digit.Hooks.hrms.useHrmsMDMS(s,"egov-location","HRMSRolesandDesignation"),S=n.useMemo(()=>{var e,t;return((null===(e=(null==_?void 0:_.MdmsRes)||_)||void 0===e||null===(t=e["egov-location"])||void 0===t?void 0:t.TenantBoundary)||[]).map(e=>({i18nKey:e.hierarchyType.name||e.hierarchyType.code||e.hierarchyType,code:e.hierarchyType.code||e.hierarchyType,boundary:e.boundary}))},[_]);i.useEffect(()=>{S.length>0&&!p&&E(S[0])},[S,p]);const T=function(e,t){return void 0===t&&(t=[]),e?(("Locality"===e.label||e.children&&0===e.children.length&&e.code)&&t.push({name:e.localname||e.name,code:e.code,i18nKey:e.code}),e.children&&e.children.forEach(e=>T(e,t)),t):t},b=n.useMemo(()=>p&&p.boundary?T(p.boundary):[],[p]);return i.useEffect(()=>{var e,t;if(b.length>0&&0===f.length&&((null==d||null===(e=d.fillingPointLocalityCodes)||void 0===e?void 0:e.length)>0||null!=d&&null!==(t=d.address)&&void 0!==t&&t.locality)&&(m||v)){var l;const e=(null==d||null===(l=d.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?d.fillingPointLocalityCodes:"string"==typeof d.address.locality?d.address.locality.split(",").map(e=>e.trim()):[],t=b.filter(t=>e.some(e=>e===t.code||e.toLowerCase()===(t.name||"").toLowerCase()));t.length>0&&g(t)}},[b,d,m,v,f]),h?i.createElement(l.Loader,null):i.createElement("div",{className:"custom-modal-overlay",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e5}},i.createElement("style",null,"\n .custom-modal-content {\n background-color: #fff;\n border-radius: 8px;\n width: 50%;\n max-width: 600px;\n max-height: 90vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n position: relative;\n }\n @media (max-width: 768px) {\n .custom-modal-content {\n width: 90%;\n }\n }\n "),i.createElement("div",{className:"custom-modal-content"},i.createElement("div",{className:"custom-modal-header",style:{padding:"16px 24px",borderBottom:"1px solid #eee",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.createElement("h1",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1D4E7F"}},a(m?"WT_VIEW_LOCALITY":v?"WT_UPDATE_LOCALITY":"WT_ADD_TO_LOCALITY")),i.createElement("button",{onClick:r,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×")),i.createElement("div",{style:{padding:"24px"}},i.createElement("div",{style:{marginBottom:"16px"}},i.createElement(l.CardLabel,null,a("WT_CURRENT_LOCALITY")),i.createElement("div",{style:{fontWeight:"600",marginBottom:"8px"}},(null==d||null===(t=d.fillingPointLocalityCodes)||void 0===t?void 0:t.length)>0?d.fillingPointLocalityCodes.join(", "):(null==d||null===(o=d.address)||void 0===o?void 0:o.locality)||"NA")),!m&&i.createElement("div",{style:{marginBottom:"16px"}},i.createElement(l.CardLabel,null,a("WT_SELECT_NEW_LOCALITY")),i.createElement(l.MultiSelectDropdown,{options:b,optionsKey:"i18nKey",selected:f,onSelect:e=>{if(!m){const t=e.map(e=>e[1]);g(t)}},t:a,disabled:!p||m}),(null==f?void 0:f.length)>0&&i.createElement("div",{style:{marginTop:"8px",fontSize:"14px",color:"#666"}},i.createElement("strong",null,a("WT_LOCALITY_CODES"),":")," ",f.map(e=>e.code).join(", ")))),i.createElement("div",{className:"custom-modal-footer",style:{padding:"16px 24px",borderTop:"1px solid #eee",display:"flex",justifyContent:"flex-end",gap:"12px"}},i.createElement("button",{onClick:r,style:{padding:"8px 20px",border:"1px solid #ccc",background:"#f4f4f4",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_CANCEL")),!m&&i.createElement("button",{onClick:()=>{u({hierarchyType:p,locality:f})},style:{padding:"8px 20px",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer"}},a("CS_COMMON_SAVE")))))},be=()=>{const{t:e}=o.useTranslation(),t=a.useHistory(),[r,u]=n.useState("FIXED_POINT"),[d,s]=n.useState(!1),[c,m]=n.useState(""),[v,p]=n.useState(""),[E,f]=n.useState(null),[g,_]=n.useState(null),[h,S]=n.useState(null),[T,b]=n.useState({}),[y,N]=n.useState(null),[C,A]=n.useState(!1),[I,D]=n.useState(null),[x,O]=n.useState("ADD"),[w,P]=n.useState(50),[R,k]=n.useState(0),M=Digit.ULBService.getCurrentTenantId(),F=()=>{N(null)},{isLoading:B,data:U,refetch:W}=Digit.Hooks.wt.useFixedPointSearchAPI({tenantId:M,filters:{...T,offset:R,limit:w}},{enabled:"FIXED_POINT"===r}),{isLoading:H,data:z,refetch:V}=Digit.Hooks.wt.useFillPointSearch({tenantId:M,filters:{...T,offset:R,limit:w}},{enabled:"FILLING_POINT"===r}),{isLoading:G,data:K}=Digit.Hooks.wt.useFillPointSearch({tenantId:M,filters:{limit:1e3}},{enabled:!0}),Y=(null==K?void 0:K.fillingPoints)||[],{mutate:$}=Digit.Hooks.wt.useVendorFillingMapping(M),q="FIXED_POINT"===r?B:H,X=i.useMemo(()=>{let e=("FIXED_POINT"===r?null==U?void 0:U.waterTankerBookingDetail:null==z?void 0:z.fillingPoints)||[];return"FIXED_POINT"===r&&null!=h&&h.code&&(e=e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===h.code?!!o:"UNMAPPED"!==h.code||!o})),e},[U,z,r,h]),{label:Q,placeholder:Z}={FIXED_POINT:{label:"WT_FIXING_POINT_APPLICANT_DETAILS",placeholder:"WT_ENTER_FIXED_POINT_NAME"},FILLING_POINT:{label:"WT_FILLING_POINT_NAME",placeholder:"WT_ENTER_FILLING_POINT_NAME"}}[r],J=()=>{m(""),p(""),f(null),_(null),S(null),b({})},ee=e=>{u(e),J(),k(0),b({})},te=function(e,t){void 0===t&&(t="ADD"),D(e.original),O(t),A(!0)},{mutate:le}=Digit.Hooks.wt.useLinkFillingPointLocality(M),{mutate:ne}=Digit.Hooks.wt.useUpdateFillingPointLocality(M),ie=i.useMemo(()=>"FIXED_POINT"===r?[{Header:e("WT_FIXED_POINT_CODE"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.fixedPointId)||"NA"},id:"fixedPointId"},{Header:e("WT_FIXING_POINT_APPLICANT_DETAILS"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"},id:"applicantName",Cell:e=>{var t,l;let{row:n}=e;return i.createElement("span",{className:"link"},i.createElement(a.Link,{to:"/digit-ui/employee/wt/add-fix-point-address?id="+(null===(t=n.original.applicantDetail)||void 0===t?void 0:t.applicantId)},(null===(l=n.original.applicantDetail)||void 0===l?void 0:l.name)||"NA"))}},{Header:e("WT_MOBILE_NUMBER"),accessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"},id:"mobileNumber"},{Header:e("WT_LOCALITY"),accessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.locality)||"NA"},id:"locality"},{Header:e("WT_FILLING_POINT"),accessor:e=>{var t;return(null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null==e?void 0:e.fillingPoint)||"NA"},id:"fillingPoint",Cell:t=>{var n,o,a,r;let{row:u}=t;const d=String(u.original.fillingPointId||(null===(n=u.original.fillingpointmetadata)||void 0===n?void 0:n.fillingPointId)||u.original.fillingPtName||u.original.filling_pt_name||(u.original.fillingPoint&&"object"==typeof u.original.fillingPoint?null===(o=u.original.fillingPoint)||void 0===o?void 0:o.id:u.original.fillingPoint)||(null===(a=u.original.fillingPointDetail)||void 0===a?void 0:a.id)||(null===(r=u.original.fillingPointDetail)||void 0===r?void 0:r.bookingId)||""),s=null==Y?void 0:Y.find(e=>{var t;return String(e.id||e.bookingId||e.fillingPointId||e.uuid||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId))===d&&"undefined"!==d&&"null"!==d&&""!==d});return i.createElement(l.Dropdown,{className:"fsm-registry-dropdown",selected:s,option:Y,select:t=>((t,l)=>{var n,i;const o={fixedFillingPointMapping:{fixed_pt_name:null===(n=t.original.applicantDetail)||void 0===n?void 0:n.applicantId,filling_pt_name:l.id||l.bookingId||l.fillingPointId||l.uuid||(null===(i=l.fillingpointmetadata)||void 0===i?void 0:i.fillingPointId)}};$(o,{onSuccess:()=>{N({label:e("WT_FIXED_FILLING_MAPPING_SUCCESS")}),setTimeout(F,5e3),W()},onError:t=>{var l,n,i,o;N({label:(null==t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||e("WT_FIXED_FILLING_MAPPING_FAIL"),error:!0}),setTimeout(F,5e3)}})})(u,t),style:{textAlign:"left"},optionKey:"fillingPointName",t:e})}}]:[{Header:e("WT_FILLING_POINT_CODE"),accessor:e=>(null==e?void 0:e.fillingPointId)||"NA",id:"fillingPointId"},{Header:e("WT_FILLING_POINT_NAME"),accessor:e=>(null==e?void 0:e.fillingPointName)||"NA",id:"fillingPointName",Cell:e=>{let{row:t}=e;return i.createElement("span",{className:"link"},i.createElement(a.Link,{to:"/digit-ui/employee/wt/add-filling-point-address?id="+t.original.id},t.original.fillingPointName||"NA"))}},{Header:e("WT_AE_NAME"),accessor:e=>(null==e?void 0:e.aeName)||"NA",id:"aeName"},{Header:e("WT_JE_NAME"),accessor:e=>(null==e?void 0:e.jeName)||"NA",id:"jeName"},{Header:e("WT_EE_NAME"),accessor:e=>(null==e?void 0:e.eeName)||"NA",id:"eeName"},{Header:e("WT_LOCALITY"),Cell:e=>{var t,l,n,o;let{row:a}=e;const r=(null===(t=a.original)||void 0===t||null===(l=t.fillingPointLocalityCodes)||void 0===l?void 0:l.length)>0?a.original.fillingPointLocalityCodes.join(", "):(null===(n=a.original)||void 0===n||null===(o=n.address)||void 0===o?void 0:o.locality)||"NA";return i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement("span",null,r))}},{Header:e("WT_ADD_LOCALITY"),Cell:t=>{var n,o,a,r,u,d;let{row:s}=t;const c=(null===(n=s.original)||void 0===n||null===(o=n.fillingPointLocalityCodes)||void 0===o?void 0:o.length)>0||(null===(a=s.original)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.locality)&&"NA"!==(null===(u=s.original)||void 0===u||null===(d=u.address)||void 0===d?void 0:d.locality);return i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},c?i.createElement(i.Fragment,null,i.createElement("button",{onClick:()=>te(s,"VIEW"),style:{cursor:"pointer",background:"#fff",border:"1px solid #1D4E7F",color:"#1D4E7F",borderRadius:"4px",padding:"4px 12px"}},e("CS_COMMON_VIEW")),i.createElement("button",{onClick:()=>te(s,"UPDATE"),style:{cursor:"pointer",background:"#1D4E7F",color:"#fff",border:"none",borderRadius:"4px",padding:"4px 12px"}},e("CS_COMMON_UPDATE"))):i.createElement("button",{onClick:()=>te(s,"ADD"),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",background:"#f4f4f4",border:"1px solid #ddd",borderRadius:"4px",padding:"4px 8px"}},i.createElement(l.AddIcon,{styles:{width:"16px",height:"16px"},fill:"#1D4E7F"}),e("CS_COMMON_ADD")))}}],[Y,r,e]),oe=window.Digit.Utils.browser.isMobile(),ae=Number("FIXED_POINT"===r?(null==U?void 0:U.Count)??(null==U?void 0:U.count)??(null==U?void 0:U.totalCount)??0:(null==z?void 0:z.Count)??(null==z?void 0:z.count)??(null==z?void 0:z.totalCount)??0),re=i.useCallback(function(e){return void 0===e&&(e=[]),"FIXED_POINT"===r&&null!=h&&h.code?e.filter(e=>{var t,l,n,i;const o=e.fillingPointId||(null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||e.fillingPtName||e.filling_pt_name||(e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:e.fillingPoint)||(null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId);return"MAPPED"===h.code?!!o:"UNMAPPED"!==h.code||!o}):e},[h,r]),ue=i.useCallback(function(){try{let t=!1;function e(){return re(o)}const l=200;let n=0,i=Number.POSITIVE_INFINITY;const o=[],a=L(function(){return!t&&n<i},void 0,function(){return Promise.resolve("FIXED_POINT"===r?Digit.WTService.SearchFixedPoint({tenantId:M,filters:{...T,offset:n,limit:l}}):Digit.WTService.SearchFillPoint({tenantId:M,filters:{...T,offset:n,limit:l}})).then(function(e){const a="FIXED_POINT"===r?(null==e?void 0:e.waterTankerBookingDetail)||[]:(null==e?void 0:e.fillingPoints)||[];o.push(...a);const u=Number((null==e?void 0:e.Count)??(null==e?void 0:e.count)??(null==e?void 0:e.totalCount));i=Number.isFinite(u)&&u>=0?u:o.length,!a.length||a.length<l?t=!0:n+=a.length})});return Promise.resolve(a&&a.then?a.then(e):e())}catch(e){return Promise.reject(e)}},[re,T,r,M]),de=i.useMemo(()=>"FIXED_POINT"===r?[{Header:e("WT_APPLICANT_NAME"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.name)||"NA"}},{Header:e("WT_MOBILE_NUMBER"),exportAccessor:e=>{var t;return(null==e||null===(t=e.applicantDetail)||void 0===t?void 0:t.mobileNumber)||"NA"}},{Header:e("WT_LOCALITY"),exportAccessor:e=>{var t;return(null==e||null===(t=e.address)||void 0===t?void 0:t.locality)||"NA"}},{Header:e("WT_FILLING_POINT"),exportAccessor:e=>{var t,l,n,i;return(null==e?void 0:e.fillingPointId)||(null==e||null===(t=e.fillingpointmetadata)||void 0===t?void 0:t.fillingPointId)||(null==e?void 0:e.fillingPtName)||(null==e?void 0:e.filling_pt_name)||(null!=e&&e.fillingPoint&&"object"==typeof e.fillingPoint?null===(l=e.fillingPoint)||void 0===l?void 0:l.id:null==e?void 0:e.fillingPoint)||(null==e||null===(n=e.fillingPointDetail)||void 0===n?void 0:n.id)||(null==e||null===(i=e.fillingPointDetail)||void 0===i?void 0:i.bookingId)||"NA"}}]:[{Header:e("WT_FILLING_POINT_NAME"),exportAccessor:e=>(null==e?void 0:e.fillingPointName)||"NA"},{Header:e("WT_AE_NAME"),exportAccessor:e=>(null==e?void 0:e.aeName)||"NA"},{Header:e("WT_JE_NAME"),exportAccessor:e=>(null==e?void 0:e.jeName)||"NA"},{Header:e("WT_EE_NAME"),exportAccessor:e=>(null==e?void 0:e.eeName)||"NA"},{Header:e("WT_LOCALITY"),exportAccessor:e=>{var t,l;return(null==e||null===(t=e.fillingPointLocalityCodes)||void 0===t?void 0:t.length)>0?e.fillingPointLocalityCodes.join(", "):(null==e||null===(l=e.address)||void 0===l?void 0:l.locality)||"NA"}}],[r,e]);return i.createElement(i.Fragment,null,i.createElement(l.Card,null,i.createElement("div",{className:"search-tabs-container",style:{flexDirection:oe?"column":"row",gap:oe?"16px":"0"}},i.createElement("div",null,i.createElement("button",{className:"FIXED_POINT"===r?"search-tab-head-selected":"search-tab-head",onClick:()=>ee("FIXED_POINT"),style:{width:oe?"50%":"auto"}},e("WT_FIXED_POINT")),i.createElement("button",{className:"FILLING_POINT"===r?"search-tab-head-selected":"search-tab-head",onClick:()=>ee("FILLING_POINT"),style:{width:oe?"50%":"auto"}},e("WT_FILLING_POINT"))),i.createElement("div",{className:"action-bar-wrap-registry",style:{alignSelf:oe?"flex-end":"auto"}},i.createElement("div",{className:"search-add",onClick:()=>{s(e=>!e)}},e("ES_VENDOR_REGISTRY_INBOX_HEADER_ADD"),i.createElement("div",{className:"search-add-icon"},i.createElement(l.AddIcon,null))),d&&i.createElement(l.Menu,{localeKeyPrefix:"ES_FSM_ACTION_CREATE",options:["FIXED_POINT","FILLING_POINT"],t:e,onSelect:e=>{"FILLING_POINT"===e?t.push("/digit-ui/employee/wt/add-filling-point-address"):"FIXED_POINT"===e&&t.push("/digit-ui/employee/wt/add-fix-point-address"),s(!1)}}))),i.createElement("div",{className:"finance-mainlayout"},i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e(Q)),i.createElement(l.TextInput,{value:c,onChange:e=>m(e.target.value),placeholder:e(Z)})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e("WT_MOBILE_NUMBER")),i.createElement(l.TextInput,{value:v,onChange:e=>p(e.target.value.replace(/\D/g,"").slice(0,10)),placeholder:e("WT_ENTER_MOBILE_NUMBER"),validation:{pattern:/^[6-9]\d{9}$/}})),"FIXED_POINT"===r&&i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e("WT_FIXED_POINT_STATUS")),i.createElement(l.Dropdown,{option:[{i18nKey:"WT_FIXED_POINT_MAPPED",code:"MAPPED"},{i18nKey:"WT_FIXED_POINT_UNMAPPED",code:"UNMAPPED"}],optionKey:"i18nKey",selected:g,select:_,t:e})),"FILLING_POINT"===r&&i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null,e("WT_FILLING_POINT_DESIGNATION")),i.createElement(l.Dropdown,{option:[{i18nKey:"WT_FILLING_POINT_DESIGNATION_AE",code:"DESIGNATION_AE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_JE",code:"DESIGNATION_JE"},{i18nKey:"WT_FILLING_POINT_DESIGNATION_EE",code:"DESIGNATION_EE"}],optionKey:"i18nKey",selected:E,select:f,t:e})),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement("span",{className:"generic-button clear-search",onClick:J,style:{alignSelf:"center"}},e("ES_COMMON_CLEAR_SEARCH"))),i.createElement("div",{className:"finance-mainlayout-col1"},i.createElement(l.Label,null," "),i.createElement(l.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{const e={..."FILLING_POINT"===r?{fillingPointName:c}:{name:c},mobileNumber:v,status:"FILLING_POINT"===r?null==E?void 0:E.code:null};S(g),b(e),k(0)}})))),i.createElement(l.Card,null,i.createElement(j,{key:(null==Y?void 0:Y.length)>0?"loaded":"loading",data:X,columns:ie,pageSize:w,getCellProps:()=>({style:{padding:"20px 18px",fontSize:"16px"}}),styles:{minWidth:"1200px"},inboxStyles:{overflowX:"auto"},t:e,isLoading:q||G,onPageSizeChange:e=>{P(Number(e.target.value))},currentPage:Math.floor(R/w),onNextPage:()=>{k(e=>e+w)},onPrevPage:()=>{k(e=>e-w)},pageSizeLimit:w,totalRecords:ae,isPaginationRequired:!0,showPagination:!0,showPageSizeOptions:!0,isSearchRequired:!1,isDownloadRequired:!0,isFilterRequired:!0,isSortRequired:!0,showCSVExport:!0,getCSVExportData:ue,csvExportColumns:de,csvExportFileName:`wt-${"FIXED_POINT"===r?"fixed-point":"filling-point"}-search`})),y&&i.createElement(l.Toast,{error:y.error,label:y.label,onClose:F}),C&&i.createElement(Te,{t:e,closeModal:()=>A(!1),onSubmit:t=>{const l={FillingPointLocality:t.locality.filter(e=>e.code).map(e=>({fillingPointId:I.bookingId||I.id,localityCode:e.code}))};("UPDATE"===x?ne:le)(l,{onSuccess:()=>{N({label:e("UPDATE"===x?"WT_LOCALITY_UPDATE_SUCCESS":"WT_LOCALITY_LINKING_SUCCESS")}),A(!1),setTimeout(F,5e3),"FIXED_POINT"===r?W():V()},onError:t=>{var l,n,i,o;N({label:(null==t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||e("WT_LOCALITY_LINKING_FAIL"),error:!0}),setTimeout(F,5e3)}})},initialValues:I,tenantId:M,modalMode:x}))},ye=e=>{let{config:t,onSelect:o,t:a,userType:r,formData:u}=e;const d=Digit.ULBService.getCurrentTenantId(),[s,c]=(Digit.ULBService.getStateId(),n.useState(null==u?void 0:u.serviceType)),[m,v]=n.useState([]),{data:p,isLoading:E}=Digit.Hooks.useCustomMDMS(d,"tenant",[{name:"citymodule"}],{select:e=>{var t;return null==e||null===(t=e.tenant)||void 0===t?void 0:t.citymodule}});return n.useEffect(()=>{if(p){const e=p.map(e=>({i18nKey:""+e.code,code:""+e.code,value:""+e.name}));if(v(e),!s||"WT"===s.code){const l=e.find(e=>"WT"===e.code);l&&(c(l),"employee"===(null==r?void 0:r.toLowerCase())&&o(t.key,l))}}},[p]),E?i.createElement(l.Loader,null):"employee"===(null==r?void 0:r.toLowerCase())?i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,t.label),i.createElement(l.Dropdown,{className:"payment-form-text-input-correction",isMandatory:t.isMandatory,selected:s,option:m,select:e=>{c(e),"employee"===(null==r?void 0:r.toLowerCase())&&o(t.key,e)},optionKey:"i18nKey",disable:t.disable,t:a})):null},Ne=e=>{const t=Digit.ULBService.getCurrentTenantId(),{t:r}=o.useTranslation(),u=a.useHistory(),[d,s]=n.useState(null),[c,m]=n.useState(null),[p,E]=n.useState(""),[f,g]=n.useState(""),[_,h]=n.useState(null),[S,T]=n.useState(null),[b,y]=n.useState(null),[N,C]=n.useState(null),{data:A}=Digit.Hooks.fsm.useVendorSearch({tenantId:t,filters:{status:"ACTIVE"},config:{select:e=>(null==e?void 0:e.vendor)||[]}}),{mutate:I}=Digit.Hooks.wt.useVendorWorkOrderCreate(t);n.useEffect(()=>{!function(){try{C(null);const e=function(){if(S){const e=function(){if(S.size>=2e6)C(r("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",S,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?h(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):C(r("WT_FILE_UPLOAD_ERROR"))})},function(){C(r("WT_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)}}()},[S]);const D=window.Digit.Utils.browser.isMobile(),x=Digit.UserService.getUser().info.type,O=!(c&&p&&f&&b);return i.createElement("div",{className:"employee-form-section-wrapper"},i.createElement(v,{config:[{timeLine:[{actions:"Vendor Assign",currentStep:1}]}],showFinalStep:!1}),i.createElement("div",{style:{flex:1}},i.createElement(l.CollapsibleCardPage,{title:r("WT_VENDOR_ASSIGN"),defaultOpen:!0},i.createElement("div",{className:"formcomposer-section-grid"},i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("WT_VENDOR_NAME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{t:r,option:A,optionKey:"name",select:m,selected:c,placeholder:r("WT_SELECT_VENDOR")})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("COMMON_VALID_FROM_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.DatePicker,{date:p,onChange:e=>E(e),style:{width:"100%"}})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("COMMON_VALID_TO_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.DatePicker,{date:f,min:p,onChange:e=>g(e),style:{width:"100%"}})),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.Label,null,""+r("WT_UPLOAD_DOCUMENT")),i.createElement(l.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){h(null),T(e.target.files[0])},onDelete:()=>{h(null)},message:_?"1 "+r("WT_ACTION_FILEUPLOADED"):r("WT_ACTION_NO_FILEUPLOADED"),error:N})),i.createElement(ye,{t:r,config:{key:"serviceType",label:r("WT_SELECT_SERVICE_TYPE")},onSelect:(e,t)=>{y(t)},userType:x,formData:{serviceType:b}}))),i.createElement("div",{style:{display:"flex",marginTop:"24px",justifyContent:D?"center":"flex-end"}},i.createElement(l.SubmitBar,{label:r("ES_COMMON_SAVE"),onSubmit:O?null:()=>{const e={vendorWorkOrder:{tenantId:t,vendorId:(null==c?void 0:c.code)||(null==c?void 0:c.id),validFrom:new Date(p).getTime(),validTo:new Date(f).getTime(),serviceType:(null==b?void 0:b.code)||"WT",fileStoreId:_}};I(e,{onSuccess:e=>{s({isError:!1,label:r("ES_COMMON_SAVE_SUCCESS")}),setTimeout(()=>{u.push("/digit-ui/employee/vendor/search-vendor")},3e3)},onError:e=>{var t,l,n,i;s({isError:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.message)||r("ES_COMMON_ERROR_SAVING")})}})},disabled:O}))),d&&i.createElement(l.Toast,{error:d.isError,label:d.label,onClose:()=>s(null)}))},Ce=e=>{var t,n,r,u;let{path:d}=e;const{t:s}=o.useTranslation(),c=a.useLocation(),m="WT_FIXED_POINT"!==s("WT_FIXED_POINT")?`${s("WT_FIXED_POINT")} ${s("ES_COMMON_INBOX")}`:"Fixed Point Inbox";sessionStorage.removeItem("revalidateddone");const v={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker"],applicationStatus:[],locality:[]}},E={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["mobileToilet"],applicationStatus:[],locality:[]}},f={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["treePruning"],applicationStatus:[],locality:[]}},g={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["watertanker-fixedpoint"],applicationStatus:[],locality:[]}},_=null===(t=Digit)||void 0===t||null===(n=t.ComponentRegistryService)||void 0===n?void 0:n.getComponent("ApplicationDetails"),h=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WTCreate");return i.createElement(a.Switch,null,i.createElement(l.AppContainer,null,i.createElement("div",{className:"ground-container employee-app-container form-container"},i.createElement(l.ModuleHeader,{leftContent:i.createElement(i.Fragment,null,i.createElement(l.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:(()=>{const e=c.pathname;let t="WT";e.includes("/mt/")&&(t="MT"),e.includes("/tp/")&&(t="TP");let n=[{icon:l.HomeIcon,path:"/digit-ui/employee"},{label:s("WT_MODULE_NAME"),path:"/digit-ui/employee/module/details?moduleName="+t}];if(e.includes("/fixed-point/inbox"))n.push({label:m});else if(e.includes("/inbox")){let t="ES_COMMON_INBOX";e.includes("/tp/inbox")&&(t="TP_INBOX"),n.push({label:s(t)})}else if(e.includes("/my-bookings")){let t="WT_SEARCH_BOOKINGS";e.includes("/mt/my-bookings")&&(t="MT_SEARCH_BOOKINGS"),e.includes("/tp/my-bookings")&&(t="TP_SEARCH_BOOKINGS"),n.push({label:s(t)})}else if(e.includes("/request-service"))n.push({label:s("WT_REQUEST_SERVICE")});else if(e.includes("/fixed-point/booking-details"))n.push({label:m,path:d+"/fixed-point/inbox"}),n.push({label:s("WT_BOOKING_DETAILS")});else if(e.includes("/booking-details")||e.includes("/bookingsearch/booking-details")){const t=e.includes("/bookingsearch");n.push(t?{label:s("WT_SEARCH_BOOKINGS"),path:d+"/my-bookings"}:{label:s("ES_COMMON_INBOX"),path:d+"/inbox"}),n.push({label:s("WT_BOOKING_DETAILS")})}else e.includes("/fixed-point-schedule")?n.push({label:s("WT_FIXED_POINT_SCHEDULE_MANAGEMENT")}):e.includes("/live-tracking")?n.push({label:s("WT_LIVE_TRACKING_SYSTEM")}):e.includes("/add-filling-point-address")?n.push({label:s("WT_ADD_FILLING_POINT_ADDRESS")}):e.includes("/add-fix-point-address")?n.push({label:s("WT_ADD_FIX_POINT_ADDRESS")}):e.includes("/search-filling-fix-point")?n.push({label:s("WT_SEARCH_FIX_POINT")}):e.includes("/vendor-assign")&&n.push({label:s("WT_VENDOR_ASSIGN")});return n})()}),i.createElement("div",{className:"employee-form"},i.createElement("div",{className:"employee-form-content"},i.createElement(l.PrivateRoute,{path:d+"/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,businessService:"watertanker",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:v,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/fixed-point/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,businessService:"watertanker-fixedpoint",detailRoute:d+"/fixed-point/booking-details",moduleCode:"WT",filterComponent:"WT_INBOX_FILTER",initialStates:g,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/mt/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,moduleCode:"MT",businessService:"mobileToilet",filterComponent:"WT_INBOX_FILTER",initialStates:E,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/tp/inbox",component:e=>i.createElement(Z,p({},e,{useNewInboxAPI:!0,parentRoute:d,moduleCode:"TP",businessService:"treePruning",filterComponent:"WT_INBOX_FILTER",initialStates:f,isInbox:!0}))}),i.createElement(l.PrivateRoute,{path:d+"/request-service",component:h}),i.createElement(l.PrivateRoute,{path:d+"/mt/request-service",component:h}),i.createElement(l.PrivateRoute,{path:d+"/tp/request-service",component:h}),i.createElement(l.PrivateRoute,{path:d+"/fixed-point/booking-details/:id",component:e=>i.createElement(_,p({},e,{parentRoute:d}))}),i.createElement(l.PrivateRoute,{path:d+"/booking-details/:id",component:e=>i.createElement(_,p({},e,{parentRoute:d}))}),i.createElement(l.PrivateRoute,{path:d+"/bookingsearch/booking-details/:id",component:e=>i.createElement(_,p({},e,{parentRoute:d}))}),i.createElement(l.PrivateRoute,{path:d+"/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:d,moduleCode:"WT"}))}),i.createElement(l.PrivateRoute,{path:d+"/mt/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:d,moduleCode:"MT"}))}),i.createElement(l.PrivateRoute,{path:d+"/tp/my-bookings",component:e=>i.createElement(T,p({},e,{parentRoute:d,moduleCode:"TP"}))}),i.createElement(l.PrivateRoute,{path:d+"/fixed-point-schedule",component:ee}),i.createElement(l.PrivateRoute,{path:d+"/live-tracking",component:Ee}),i.createElement(l.PrivateRoute,{path:d+"/add-filling-point-address",component:he}),i.createElement(l.PrivateRoute,{path:d+"/add-fix-point-address",component:Se}),i.createElement(l.PrivateRoute,{path:d+"/search-filling-fix-point",component:be}),i.createElement(l.PrivateRoute,{path:d+"/vendor-assignment",component:Ne}))))))},Ae=e=>{var t,n;let{application:r,tenantId:u,buttonLabel:d}=e,s=null==r?void 0:r.bookingNo.split("-")[0];const{t:c}=o.useTranslation();return i.createElement(l.Card,null,i.createElement(l.KeyNote,{keyValue:c("BOOKING_NO"),note:null==r?void 0:r.bookingNo}),i.createElement(l.KeyNote,{keyValue:c("APPLICANT_NAME"),note:null==r||null===(t=r.applicantDetail)||void 0===t?void 0:t.name}),i.createElement(l.KeyNote,{keyValue:c("MOBILE_NUMBER"),note:c(""+(null==r||null===(n=r.applicantDetail)||void 0===n?void 0:n.mobileNumber))}),i.createElement(l.KeyNote,{keyValue:c("LOCALITY"),note:c(""+(null==r?void 0:r.localityCode))}),i.createElement(l.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==r?void 0:r.bookingStatus))}),i.createElement("div",null,"WT"===s&&i.createElement(a.Link,{to:`/digit-ui/citizen/wt/booking/waterTanker/${null==r?void 0:r.bookingNo}/${u}`},i.createElement(l.SubmitBar,{label:d})),"MT"===s&&i.createElement(a.Link,{to:`/digit-ui/citizen/wt/booking/mobileToilet/${null==r?void 0:r.bookingNo}/${u}`},i.createElement(l.SubmitBar,{label:d})),"TP"===s&&i.createElement(a.Link,{to:`/digit-ui/citizen/wt/booking/treePruning/${null==r?void 0:r.bookingNo}/${u}`},i.createElement(l.SubmitBar,{label:d}))))};var Ie=Array.isArray,De="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e,t){return e(t={exports:{}},t.exports),t.exports}var Oe,Le="object"==typeof De&&De&&De.Object===Object&&De,we="object"==typeof self&&self&&self.Object===Object&&self,Pe=Le||we||Function("return this")(),Re=Pe.Symbol,ke=Object.prototype,Me=ke.hasOwnProperty,Fe=ke.toString,Be=Re?Re.toStringTag:void 0,Ue=Object.prototype.toString,We=Re?Re.toStringTag:void 0,He=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":We&&We in Object(e)?function(e){var t=Me.call(e,Be),l=e[Be];try{e[Be]=void 0;var n=!0}catch(e){}var i=Fe.call(e);return n&&(t?e[Be]=l:delete e[Be]),i}(e):function(e){return Ue.call(e)}(e)},je=function(e){return null!=e&&"object"==typeof e},ze=function(e){return"symbol"==typeof e||je(e)&&"[object Symbol]"==He(e)},Ve=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ge=/^\w*$/,Ke=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ye=function(e){if(!Ke(e))return!1;var t=He(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},$e=Pe["__core-js_shared__"],qe=(Oe=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||""))?"Symbol(src)_1."+Oe:"",Xe=Function.prototype.toString,Qe=function(e){if(null!=e){try{return Xe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ze=/^\[object .+?Constructor\]$/,Je=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ke(e)||(t=e,qe&&qe in t))&&(Ye(e)?Je:Ze).test(Qe(e));var t}(l)?l:void 0},tt=et(Object,"create"),lt=Object.prototype.hasOwnProperty,nt=Object.prototype.hasOwnProperty;function it(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}it.prototype.clear=function(){this.__data__=tt?tt(null):{},this.size=0},it.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},it.prototype.get=function(e){var t=this.__data__;if(tt){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return lt.call(t,e)?t[e]:void 0},it.prototype.has=function(e){var t=this.__data__;return tt?void 0!==t[e]:nt.call(t,e)},it.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=tt&&void 0===t?"__lodash_hash_undefined__":t,this};var ot=it,at=function(e,t){return e===t||e!=e&&t!=t},rt=function(e,t){for(var l=e.length;l--;)if(at(e[l][0],t))return l;return-1},ut=Array.prototype.splice;function dt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}dt.prototype.clear=function(){this.__data__=[],this.size=0},dt.prototype.delete=function(e){var t=this.__data__,l=rt(t,e);return!(l<0||(l==t.length-1?t.pop():ut.call(t,l,1),--this.size,0))},dt.prototype.get=function(e){var t=this.__data__,l=rt(t,e);return l<0?void 0:t[l][1]},dt.prototype.has=function(e){return rt(this.__data__,e)>-1},dt.prototype.set=function(e,t){var l=this.__data__,n=rt(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var st=dt,ct=et(Pe,"Map"),mt=function(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map};function vt(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}vt.prototype.clear=function(){this.size=0,this.__data__={hash:new ot,map:new(ct||st),string:new ot}},vt.prototype.delete=function(e){var t=mt(this,e).delete(e);return this.size-=t?1:0,t},vt.prototype.get=function(e){return mt(this,e).get(e)},vt.prototype.has=function(e){return mt(this,e).has(e)},vt.prototype.set=function(e,t){var l=mt(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var pt=vt;function Et(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Et.Cache||pt),l}Et.Cache=pt;var ft,gt,_t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ht=/\\(\\)?/g,St=(ft=Et(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_t,function(e,l,n,i){t.push(n?i.replace(ht,"$1"):l||e)}),t},function(e){return 500===gt.size&>.clear(),e}),gt=ft.cache,ft),Tt=Re?Re.prototype:void 0,bt=Tt?Tt.toString:void 0,yt=function(e){if("string"==typeof e||ze(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Nt=function(e,t,l){var n=null==e?void 0:function(e,t){for(var l=0,n=(t=function(e,t){return Ie(e)?e:function(e,t){if(Ie(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!ze(e))||Ge.test(e)||!Ve.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:St(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Ie(t))return function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}(t,e)+"";if(ze(t))return bt?bt.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))}(t,e)).length;null!=e&&l<n;)e=e[yt(t[l++])];return l&&l==n?e:void 0}(e,t);return void 0===n?l:n},Ct=xe(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",E="[object RegExp]",f="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",T="[object DataView]",b="[object Float32Array]",y="[object Float64Array]",N="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",I="[object Uint8Array]",D="[object Uint16Array]",x="[object Uint32Array]",O=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,w=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,k=RegExp(P.source),M=RegExp(R.source),F=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,j=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,V=RegExp(z.source),G=/^\s+/,K=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,q=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,Z=/\\(\\)?/g,J=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ee=/\w*$/,te=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ne=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,re=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,de="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",se="\\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",ce="["+se+"]",me="["+de+"]",ve="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+se+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fe="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Te="(?:"+pe+"|"+Ee+")",be="(?:"+Se+"|"+Ee+")",ye="(?:"+me+"|"+fe+")?",Ne="[\\ufe0e\\ufe0f]?"+ye+"(?:\\u200d(?:"+[ge,_e,he].join("|")+")[\\ufe0e\\ufe0f]?"+ye+")*",Ce="(?:"+["[\\u2700-\\u27bf]",_e,he].join("|")+")"+Ne,Ae="(?:"+[ge+me+"?",me,_e,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),xe=RegExp(me,"g"),Oe=RegExp(fe+"(?="+fe+")|"+Ae+Ne,"g"),Le=RegExp([Se+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ce,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ce,Se+Te,"$"].join("|")+")",Se+"?"+Te+"+(?:['’](?: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_])",ve,Ce].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ke=-1,Me={};Me[b]=Me[y]=Me[N]=Me[C]=Me[A]=Me[I]=Me["[object Uint8ClampedArray]"]=Me[D]=Me[x]=!0,Me[o]=Me[a]=Me[S]=Me[r]=Me[T]=Me[u]=Me[d]=Me[s]=Me[m]=Me[v]=Me[p]=Me[E]=Me[f]=Me[g]=Me[h]=!1;var Fe={};Fe[o]=Fe[a]=Fe[S]=Fe[T]=Fe[r]=Fe[u]=Fe[b]=Fe[y]=Fe[N]=Fe[C]=Fe[A]=Fe[m]=Fe[v]=Fe[p]=Fe[E]=Fe[f]=Fe[g]=Fe[_]=Fe[I]=Fe["[object Uint8ClampedArray]"]=Fe[D]=Fe[x]=!0,Fe[d]=Fe[s]=Fe[h]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,He="object"==typeof De&&De&&De.Object===Object&&De,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ke=Ge&&Ge.exports===Ve,Ye=Ke&&He.process,$e=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),qe=$e&&$e.isArrayBuffer,Xe=$e&&$e.isDate,Qe=$e&&$e.isMap,Ze=$e&&$e.isRegExp,Je=$e&&$e.isSet,et=$e&&$e.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function mt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function vt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var pt=Tt("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function _t(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function ht(e){return e!=e}function St(e,t){var l=null==e?0:e.length;return l?Nt(e,t)/l:NaN}function Tt(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 yt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Nt(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function Ct(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function At(e){return e?e.slice(0,Vt(e)+1).replace(G,""):e}function It(e){return function(t){return e(t)}}function Dt(e,t){return dt(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function Ot(e,t){for(var l=-1,n=e.length;++l<n&>(t,e[l],0)>-1;);return l}function Lt(e,t){for(var l=e.length;l--&>(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Pt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return we.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function Bt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=Oe.lastIndex=0;Oe.test(e);)++t;return t}(e):pt(e)}function zt(e){return Mt(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Gt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Kt=function e(t){var K=(t=null==t?ze:Kt.defaults(ze.Object(),t,Kt.pick(ze,Re))).Array,de=t.Date,se=t.Error,ce=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,ge=K.prototype,_e=ve.prototype,he=t["__core-js_shared__"],Se=ce.prototype.toString,Te=_e.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=_e.toString,Ce=Se.call(ve),Ae=ze._,De=pe("^"+Se.call(Te).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=Ke?t.Buffer:void 0,we=t.Symbol,Be=t.Uint8Array,He=Oe?Oe.allocUnsafe:void 0,je=Bt(ve.getPrototypeOf,ve),Ve=ve.create,Ge=_e.propertyIsEnumerable,Ye=ge.splice,$e=we?we.isConcatSpreadable:void 0,pt=we?we.iterator:void 0,bt=we?we.toStringTag:void 0,Yt=function(){try{var e=Qi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,qt=de&&de.now!==ze.Date.now&&de.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=me.ceil,Zt=me.floor,Jt=ve.getOwnPropertySymbols,el=Oe?Oe.isBuffer:void 0,tl=t.isFinite,ll=ge.join,nl=Bt(ve.keys,ve),il=me.max,ol=me.min,al=de.now,rl=t.parseInt,ul=me.random,dl=ge.reverse,sl=Qi(t,"DataView"),cl=Qi(t,"Map"),ml=Qi(t,"Promise"),vl=Qi(t,"Set"),pl=Qi(t,"WeakMap"),El=Qi(ve,"create"),fl=pl&&new pl,gl={},_l=Co(sl),hl=Co(cl),Sl=Co(ml),Tl=Co(vl),bl=Co(pl),yl=we?we.prototype:void 0,Nl=yl?yl.valueOf:void 0,Cl=yl?yl.toString:void 0;function Al(e){if(ja(e)&&!La(e)&&!(e instanceof Ol)){if(e instanceof xl)return e;if(Te.call(e,"__wrapped__"))return Ao(e)}return new xl(e)}var Il=function(){function e(){}return function(t){if(!Ha(t))return{};if(Ve)return Ve(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Dl(){}function xl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ol(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ll(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function wl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Pl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Pl;++t<l;)this.add(e[t])}function kl(e){var t=this.__data__=new wl(e);this.size=t.size}function Ml(e,t){var l=La(e),n=!l&&Oa(e),i=!l&&!n&&ka(e),o=!l&&!n&&!i&&Xa(e),a=l||n||i||o,r=a?Ct(e.length,Ee):[],u=r.length;for(var d in e)!t&&!Te.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Fl(e){var t=e.length;return t?e[Rn(0,t-1)]:void 0}function Bl(e,t){return bo(Ei(e),Yl(t,0,e.length))}function Ul(e){return bo(Ei(e))}function Wl(e,t,l){(void 0!==l&&!Ia(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Hl(e,t,l){var n=e[t];Te.call(e,t)&&Ia(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ia(e[l][0],t))return l;return-1}function zl(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function Vl(e,t){return e&&fi(t,_r(t),e)}function Gl(e,t,l){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Kl(e,t){for(var l=-1,n=t.length,i=K(n),o=null==e;++l<n;)i[l]=o?void 0:vr(e,t[l]);return i}function Yl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function $l(e,t,l,n,i,a){var d,h=1&t,O=2&t,L=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!Ha(e))return e;var w=La(e);if(w){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return Ei(e,d)}else{var P=eo(e),R=P==s||P==c;if(ka(e))return di(e,h);if(P==p||P==o||R&&!i){if(d=O||R?{}:lo(e),!h)return O?function(e,t){return fi(e,Ji(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(d,e)):function(e,t){return fi(e,Zi(e),t)}(e,Vl(d,e))}else{if(!Fe[P])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case S:return si(e);case r:case u:return new n(+e);case T:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case b:case y:case N:case C:case A:case I:case"[object Uint8ClampedArray]":case D:case x:return ci(e,l);case m:return new n;case v:case g:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ee.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new n;case _:return Nl?ve(Nl.call(e)):{}}}(e,P,h)}}a||(a=new kl);var k=a.get(e);if(k)return k;a.set(e,d),Ya(e)?e.forEach(function(n){d.add($l(n,t,l,n,e,a))}):za(e)&&e.forEach(function(n,i){d.set(i,$l(n,t,l,i,e,a))});var M=w?void 0:(L?O?Vi:zi:O?hr:_r)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Hl(d,i,$l(n,t,l,i,e,a))}),d}function ql(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return _o(function(){e.apply(void 0,n)},t)}function Ql(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,It(l))),n?(o=ut,a=!1):t.length>=200&&(o=xt,a=!1,t=new Rl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var m=d;m--;)if(t[m]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Al.templateSettings={escape:F,evaluate:B,interpolate:U,variable:"",imports:{_:Al}},(Al.prototype=Dl.prototype).constructor=Al,(xl.prototype=Il(Dl.prototype)).constructor=xl,(Ol.prototype=Il(Dl.prototype)).constructor=Ol,Ll.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},Ll.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ll.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Te.call(t,e)?t[e]:void 0},Ll.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:Te.call(t,e)},Ll.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},wl.prototype.clear=function(){this.__data__=[],this.size=0},wl.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ye.call(t,l,1),--this.size,0))},wl.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},wl.prototype.has=function(e){return jl(this.__data__,e)>-1},wl.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Pl.prototype.clear=function(){this.size=0,this.__data__={hash:new Ll,map:new(cl||wl),string:new Ll}},Pl.prototype.delete=function(e){var t=qi(this,e).delete(e);return this.size-=t?1:0,t},Pl.prototype.get=function(e){return qi(this,e).get(e)},Pl.prototype.has=function(e){return qi(this,e).has(e)},Pl.prototype.set=function(e,t){var l=qi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},Rl.prototype.add=Rl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.clear=function(){this.__data__=new wl,this.size=0},kl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},kl.prototype.get=function(e){return this.__data__.get(e)},kl.prototype.has=function(e){return this.__data__.has(e)},kl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof wl){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Pl(n)}return l.set(e,t),this.size=l.size,this};var Zl=hi(rn),Jl=hi(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!qa(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Si(),an=Si(!0);function rn(e,t){return e&&on(e,t,_r)}function un(e,t){return e&&an(e,t,_r)}function dn(e,t){return at(t,function(t){return Ba(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[No(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return La(e)?n:st(n,l(e))}function mn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=Te.call(e,bt),l=e[bt];try{e[bt]=void 0;var n=!0}catch(e){}var i=Ne.call(e);return n&&(t?e[bt]=l:delete e[bt]),i}(e):function(e){return Ne.call(e)}(e)}function vn(e,t){return e>t}function pn(e,t){return null!=e&&Te.call(e,t)}function En(e,t){return null!=e&&t in ve(e)}function fn(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=K(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,It(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new Rl(a&&s):void 0}s=e[0];var c=-1,m=r[0];e:for(;++c<i&&d.length<u;){var v=s[c],p=t?t(v):v;if(v=l||0!==v?v:0,!(m?xt(m,p):n(d,p,l))){for(a=o;--a;){var E=r[a];if(!(E?xt(E,p):n(e[a],p,l)))continue e}m&&m.push(p),d.push(v)}}return d}function gn(e,t,l){var n=null==(e=po(e,t=oi(t,e)))?e:e[No(Fo(t))];return null==n?void 0:tt(n,e,l)}function _n(e){return ja(e)&&mn(e)==o}function hn(e,t,l,n,i){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=La(e),h=La(t),b=c?a:eo(e),y=h?a:eo(t),N=(b=b==o?p:b)==p,C=(y=y==o?p:y)==p,A=b==y;if(A&&ka(e)){if(!ka(t))return!1;c=!0,N=!1}if(A&&!N)return s||(s=new kl),c||Xa(e)?Hi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case r:case u:case v:return Ia(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case m:var s=Ft;case f:if(s||(s=Wt),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var p=Hi(s(e),s(t),n,i,o,a);return a.delete(e),p;case _:if(Nl)return Nl.call(e)==Nl.call(t)}return!1}(e,t,b,l,n,i,s);if(!(1&l)){var I=N&&Te.call(e,"__wrapped__"),D=C&&Te.call(t,"__wrapped__");if(I||D){var x=I?e.value():e,O=D?t.value():t;return s||(s=new kl),i(x,O,l,n,s)}}return!!A&&(s||(s=new kl),function(e,t,l,n,i,o){var a=1&l,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Te.call(t,s)))return!1}var c=o.get(e),m=o.get(t);if(c&&m)return c==t&&m==e;var v=!0;o.set(e,t),o.set(t,e);for(var p=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var g=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===g?E===f||i(E,f,l,n,o):g)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,s))}(e,t,l,n,hn,i))}function Sn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=ve(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new kl;if(n)var m=n(d,s,u,e,t,c);if(!(void 0===m?hn(s,d,3,n,c):m))return!1}}return!0}function Tn(e){return!(!Ha(e)||(t=e,ye&&ye in t))&&(Ba(e)?De:ne).test(Co(e));var t}function bn(e){return"function"==typeof e?e:null==e?Vr:"object"==typeof e?La(e)?In(e[0],e[1]):An(e):Jr(e)}function yn(e){if(!so(e))return nl(e);var t=[];for(var l in ve(e))Te.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Nn(e,t){return e<t}function Cn(e,t){var l=-1,n=Pa(e)?K(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function An(e){var t=Xi(e);return 1==t.length&&t[0][2]?mo(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function In(e,t){return ao(e)&&co(t)?mo(No(e),t):function(l){var n=vr(l,e);return void 0===n&&n===t?pr(l,e):hn(t,n,3)}}function Dn(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new kl),Ha(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),u=fo(t,l),d=a.get(u);if(d)Wl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var m=La(u),v=!m&&ka(u),p=!m&&!v&&Xa(u);s=u,m||v||p?La(r)?s=r:Ra(r)?s=Ei(r):v?(c=!1,s=di(u,!0)):p?(c=!1,s=ci(u,!0)):s=[]:Ga(u)||Oa(u)?(s=r,Oa(r)?s=ir(r):Ha(r)&&!Ba(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Wl(e,l,s)}}(e,t,a,l,Dn,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Wl(e,a,r)}},hr)}function xn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function On(e,t,l){t=t.length?dt(t,function(e){return La(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[Vr];var n=-1;return t=dt(t,It($i())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=mi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(Cn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function Ln(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function wn(e,t,l,n){var i=n?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,It(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&Ye.call(r,u,1),Ye.call(e,u,1);return e}function Pn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ye.call(e,i,1):Qn(e,i)}}return e}function Rn(e,t){return e+Zt(ul()*(t-e+1))}function kn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return ho(vo(e,t,Vr),e+"")}function Fn(e){return Fl(Ir(e))}function Bn(e,t){var l=Ir(e);return bo(l,Yl(t,0,l.length))}function Un(e,t,l,n){if(!Ha(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=No(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=Ha(s)?s:io(t[i+1])?[]:{})}Hl(r,u,d),r=r[u]}return e}var Wn=fl?function(e,t){return fl.set(e,t),e}:Vr,Hn=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Hr(t),writable:!0})}:Vr;function jn(e){return bo(Ir(e))}function zn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=K(i);++n<i;)o[n]=e[n+t];return o}function Vn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Gn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!qa(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Kn(e,t,Vr,l)}function Kn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=qa(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),m=void 0!==c,v=null===c,p=c==c,E=qa(c);if(a)var f=n||p;else f=d?p&&(n||m):r?p&&m&&(n||!v):u?p&&m&&!v&&(n||!E):!v&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Yn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function $n(e){return"number"==typeof e?e:qa(e)?NaN:+e}function qn(e){if("string"==typeof e)return e;if(La(e))return dt(e,qn)+"";if(qa(e))return Cl?Cl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:ki(e);if(d)return Wt(d);a=!1,i=xt,u=new Rl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var m=u.length;m--;)if(u[m]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Qn(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[No(Fo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Jn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?zn(e,n?0:o,n?o+1:i):zn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ol&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var i=-1,o=K(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Ql(o[i]||a,e[r],t,l));return Xn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ra(e)?e:[]}function ii(e){return"function"==typeof e?e:Vr}function oi(e,t){return La(e)?e:ao(e,t)?[e]:yo(or(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var ui=$t||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=He?He(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function mi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=qa(e),a=void 0!==t,r=null===t,u=t==t,d=qa(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function vi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=K(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function pi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=K(s+d),m=!n;++i<s;)c[i]=e[i];for(var v=i;++u<d;)c[v+u]=t[u];for(;++a<r;)(m||i<o)&&(c[v+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=K(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Gl(l,r,u):Hl(l,r,u)}return l}function gi(e,t){return function(l,n){var i=La(l)?lt:zl,o=t?t():{};return i(l,e,$i(n,2),o)}}function _i(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function hi(e,t){return function(l,n){if(null==l)return l;if(!Pa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=ve(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Si(e){return function(t,l,n){for(var i=-1,o=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function Ti(e){return function(t){var l=Mt(t=or(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function bi(e){return function(t){return ct(Br(Or(t).replace(Ie,"")),e,"")}}function yi(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 l=Il(e.prototype),n=e.apply(l,t);return Ha(n)?n:l}}function Ni(e){return function(t,l,n){var i=ve(t);if(!Pa(t)){var o=$i(l,3);t=_r(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ci(e){return ji(function(t){var n=t.length,i=n,o=xl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Ki(a))var r=new xl([],!0)}for(i=r?i:n;++i<n;){var u=Ki(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Ki(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&La(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Ai(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,m=2&t,v=24&t,p=512&t,E=m?void 0:yi(e);return function f(){for(var g=arguments.length,_=K(g),h=g;h--;)_[h]=arguments[h];if(v)var S=Yi(f),T=wt(_,S);if(n&&(_=vi(_,n,i,v)),o&&(_=pi(_,o,a,v)),g-=T,v&&g<d){var b=Ut(_,S);return Pi(e,t,Ai,f.placeholder,l,_,b,r,u,d-g)}var y=c?l:this,N=m?y[e]:e;return g=_.length,r?_=Eo(_,r):p&&g>1&&_.reverse(),s&&u<g&&(_.length=u),this&&this!==ze&&this instanceof f&&(N=E||yi(N)),N.apply(y,_)}}function Ii(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Di(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=qn(l),n=qn(n)):(l=$n(l),n=$n(n)),i=e(l,n)}return i}}function xi(e){return ji(function(t){return t=dt(t,It($i())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Oi(e,t){var l=(t=void 0===t?" ":qn(t)).length;if(l<2)return l?kn(t,e):t;var n=kn(t,Qt(e/jt(t)));return Mt(t)?ri(zt(n),0,e).join(""):n.slice(0,e)}function Li(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l,n){for(var i=-1,o=il(Qt((t-e)/(l||1)),0),a=K(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:er(n),e)}}function wi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=nr(t),l=nr(l)),e(t,l)}}function Pi(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],m=l.apply(void 0,c);return ro(e)&&go(m,c),m.placeholder=n,So(m,e,t)}function Ri(e){var t=me[e];return function(e,l){if(e=nr(e),(l=null==l?0:ol(tr(l),292))&&tl(e)){var n=(or(e)+"e").split("e");return+((n=(or(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var ki=vl&&1/Wt(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:qr;function Mi(e){return function(t){var l=eo(t);return l==m?Ft(t):l==f?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(tr(u),0),d=void 0===d?d:tr(d),c-=a?a.length:0,64&t){var m=o,v=a;o=a=void 0}var p=s?void 0:Gi(e),E=[e,t,i,o,a,m,v,r,u,d];if(p&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,p),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=yi(e);return function i(){for(var o=arguments.length,a=K(o),r=o,u=Yi(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Pi(e,t,Ai,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==ze&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Ai.apply(void 0,E):function(e,t,l,n){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=K(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var f=function(e,t,l){var n=1&t,i=yi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return So((p?Wn:go)(f,E),e,t)}function Bi(e,t,l,n){return void 0===e||Ia(e,_e[l])&&!Te.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),Dn(e,t,void 0,Ui,o),o.delete(t)),e}function Wi(e){return Ga(e)?void 0:e}function Hi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,m=!0,v=2&l?new Rl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,o):n(p,E,c,e,t,o);if(void 0!==f){if(f)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!xt(v,t)&&(p===e||i(p,e,l,n,o)))return v.push(t)})){m=!1;break}}else if(p!==E&&!i(p,E,l,n,o)){m=!1;break}}return o.delete(e),o.delete(t),m}function ji(e){return ho(vo(e,void 0,wo),e+"")}function zi(e){return cn(e,_r,Zi)}function Vi(e){return cn(e,hr,Ji)}var Gi=fl?function(e){return fl.get(e)}:qr;function Ki(e){for(var t=e.name+"",l=gl[t],n=Te.call(gl,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Yi(e){return(Te.call(Al,"placeholder")?Al:e).placeholder}function $i(){var e=Al.iteratee||Gr;return e=e===Gr?bn:e,arguments.length?e(arguments[0],arguments[1]):e}function qi(e,t){var l,n,i=e.__data__;return("string"==(n=typeof(l=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==l:null===l)?i["string"==typeof t?"string":"hash"]:i.map}function Xi(e){for(var t=_r(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Qi(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Tn(l)?l:void 0}var Zi=Jt?function(e){return null==e?[]:(e=ve(e),at(Jt(e),function(t){return Ge.call(e,t)}))}:lu,Ji=Jt?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:lu,eo=mn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=No(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Wa(i)&&io(a,i)&&(La(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Il(je(e))}function no(e){return La(e)||Oa(e)||!!($e&&e&&e[$e])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&oe.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!Ha(l))return!1;var n=typeof t;return!!("number"==n?Pa(l)&&io(t,l.length):"string"==n&&t in l)&&Ia(l[t],e)}function ao(e,t){if(La(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!qa(e))||H.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ro(e){var t=Ki(e),l=Al[t];if("function"!=typeof l||!(t in Ol.prototype))return!1;if(e===l)return!0;var n=Gi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=T||cl&&eo(new cl)!=m||ml&&"[object Promise]"!=eo(ml.resolve())||vl&&eo(new vl)!=f||pl&&eo(new pl)!=h)&&(eo=function(e){var t=mn(e),l=t==p?e.constructor:void 0,n=l?Co(l):"";if(n)switch(n){case _l:return T;case hl:return m;case Sl:return"[object Promise]";case Tl:return f;case bl:return h}return t});var uo=he?Ba:nu;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function co(e){return e==e&&!Ha(e)}function mo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=K(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=K(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=To(Wn),_o=Xt||function(e,t){return ze.setTimeout(e,t)},ho=To(Hn);function So(e,t,l){var n=t+"";return ho(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(Y,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(q):[]}(n),l)))}function To(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=Rn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var yo=function(e){var t=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(j,function(e,l,n,i){t.push(n?i.replace(Z,"$1"):l||e)}),t},function(e){return 500===l.size&&l.clear(),e}),l=t.cache;return t}();function No(e){if("string"==typeof e||qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Co(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ao(e){if(e instanceof Ol)return e.clone();var t=new xl(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Mn(function(e,t){return Ra(e)?Ql(e,nn(t,1,Ra,!0)):[]}),Do=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Ql(e,nn(t,1,Ra,!0),$i(l,2)):[]}),xo=Mn(function(e,t){var l=Fo(t);return Ra(l)&&(l=void 0),Ra(e)?Ql(e,nn(t,1,Ra,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),ft(e,$i(t,3),i)}function Lo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=tr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,$i(t,3),i,!0)}function wo(e){return null!=e&&e.length?nn(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Mn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),ko=Mn(function(e){var t=Fo(e),l=dt(e,ni);return t===Fo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,$i(t,2)):[]}),Mo=Mn(function(e){var t=Fo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Bo=Mn(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?wn(e,t):e}var Wo=ji(function(e,t){var l=null==e?0:e.length,n=Kl(e,t);return Pn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(mi)),n});function Ho(e){return null==e?e:dl.call(e)}var jo=Mn(function(e){return Xn(nn(e,1,Ra,!0))}),zo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),Xn(nn(e,1,Ra,!0),$i(t,2))}),Vo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Ra,!0),void 0,t)});function Go(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ra(e))return t=il(e.length,t),!0}),Ct(t,function(t){return dt(e,Tt(t))})}function Ko(e,t){if(!e||!e.length)return[];var l=Go(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var Yo=Mn(function(e,t){return Ra(e)?Ql(e,t):[]}),$o=Mn(function(e){return ti(at(e,Ra))}),qo=Mn(function(e){var t=Fo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),$i(t,2))}),Xo=Mn(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Qo=Mn(Go),Zo=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Ko(e,l)});function Jo(e){var t=Al(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Kl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ol&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new xl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),la=gi(function(e,t,l){Te.call(e,l)?++e[l]:Gl(e,l,1)}),na=Ni(Oo),ia=Ni(Lo);function oa(e,t){return(La(e)?nt:Zl)(e,$i(t,3))}function aa(e,t){return(La(e)?it:Jl)(e,$i(t,3))}var ra=gi(function(e,t,l){Te.call(e,l)?e[l].push(t):Gl(e,l,[t])}),ua=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=Pa(e)?K(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):gn(e,t,l)}),o}),da=gi(function(e,t,l){Gl(e,l,t)});function sa(e,t){return(La(e)?dt:Cn)(e,$i(t,3))}var ca=gi(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),ma=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),On(e,nn(t,1),[])}),va=qt||function(){return ze.Date.now()};function pa(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Ea(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var fa=Mn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,Yi(fa));n|=32}return Fi(e,n,t,l,i)}),ga=Mn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,Yi(ga));n|=32}return Fi(t,n,e,l,i)});function _a(e,t,n){var i,o,a,r,u,d,s=0,c=!1,m=!1,v=!0;if("function"!=typeof e)throw new fe(l);function p(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=_o(g,t),c?p(e):r}function f(e){var l=e-d;return void 0===d||l>=t||l<0||m&&e-s>=a}function g(){var e=va();if(f(e))return _(e);u=_o(g,function(e){var l=t-(e-d);return m?ol(l,a-(e-s)):l}(e))}function _(e){return u=void 0,v&&i?p(e):(i=o=void 0,r)}function h(){var e=va(),l=f(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(m)return ui(u),u=_o(g,t),p(d)}return void 0===u&&(u=_o(g,t)),r}return t=nr(t)||0,Ha(n)&&(c=!!n.leading,a=(m="maxWait"in n)?il(nr(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),h.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},h.flush=function(){return void 0===u?r:_(va())},h}var ha=Mn(function(e,t){return Xl(e,1,t)}),Sa=Mn(function(e,t,l){return Xl(e,nr(t)||0,l)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);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(Ta.Cache||Pl),n}function ba(e){if("function"!=typeof e)throw new fe(l);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)}}Ta.Cache=Pl;var ya=ai(function(e,t){var l=(t=1==t.length&&La(t[0])?dt(t[0],It($i())):dt(nn(t,1),It($i()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Na=Mn(function(e,t){return Fi(e,32,void 0,t,Ut(t,Yi(Na)))}),Ca=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,Yi(Ca)))}),Aa=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var Da=wi(vn),xa=wi(function(e,t){return e>=t}),Oa=_n(function(){return arguments}())?_n:function(e){return ja(e)&&Te.call(e,"callee")&&!Ge.call(e,"callee")},La=K.isArray,wa=qe?It(qe):function(e){return ja(e)&&mn(e)==S};function Pa(e){return null!=e&&Wa(e.length)&&!Ba(e)}function Ra(e){return ja(e)&&Pa(e)}var ka=el||nu,Ma=Xe?It(Xe):function(e){return ja(e)&&mn(e)==u};function Fa(e){if(!ja(e))return!1;var t=mn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function Ba(e){if(!Ha(e))return!1;var t=mn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==tr(e)}function Wa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ja(e){return null!=e&&"object"==typeof e}var za=Qe?It(Qe):function(e){return ja(e)&&eo(e)==m};function Va(e){return"number"==typeof e||ja(e)&&mn(e)==v}function Ga(e){if(!ja(e)||mn(e)!=p)return!1;var t=je(e);if(null===t)return!0;var l=Te.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Se.call(l)==Ce}var Ka=Ze?It(Ze):function(e){return ja(e)&&mn(e)==E},Ya=Je?It(Je):function(e){return ja(e)&&eo(e)==f};function $a(e){return"string"==typeof e||!La(e)&&ja(e)&&mn(e)==g}function qa(e){return"symbol"==typeof e||ja(e)&&mn(e)==_}var Xa=et?It(et):function(e){return ja(e)&&Wa(e.length)&&!!Me[mn(e)]},Qa=wi(Nn),Za=wi(function(e,t){return e<=t});function Ja(e){if(!e)return[];if(Pa(e))return $a(e)?zt(e):Ei(e);if(pt&&e[pt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[pt]());var t=eo(e);return(t==m?Ft:t==f?Wt:Ir)(e)}function er(e){return e?(e=nr(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function tr(e){var t=er(e),l=t%1;return t==t?l?t-l:t:0}function lr(e){return e?Yl(tr(e),0,4294967295):0}function nr(e){if("number"==typeof e)return e;if(qa(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=At(e);var l=le.test(e);return l||ie.test(e)?We(e.slice(2),l?2:8):te.test(e)?NaN:+e}function ir(e){return fi(e,hr(e))}function or(e){return null==e?"":qn(e)}var ar=_i(function(e,t){if(so(t)||Pa(t))fi(t,_r(t),e);else for(var l in t)Te.call(t,l)&&Hl(e,l,t[l])}),rr=_i(function(e,t){fi(t,hr(t),e)}),ur=_i(function(e,t,l,n){fi(t,hr(t),e,n)}),dr=_i(function(e,t,l,n){fi(t,_r(t),e,n)}),sr=ji(Kl),cr=Mn(function(e,t){e=ve(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ia(s,_e[d])&&!Te.call(e,d))&&(e[d]=o[d])}return e}),mr=Mn(function(e){return e.push(void 0,Ui),tt(Tr,void 0,e)});function vr(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function pr(e,t){return null!=e&&to(e,t,En)}var Er=Ii(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=l},Hr(Vr)),fr=Ii(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Te.call(e,t)?e[t].push(l):e[t]=[l]},$i),gr=Mn(gn);function _r(e){return Pa(e)?Ml(e):yn(e)}function hr(e){return Pa(e)?Ml(e,!0):function(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var l in ve(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&Te.call(e,n))&&l.push(n);return l}(e)}var Sr=_i(function(e,t,l){Dn(e,t,l)}),Tr=_i(function(e,t,l,n){Dn(e,t,l,n)}),br=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,Vi(e),l),n&&(l=$l(l,7,Wi));for(var i=t.length;i--;)Qn(l,t[i]);return l}),yr=ji(function(e,t){return null==e?{}:function(e,t){return Ln(e,t,function(t,l){return pr(e,l)})}(e,t)});function Nr(e,t){if(null==e)return{};var l=dt(Vi(e),function(e){return[e]});return t=$i(t),Ln(e,l,function(e,l){return t(e,l[0])})}var Cr=Mi(_r),Ar=Mi(hr);function Ir(e){return null==e?[]:Dt(e,_r(e))}var Dr=bi(function(e,t,l){return t=t.toLowerCase(),e+(l?xr(t):t)});function xr(e){return Fr(or(e).toLowerCase())}function Or(e){return(e=or(e))&&e.replace(ae,Pt).replace(xe,"")}var Lr=bi(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),wr=bi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Pr=Ti("toLowerCase"),Rr=bi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),kr=bi(function(e,t,l){return e+(l?" ":"")+Fr(t)}),Mr=bi(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Fr=Ti("toUpperCase");function Br(e,t,l){return e=or(e),void 0===(t=l?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Ur=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fa(e)?e:new se(e)}}),Wr=ji(function(e,t){return nt(t,function(t){t=No(t),Gl(e,t,fa(e[t],e))}),e});function Hr(e){return function(){return e}}var jr=Ci(),zr=Ci(!0);function Vr(e){return e}function Gr(e){return bn("function"==typeof e?e:$l(e,1))}var Kr=Mn(function(e,t){return function(l){return gn(l,e,t)}}),Yr=Mn(function(e,t){return function(l){return gn(e,l,t)}});function $r(e,t,l){var n=_r(t),i=dn(t,n);null!=l||Ha(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,_r(t)));var o=!(Ha(l)&&"chain"in l&&!l.chain),a=Ba(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function qr(){}var Xr=xi(dt),Qr=xi(ot),Zr=xi(vt);function Jr(e){return ao(e)?Tt(No(e)):function(e){return function(t){return sn(t,e)}}(e)}var eu=Li(),tu=Li(!0);function lu(){return[]}function nu(){return!1}var iu,ou=Di(function(e,t){return e+t},0),au=Ri("ceil"),ru=Di(function(e,t){return e/t},1),uu=Ri("floor"),du=Di(function(e,t){return e*t},1),su=Ri("round"),cu=Di(function(e,t){return e-t},0);return Al.after=function(e,t){if("function"!=typeof t)throw new fe(l);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},Al.ary=pa,Al.assign=ar,Al.assignIn=rr,Al.assignInWith=ur,Al.assignWith=dr,Al.at=sr,Al.before=Ea,Al.bind=fa,Al.bindAll=Wr,Al.bindKey=ga,Al.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},Al.chain=Jo,Al.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(tr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=K(Qt(n/t));i<n;)a[o++]=zn(e,i,i+=t);return a},Al.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Al.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(La(l)?Ei(l):[l],nn(t,1))},Al.cond=function(e){var t=null==e?0:e.length,n=$i();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Al.conforms=function(e){return function(e){var t=_r(e);return function(l){return ql(l,e,t)}}($l(e,1))},Al.constant=Hr,Al.countBy=la,Al.create=function(e,t){var l=Il(e);return null==t?l:Vl(l,t)},Al.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Al.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Al.debounce=_a,Al.defaults=cr,Al.defaultsDeep=mr,Al.defer=ha,Al.delay=Sa,Al.difference=Io,Al.differenceBy=Do,Al.differenceWith=xo,Al.drop=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=l||void 0===t?1:tr(t))<0?0:t,n):[]},Al.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,0,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t):[]},Al.dropRightWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3),!0,!0):[]},Al.dropWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3),!0):[]},Al.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=tr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:tr(n))<0&&(n+=i),n=l>n?0:lr(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Al.filter=function(e,t){return(La(e)?at:ln)(e,$i(t,3))},Al.flatMap=function(e,t){return nn(sa(e,t),1)},Al.flatMapDeep=function(e,t){return nn(sa(e,t),1/0)},Al.flatMapDepth=function(e,t,l){return l=void 0===l?1:tr(l),nn(sa(e,t),l)},Al.flatten=wo,Al.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Al.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:tr(t)):[]},Al.flip=function(e){return Fi(e,512)},Al.flow=jr,Al.flowRight=zr,Al.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Al.functions=function(e){return null==e?[]:dn(e,_r(e))},Al.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Al.groupBy=ra,Al.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Al.intersection=Ro,Al.intersectionBy=ko,Al.intersectionWith=Mo,Al.invert=Er,Al.invertBy=fr,Al.invokeMap=ua,Al.iteratee=Gr,Al.keyBy=da,Al.keys=_r,Al.keysIn=hr,Al.map=sa,Al.mapKeys=function(e,t){var l={};return t=$i(t,3),rn(e,function(e,n,i){Gl(l,t(e,n,i),e)}),l},Al.mapValues=function(e,t){var l={};return t=$i(t,3),rn(e,function(e,n,i){Gl(l,n,t(e,n,i))}),l},Al.matches=function(e){return An($l(e,1))},Al.matchesProperty=function(e,t){return In(e,$l(t,1))},Al.memoize=Ta,Al.merge=Sr,Al.mergeWith=Tr,Al.method=Kr,Al.methodOf=Yr,Al.mixin=$r,Al.negate=ba,Al.nthArg=function(e){return e=tr(e),Mn(function(t){return xn(t,e)})},Al.omit=br,Al.omitBy=function(e,t){return Nr(e,ba($i(t)))},Al.once=function(e){return Ea(2,e)},Al.orderBy=function(e,t,l,n){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(l=n?void 0:l)||(l=null==l?[]:[l]),On(e,t,l))},Al.over=Xr,Al.overArgs=ya,Al.overEvery=Qr,Al.overSome=Zr,Al.partial=Na,Al.partialRight=Ca,Al.partition=ca,Al.pick=yr,Al.pickBy=Nr,Al.property=Jr,Al.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Al.pull=Bo,Al.pullAll=Uo,Al.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?wn(e,t,$i(l,2)):e},Al.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?wn(e,t,void 0,l):e},Al.pullAt=Wo,Al.range=eu,Al.rangeRight=tu,Al.rearg=Aa,Al.reject=function(e,t){return(La(e)?at:ln)(e,ba($i(t,3)))},Al.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=$i(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Pn(e,i),l},Al.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:tr(t))},Al.reverse=Ho,Al.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),(La(e)?Bl:Bn)(e,t)},Al.set=function(e,t,l){return null==e?e:Un(e,t,l)},Al.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Al.shuffle=function(e){return(La(e)?Ul:jn)(e)},Al.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:tr(t),l=void 0===l?n:tr(l)),zn(e,t,l)):[]},Al.sortBy=ma,Al.sortedUniq=function(e){return e&&e.length?Yn(e):[]},Al.sortedUniqBy=function(e,t){return e&&e.length?Yn(e,$i(t,2)):[]},Al.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=qn(t))&&Mt(e)?ri(zt(e),0,l):e.split(t,l):[]},Al.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(tr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Al.tail=function(e){var t=null==e?0:e.length;return t?zn(e,1,t):[]},Al.take=function(e,t,l){return e&&e.length?zn(e,0,(t=l||void 0===t?1:tr(t))<0?0:t):[]},Al.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=n-(t=l||void 0===t?1:tr(t)))<0?0:t,n):[]},Al.takeRightWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3),!1,!0):[]},Al.takeWhile=function(e,t){return e&&e.length?Jn(e,$i(t,3)):[]},Al.tap=function(e,t){return t(e),e},Al.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return Ha(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),_a(e,t,{leading:i,maxWait:t,trailing:o})},Al.thru=ea,Al.toArray=Ja,Al.toPairs=Cr,Al.toPairsIn=Ar,Al.toPath=function(e){return La(e)?dt(e,No):qa(e)?[e]:Ei(yo(or(e)))},Al.toPlainObject=ir,Al.transform=function(e,t,l){var n=La(e),i=n||ka(e)||Xa(e);if(t=$i(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:Ha(e)&&Ba(o)?Il(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Al.unary=function(e){return pa(e,1)},Al.union=jo,Al.unionBy=zo,Al.unionWith=Vo,Al.uniq=function(e){return e&&e.length?Xn(e):[]},Al.uniqBy=function(e,t){return e&&e.length?Xn(e,$i(t,2)):[]},Al.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Al.unset=function(e,t){return null==e||Qn(e,t)},Al.unzip=Go,Al.unzipWith=Ko,Al.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Al.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Al.values=Ir,Al.valuesIn=function(e){return null==e?[]:Dt(e,hr(e))},Al.without=Yo,Al.words=Br,Al.wrap=function(e,t){return Na(ii(t),e)},Al.xor=$o,Al.xorBy=qo,Al.xorWith=Xo,Al.zip=Qo,Al.zipObject=function(e,t){return li(e||[],t||[],Hl)},Al.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Al.zipWith=Zo,Al.entries=Cr,Al.entriesIn=Ar,Al.extend=rr,Al.extendWith=ur,$r(Al,Al),Al.add=ou,Al.attempt=Ur,Al.camelCase=Dr,Al.capitalize=xr,Al.ceil=au,Al.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=nr(l))==l?l:0),void 0!==t&&(t=(t=nr(t))==t?t:0),Yl(nr(e),t,l)},Al.clone=function(e){return $l(e,4)},Al.cloneDeep=function(e){return $l(e,5)},Al.cloneDeepWith=function(e,t){return $l(e,5,t="function"==typeof t?t:void 0)},Al.cloneWith=function(e,t){return $l(e,4,t="function"==typeof t?t:void 0)},Al.conformsTo=function(e,t){return null==t||ql(e,t,_r(t))},Al.deburr=Or,Al.defaultTo=function(e,t){return null==e||e!=e?t:e},Al.divide=ru,Al.endsWith=function(e,t,l){e=or(e),t=qn(t);var n=e.length,i=l=void 0===l?n:Yl(tr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Al.eq=Ia,Al.escape=function(e){return(e=or(e))&&M.test(e)?e.replace(R,Rt):e},Al.escapeRegExp=function(e){return(e=or(e))&&V.test(e)?e.replace(z,"\\$&"):e},Al.every=function(e,t,l){var n=La(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,$i(t,3))},Al.find=na,Al.findIndex=Oo,Al.findKey=function(e,t){return Et(e,$i(t,3),rn)},Al.findLast=ia,Al.findLastIndex=Lo,Al.findLastKey=function(e,t){return Et(e,$i(t,3),un)},Al.floor=uu,Al.forEach=oa,Al.forEachRight=aa,Al.forIn=function(e,t){return null==e?e:on(e,$i(t,3),hr)},Al.forInRight=function(e,t){return null==e?e:an(e,$i(t,3),hr)},Al.forOwn=function(e,t){return e&&rn(e,$i(t,3))},Al.forOwnRight=function(e,t){return e&&un(e,$i(t,3))},Al.get=vr,Al.gt=Da,Al.gte=xa,Al.has=function(e,t){return null!=e&&to(e,t,pn)},Al.hasIn=pr,Al.head=Po,Al.identity=Vr,Al.includes=function(e,t,l,n){e=Pa(e)?e:Ir(e),l=l&&!n?tr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),$a(e)?l<=i&&e.indexOf(t,l)>-1:!!i&>(e,t,l)>-1},Al.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:tr(l);return i<0&&(i=il(n+i,0)),gt(e,t,i)},Al.inRange=function(e,t,l){return t=er(t),void 0===l?(l=t,t=0):l=er(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=nr(e),t,l)},Al.invoke=gr,Al.isArguments=Oa,Al.isArray=La,Al.isArrayBuffer=wa,Al.isArrayLike=Pa,Al.isArrayLikeObject=Ra,Al.isBoolean=function(e){return!0===e||!1===e||ja(e)&&mn(e)==r},Al.isBuffer=ka,Al.isDate=Ma,Al.isElement=function(e){return ja(e)&&1===e.nodeType&&!Ga(e)},Al.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(La(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Xa(e)||Oa(e)))return!e.length;var t=eo(e);if(t==m||t==f)return!e.size;if(so(e))return!yn(e).length;for(var l in e)if(Te.call(e,l))return!1;return!0},Al.isEqual=function(e,t){return hn(e,t)},Al.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?hn(e,t,void 0,l):!!n},Al.isError=Fa,Al.isFinite=function(e){return"number"==typeof e&&tl(e)},Al.isFunction=Ba,Al.isInteger=Ua,Al.isLength=Wa,Al.isMap=za,Al.isMatch=function(e,t){return e===t||Sn(e,t,Xi(t))},Al.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Xi(t),l)},Al.isNaN=function(e){return Va(e)&&e!=+e},Al.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tn(e)},Al.isNil=function(e){return null==e},Al.isNull=function(e){return null===e},Al.isNumber=Va,Al.isObject=Ha,Al.isObjectLike=ja,Al.isPlainObject=Ga,Al.isRegExp=Ka,Al.isSafeInteger=function(e){return Ua(e)&&e>=-9007199254740991&&e<=9007199254740991},Al.isSet=Ya,Al.isString=$a,Al.isSymbol=qa,Al.isTypedArray=Xa,Al.isUndefined=function(e){return void 0===e},Al.isWeakMap=function(e){return ja(e)&&eo(e)==h},Al.isWeakSet=function(e){return ja(e)&&"[object WeakSet]"==mn(e)},Al.join=function(e,t){return null==e?"":ll.call(e,t)},Al.kebabCase=Lr,Al.last=Fo,Al.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=tr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,ht,i,!0)},Al.lowerCase=wr,Al.lowerFirst=Pr,Al.lt=Qa,Al.lte=Za,Al.max=function(e){return e&&e.length?tn(e,Vr,vn):void 0},Al.maxBy=function(e,t){return e&&e.length?tn(e,$i(t,2),vn):void 0},Al.mean=function(e){return St(e,Vr)},Al.meanBy=function(e,t){return St(e,$i(t,2))},Al.min=function(e){return e&&e.length?tn(e,Vr,Nn):void 0},Al.minBy=function(e,t){return e&&e.length?tn(e,$i(t,2),Nn):void 0},Al.stubArray=lu,Al.stubFalse=nu,Al.stubObject=function(){return{}},Al.stubString=function(){return""},Al.stubTrue=function(){return!0},Al.multiply=du,Al.nth=function(e,t){return e&&e.length?xn(e,tr(t)):void 0},Al.noConflict=function(){return ze._===this&&(ze._=Ae),this},Al.noop=qr,Al.now=va,Al.pad=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Oi(Zt(i),l)+e+Oi(Qt(i),l)},Al.padEnd=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?e+Oi(t-n,l):e},Al.padStart=function(e,t,l){e=or(e);var n=(t=tr(t))?jt(e):0;return t&&n<t?Oi(t-n,l)+e:e},Al.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(or(e).replace(G,""),t||0)},Al.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=er(e),void 0===t?(t=e,e=0):t=er(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Rn(e,t)},Al.reduce=function(e,t,l){var n=La(e)?ct:yt,i=arguments.length<3;return n(e,$i(t,4),l,i,Zl)},Al.reduceRight=function(e,t,l){var n=La(e)?mt:yt,i=arguments.length<3;return n(e,$i(t,4),l,i,Jl)},Al.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:tr(t),kn(or(e),t)},Al.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Al.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[No(t[n])];void 0===o&&(n=i,o=l),e=Ba(o)?o.call(e):o}return e},Al.round=su,Al.runInContext=e,Al.sample=function(e){return(La(e)?Fl:Fn)(e)},Al.size=function(e){if(null==e)return 0;if(Pa(e))return $a(e)?jt(e):e.length;var t=eo(e);return t==m||t==f?e.size:yn(e).length},Al.snakeCase=Rr,Al.some=function(e,t,l){var n=La(e)?vt:Vn;return l&&oo(e,t,l)&&(t=void 0),n(e,$i(t,3))},Al.sortedIndex=function(e,t){return Gn(e,t)},Al.sortedIndexBy=function(e,t,l){return Kn(e,t,$i(l,2))},Al.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Al.sortedLastIndex=function(e,t){return Gn(e,t,!0)},Al.sortedLastIndexBy=function(e,t,l){return Kn(e,t,$i(l,2),!0)},Al.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(Ia(e[l],t))return l}return-1},Al.startCase=kr,Al.startsWith=function(e,t,l){return e=or(e),l=null==l?0:Yl(tr(l),0,e.length),t=qn(t),e.slice(l,l+t.length)==t},Al.subtract=cu,Al.sum=function(e){return e&&e.length?Nt(e,Vr):0},Al.sumBy=function(e,t){return e&&e.length?Nt(e,$i(t,2)):0},Al.template=function(e,t,l){var n=Al.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=or(e),t=ur({},t,n,Bi);var i,o,a=ur({},t.imports,n.imports,Bi),r=_r(a),u=Dt(a,r),d=0,s=t.interpolate||re,c="__p += '",m=pe((t.escape||re).source+"|"+s.source+"|"+(s===U?J:re).source+"|"+(t.evaluate||re).source+"|$","g"),v="//# sourceURL="+(Te.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(m,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(ue,kt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Te.call(t,"variable")&&t.variable;if(p){if(Q.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(O,""):c).replace(L,"$1").replace(w,"$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 E=Ur(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(E.source=c,Fa(E))throw E;return E},Al.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=Ct(n,t=$i(t));++l<e;)t(l);return i},Al.toFinite=er,Al.toInteger=tr,Al.toLength=lr,Al.toLower=function(e){return or(e).toLowerCase()},Al.toNumber=nr,Al.toSafeInteger=function(e){return e?Yl(tr(e),-9007199254740991,9007199254740991):0===e?e:0},Al.toString=or,Al.toUpper=function(e){return or(e).toUpperCase()},Al.trim=function(e,t,l){if((e=or(e))&&(l||void 0===t))return At(e);if(!e||!(t=qn(t)))return e;var n=zt(e),i=zt(t);return ri(n,Ot(n,i),Lt(n,i)+1).join("")},Al.trimEnd=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=qn(t)))return e;var n=zt(e);return ri(n,0,Lt(n,zt(t))+1).join("")},Al.trimStart=function(e,t,l){if((e=or(e))&&(l||void 0===t))return e.replace(G,"");if(!e||!(t=qn(t)))return e;var n=zt(e);return ri(n,Ot(n,zt(t))).join("")},Al.truncate=function(e,t){var l=30,n="...";if(Ha(t)){var i="separator"in t?t.separator:i;l="length"in t?tr(t.length):l,n="omission"in t?qn(t.omission):n}var o=(e=or(e)).length;if(Mt(e)){var a=zt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Ka(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=pe(i.source,or(ee.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(qn(i),r)!=r){var m=u.lastIndexOf(i);m>-1&&(u=u.slice(0,m))}return u+n},Al.unescape=function(e){return(e=or(e))&&k.test(e)?e.replace(P,Gt):e},Al.uniqueId=function(e){var t=++be;return or(e)+t},Al.upperCase=Mr,Al.upperFirst=Fr,Al.each=oa,Al.eachRight=aa,Al.first=Po,$r(Al,(iu={},rn(Al,function(e,t){Te.call(Al.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),Al.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Al[e].placeholder=Al}),nt(["drop","take"],function(e,t){Ol.prototype[e]=function(l){l=void 0===l?1:il(tr(l),0);var n=this.__filtered__&&!t?new Ol(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ol.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Ol.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$i(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ol.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ol.prototype[e]=function(){return this.__filtered__?new Ol(this):this[l](1)}}),Ol.prototype.compact=function(){return this.filter(Vr)},Ol.prototype.find=function(e){return this.filter(e).head()},Ol.prototype.findLast=function(e){return this.reverse().find(e)},Ol.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ol(this):this.map(function(l){return gn(l,e,t)})}),Ol.prototype.reject=function(e){return this.filter(ba($i(e)))},Ol.prototype.slice=function(e,t){e=tr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ol(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=tr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Ol.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ol.prototype.toArray=function(){return this.take(4294967295)},rn(Ol.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Al[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Al.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ol,u=a[0],d=r||La(t),s=function(e){var t=i.apply(Al,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,m=!!this.__actions__.length,v=o&&!c,p=r&&!m;if(!o&&d){t=p?t:new Ol(this);var E=e.apply(t,a);return E.__actions__.push({func:ea,args:[s],thisArg:void 0}),new xl(E,c)}return v&&p?e.apply(this,a):(E=this.thru(s),v?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Al.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[l](function(l){return t.apply(La(l)?l:[],e)})}}),rn(Ol.prototype,function(e,t){var l=Al[t];if(l){var n=l.name+"";Te.call(gl,n)||(gl[n]=[]),gl[n].push({name:t,func:l})}}),gl[Ai(void 0,2).name]=[{name:"wrapper",func:void 0}],Ol.prototype.clone=function(){var e=new Ol(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},Ol.prototype.reverse=function(){if(this.__filtered__){var e=new Ol(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ol.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=La(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,m=0,v=ol(u,this.__takeCount__);if(!l||!n&&i==u&&v==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var E=-1,f=e[d+=t];++E<c;){var g=s[E],_=g.type,h=(0,g.iteratee)(f);if(2==_)f=h;else if(!h){if(1==_)continue e;break e}}p[m++]=f}return p},Al.prototype.at=ta,Al.prototype.chain=function(){return Jo(this)},Al.prototype.commit=function(){return new xl(this.value(),this.__chain__)},Al.prototype.next=function(){void 0===this.__values__&&(this.__values__=Ja(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Al.prototype.plant=function(e){for(var t,l=this;l instanceof Dl;){var n=Ao(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Al.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ol){var t=e;return this.__actions__.length&&(t=new Ol(this)),(t=t.reverse()).__actions__.push({func:ea,args:[Ho],thisArg:void 0}),new xl(t,this.__chain__)}return this.thru(Ho)},Al.prototype.toJSON=Al.prototype.valueOf=Al.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Al.prototype.first=Al.prototype.head,pt&&(Al.prototype[pt]=function(){return this}),Al}();Ge?((Ge.exports=Kt)._=Kt,Ve._=Kt):ze._=Kt}).call(De)});const At=e=>{var t,n,a;let{data:r,OpenImage:u}=e;const{t:d}=o.useTranslation();return i.createElement("div",null,r.date&&i.createElement("p",null,r.date),i.createElement("p",null,r.name),r.mobileNumber&&i.createElement(l.TelePhone,{mobile:r.mobileNumber}),r.source&&i.createElement("p",null,d("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),null!=r&&r.wfComment?i.createElement("div",null,null==r||null===(t=r.wfComment)||void 0===t?void 0:t.map(e=>i.createElement("div",{className:"TLComments"},i.createElement("h3",null,d("WF_COMMON_COMMENTS")),i.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(n=r.thumbnailsToShow)||void 0===n||null===(a=n.thumbs)||void 0===a?void 0:a.length)>0?i.createElement("div",{className:"TLComments"},i.createElement("h3",null,d("CS_COMMON_ATTACHMENTS")),i.createElement(l.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:()=>{u(null==r?void 0:r.thumbnailsToShow)}})):null)},It=e=>{var t,r,u,d,s,c;let m=null==e||null===(t=e.application)||void 0===t?void 0:t.bookingNo.split("-")[0];const{t:v}=o.useTranslation(),p="WT"==m?"watertanker":"MT"===m?"mobileToilet":"TP"===m?"treePruning":"unknown",E="WT"===m?"request-service.water_tanker":"MT"===m?"request-service.mobile_toilet":"TP"===m?"request-service.tree_pruning":"request-service.unknown",{isLoading:f,data:g}=Digit.Hooks.useWorkflowDetails({tenantId:null===(r=e.application)||void 0===r?void 0:r.tenantId,id:null===(u=e.application)||void 0===u?void 0:u.bookingNo,moduleCode:p});function _(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const h=t=>{if("OPEN"===t.state){var l,n;const o={date:null==t||null===(l=t.auditDetails)||void 0===l?void 0:l.lastModified,source:(null===(n=e.application)||void 0===n?void 0:n.channel)||""};return i.createElement(At,{data:o})}if(t.state){var o,a,r,u,d;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===(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 i.createElement(At,{data:e,OpenImage:_})}{var s,c;const l={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 i.createElement(At,{data:l})}};return f?i.createElement(l.Loader,null):i.createElement(i.Fragment,null,!f&&i.createElement(n.Fragment,null,(null==g||null===(d=g.timeline)||void 0===d?void 0:d.length)>0&&i.createElement(l.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=g&&g.timeline&&1===(null==g||null===(s=g.timeline)||void 0===s?void 0:s.length)?i.createElement(l.CheckPoint,{isCompleted:!0,label:v((null==g||null===(c=g.timeline[0])||void 0===c?void 0:c.state)&&""+g.timeline[0].state||"NA"),customChild:h(null==g?void 0:g.timeline[0])}):i.createElement(l.ConnectingCheckPoints,null,(null==g?void 0:g.timeline)&&(null==g?void 0:g.timeline.map((e,t)=>{var n;return i.createElement(i.Fragment,{key:t},i.createElement(l.CheckPoint,{keyValue:t,isCompleted:0===t,label:v(""+(null==g||null===(n=g.processInstances[t].state)||void 0===n?void 0:n.state)),customChild:h(e)}))})))),g&&(t=>{var n,o;let r=t[0];switch(null==r?void 0:r.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?i.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},i.createElement(a.Link,{to:{pathname:`/digit-ui/citizen/payment/my-bills/${E}/${null==e||null===(n=e.application)||void 0===n?void 0:n.bookingNo}`,state:{tenantId:e.application.tenantId,bookingNo:null==e||null===(o=e.application)||void 0===o?void 0:o.bookingNo}}},i.createElement(l.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==g?void 0:g.nextActions))},Dt=e=>i.createElement("span",{className:"cell-text"},e),xt=e=>i.createElement("span",{className:"sla-cell"},e),Ot=e=>{var t;let{searchParams:a,onFilterChange:u,defaultSearchParams:d,...s}=e;const{t:c}=o.useTranslation(),[m,v]=(r.useQueryClient(),n.useState(()=>({...a,services:[]}))),p=e=>{let t=e.delete,l={...m,...e};t&&t.forEach(e=>delete l[e]),delete e.delete,v({...l})},E=()=>{v({...d,services:[]}),u({...d})},f=Digit.ULBService.getCurrentTenantId();return i.createElement(i.Fragment,null,i.createElement("div",{className:"filter-card"},i.createElement("div",{className:"heading",style:{alignItems:"center"}},i.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},i.createElement("span",null,i.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"}))),i.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},c("ES_COMMON_FILTER_BY"),":")),i.createElement("div",{className:"clearAll",onClick:E},c("ES_COMMON_CLEAR_ALL")),"desktop"===s.type&&i.createElement("span",{className:"clear-search",onClick:E,style:{border:"1px solid #e0e0e0",padding:"6px"}},i.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"===s.type&&i.createElement("span",{onClick:s.onClose},i.createElement(l.CloseSvg,null))),i.createElement("form",{id:"filter-form"},i.createElement("div",{className:"filter-form-field"},i.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},c("ES_INBOX_LOCALITY"),":"),i.createElement(l.Localities,{selectLocality:e=>{p({locality:[...(null==m?void 0:m.locality)||[],e]})},tenantId:f,boundaryType:"revenue"}),i.createElement("div",{className:"tag-container hide-x-scrollbar"},null==m||null===(t=m.locality)||void 0===t?void 0:t.map((e,t)=>i.createElement(l.RemoveableTag,{key:t,text:c(e.i18nkey),onClick:()=>{p({locality:null==m?void 0:m.locality.filter(t=>t.code!==e.code)})}})))),i.createElement("div",null,i.createElement(l.SubmitBar,{className:"w-fullwidth",onSubmit:()=>{u(0===m.services.length?{...m,services:d.services}:m)},label:c("ES_COMMON_APPLY")})))))},Lt=e=>i.createElement("h1",{className:"heading-m"},e.label),wt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pt=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(wt,null)),Rt=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:g}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,h]=n.useState({}),[S,T]=n.useState({}),[b,y]=n.useState([]),[N,C]=n.useState(null),[A,I]=n.useState(null),[D,x]=n.useState(null),[O,L]=n.useState(null),[P,R]=n.useState([]),[k,M]=n.useState(null),[F,B]=n.useState(!1);function U(e){I(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&R(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;y(null==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(A){const e=function(){if(A.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",A,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?x(null==e||null===(n=e.data)||void 0===n||null===(i=n.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)}}()},[A]),n.useEffect(()=>{r&&h(null!=r&&r.showFinancialYearsModal?(e=>{let{t:t,action:n,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${n.action}_APPLICATION`,submit:"WF_PT.CREATE_"+n.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:t("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:i.createElement(l.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:n(m||"WF_ROLE_"+(null===(t=o.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PT_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:n("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:N,setSelectedApprover:C,selectFile:U,uploadedFile:D,setUploadedFile:x,businessService:m}))},[r,b,P,k,D]),r&&_.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Lt,{label:a(_.label.heading)}),headerBarEnd:i.createElement(Pt,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:E||(null==r?void 0:r.docUploadRequired)&&!D,formId:"modal-action"},f?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};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==k?void 0:k.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,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:m,moduleName:v};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]),s({Property:{...c,workflow:t}})}},defaultValues:S,formId:"modal-action"})):i.createElement(l.Loader,null)},kt=e=>i.createElement("h1",{className:"heading-m"},e.label),Mt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),Ft=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Mt,null)),Bt=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:p,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[f,g]=n.useState({}),[_,h]=n.useState({}),[S,T]=n.useState([]),[b,y]=n.useState({}),[N,C]=n.useState(null),[A,I]=n.useState(null),[D,x]=n.useState(null),[O,L]=n.useState([]),[P,R]=n.useState(null);function k(e){C(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;T(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{r&&g((e=>{let{t:t,action:n,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(null==n?void 0:n.action)||(m=!1),n.isTerminateState&&(m=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:m?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?i.createElement(l.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:k,uploadedFile:A,setUploadedFile:I,businessService:m}))},[r,S,O,P,A]),r&&f.form?i.createElement(l.Modal,{headerBarMain:i.createElement(kt,{label:a(f.label.heading)}),headerBarEnd:i.createElement(Ft,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},p?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:f.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:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:A}]:null},s({Licenses:[c]})},defaultValues:_,formId:"modal-action"})):i.createElement(l.Loader,null)},Ut=e=>i.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Wt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ht=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Wt,null)),jt=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m}=e;const{data:v,isLoading:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState({}),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function O(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))D(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",y,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==n?void 0:n.action)&&(v=!1),n.isTerminateState&&(v=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?i.createElement(l.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:O,uploadedFile:C,setUploadedFile:A,businessService:m,error:I}))},[r,h,C,I]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Ut,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Ht,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:x?{width:"720px"}:{},style:x?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:x?{paddingLeft:"5px"}:{}},p?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:E.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!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:C}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},zt=e=>i.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Vt=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gt=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Vt,null)),Kt=e=>{var t,o,a,u,d,s,c,m,v,p,E,f;let{t:g,action:_,tenantId:h,closeModal:S,submitAction:T,applicationDetails:b,applicationData:y,businessService:N,workflowDetails:C}=e;Digit.Hooks.obps.useObpsAPI(null!==(t=y)&&void 0!==t&&null!==(o=t.landInfo)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.city?null===(u=y)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:h,!1);const{data:A,isLoading:I}=Digit.Hooks.useEmployeeSearch(h,{roles:null==C||null===(c=C.data)||void 0===c||null===(m=c.initialActionState)||void 0===m||null===(v=m.nextActions)||void 0===v||null===(p=v.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===p||null===(E=p[0])||void 0===E||null===(f=E.assigneeRoles)||void 0===f?void 0:f.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[D,x]=(r.useQueryClient(),n.useState({})),[O,L]=n.useState({}),[P,R]=n.useState([]),[k,M]=n.useState({}),[F,B]=n.useState(null),[U,W]=n.useState(null),[H,j]=n.useState(null),[z,V]=n.useState(null),G=!!Digit.Utils.browser.isMobile();function K(e){B(e.target.files[0])}n.useEffect(()=>{var e;R(null==A||null===(e=A.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}}))},[A]),n.useEffect(()=>{!function(){try{j(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)j(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))j(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?W(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):j(g("CS_FILE_UPLOAD_ERROR"))})},function(){j(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)}}()},[F]);const Y=e=>{let t=[];return e&&e.map((e,l)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},$=e=>{let t=[];var l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},q=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Y(e.Documents),date:e.InspectionDate,questions:$(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},X=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...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&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},Q=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return n.useEffect(()=>{_&&x((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||E?null:n(m||"WF_ROLE_"+(null===(t=o.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:o.isTerminateState||E?null:i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:g,action:_,approvers:P,selectedApprover:k,setSelectedApprover:M,selectFile:K,uploadedFile:U,setUploadedFile:W,businessService:N,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[_,P,z,U,H]),_&&D.form?i.createElement(l.Modal,{headerBarMain:i.createElement(zt,{label:g(D.label.heading)}),headerBarEnd:i.createElement(Gt,{onClick:S}),actionCancelLabel:g(D.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:g(D.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:G?{width:"720px"}:{},style:G?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:G?{paddingLeft:"5px"}:{}},I?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:D.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a;y={...y,documents:X(),additionalDetails:{...null===(t=y)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(y),pendingapproval:Q()},workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:U?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:U?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null};const r=null==b||null===(i=b.nocData)||void 0===i?void 0:i.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 u={sourceRefId:null==r||null===(o=r[0])||void 0===o||null===(a=o.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(h,u)).then(function(e){var t;let l=!0,n=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=n||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(n=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,u,d,s,c,m,v,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(m=e.Noc)||void 0===m||null===(v=m.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&n)&&i.push(e)}),T({BPA:y},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:O,formId:"modal-action"})):i.createElement(l.Loader,null)},Yt=e=>i.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),$t=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),qt=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement($t,null)),Xt=e=>{var t,o;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:m,applicationData:v,businessService:p}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(t=d.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[g,_]=(r.useQueryClient(),n.useState({})),[h,S]=n.useState({}),[T,b]=n.useState([]),[y,N]=n.useState({}),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function P(e){A(e.target.files[0])}return a.useHistory(),n.useEffect(()=>{var e;b(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",C,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?D(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(u("CS_FILE_UPLOAD_ERROR"))})},function(){O(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{d&&_((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(E=!0);let f=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(f=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||f?null:n(m||"WF_ROLE_"+(null===(t=o.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:o.isTerminateState||f?null:i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:d,approvers:T,selectedApprover:y,setSelectedApprover:N,selectFile:P,uploadedFile:I,setUploadedFile:D,businessService:p,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:x}))},[d,T,I,x]),d&&g.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Yt,{label:u(g.label.heading)}),headerBarEnd:i.createElement(qt,{onClick:c}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(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"}:{}},f?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=v)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=v)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),v={...v,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,documents:I?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:I}]:null},documents:o},m({Noc:v},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):i.createElement(l.Loader,null)};function Qt(e){var t=this.__data__=new st(e);this.size=t.size}Qt.prototype.clear=function(){this.__data__=new st,this.size=0},Qt.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Qt.prototype.get=function(e){return this.__data__.get(e)},Qt.prototype.has=function(e){return this.__data__.has(e)},Qt.prototype.set=function(e,t){var l=this.__data__;if(l instanceof st){var n=l.__data__;if(!ct||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new pt(n)}return l.set(e,t),this.size=l.size,this};var Zt=Qt,Jt=function(){try{var e=et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),el=function(e,t,l){"__proto__"==t&&Jt?Jt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},tl=Object.prototype.hasOwnProperty,ll=function(e,t,l){var n=e[t];tl.call(e,t)&&at(n,l)&&(void 0!==l||t in e)||el(e,t,l)},nl=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?el(l,r,u):ll(l,r,u)}return l},il=function(e){return je(e)&&"[object Arguments]"==He(e)},ol=Object.prototype,al=ol.hasOwnProperty,rl=ol.propertyIsEnumerable,ul=il(function(){return arguments}())?il:function(e){return je(e)&&al.call(e,"callee")&&!rl.call(e,"callee")},dl=function(){return!1},sl=xe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?Pe.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||dl}),cl=/^(?:0|[1-9]\d*)$/,ml=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&cl.test(e))&&e>-1&&e%1==0&&e<t},vl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},pl={};pl["[object Float32Array]"]=pl["[object Float64Array]"]=pl["[object Int8Array]"]=pl["[object Int16Array]"]=pl["[object Int32Array]"]=pl["[object Uint8Array]"]=pl["[object Uint8ClampedArray]"]=pl["[object Uint16Array]"]=pl["[object Uint32Array]"]=!0,pl["[object Arguments]"]=pl["[object Array]"]=pl["[object ArrayBuffer]"]=pl["[object Boolean]"]=pl["[object DataView]"]=pl["[object Date]"]=pl["[object Error]"]=pl["[object Function]"]=pl["[object Map]"]=pl["[object Number]"]=pl["[object Object]"]=pl["[object RegExp]"]=pl["[object Set]"]=pl["[object String]"]=pl["[object WeakMap]"]=!1;var El=function(e){return function(t){return e(t)}},fl=xe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&Le.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),gl=fl&&fl.isTypedArray,_l=gl?El(gl):function(e){return je(e)&&vl(e.length)&&!!pl[He(e)]},hl=Object.prototype.hasOwnProperty,Sl=function(e,t){var l=Ie(e),n=!l&&ul(e),i=!l&&!n&&sl(e),o=!l&&!n&&!i&&_l(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!hl.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ml(d,u))||r.push(d);return r},Tl=Object.prototype,bl=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Tl)},yl=function(e,t){return function(l){return e(t(l))}},Nl=yl(Object.keys,Object),Cl=Object.prototype.hasOwnProperty,Al=function(e){return null!=e&&vl(e.length)&&!Ye(e)},Il=function(e){return Al(e)?Sl(e):function(e){if(!bl(e))return Nl(e);var t=[];for(var l in Object(e))Cl.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Dl=Object.prototype.hasOwnProperty,xl=function(e){return Al(e)?Sl(e,!0):function(e){if(!Ke(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=bl(e),l=[];for(var n in e)("constructor"!=n||!t&&Dl.call(e,n))&&l.push(n);return l}(e)},Ol=xe(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?Pe.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Ll=function(){return[]},wl=Object.prototype.propertyIsEnumerable,Pl=Object.getOwnPropertySymbols,Rl=Pl?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];wl.call(e,r)&&(a[o++]=r)}return a}(Pl(e)))}:Ll,kl=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},Ml=yl(Object.getPrototypeOf,Object),Fl=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)kl(t,Rl(e)),e=Ml(e);return t}:Ll,Bl=function(e,t,l){var n=t(e);return Ie(e)?n:kl(n,l(e))},Ul=function(e){return Bl(e,Il,Rl)},Wl=function(e){return Bl(e,xl,Fl)},Hl=et(Pe,"DataView"),jl=et(Pe,"Promise"),zl=et(Pe,"Set"),Vl=et(Pe,"WeakMap"),Gl=Qe(Hl),Kl=Qe(ct),Yl=Qe(jl),$l=Qe(zl),ql=Qe(Vl),Xl=He;(Hl&&"[object DataView]"!=Xl(new Hl(new ArrayBuffer(1)))||ct&&"[object Map]"!=Xl(new ct)||jl&&"[object Promise]"!=Xl(jl.resolve())||zl&&"[object Set]"!=Xl(new zl)||Vl&&"[object WeakMap]"!=Xl(new Vl))&&(Xl=function(e){var t=He(e),l="[object Object]"==t?e.constructor:void 0,n=l?Qe(l):"";if(n)switch(n){case Gl:return"[object DataView]";case Kl:return"[object Map]";case Yl:return"[object Promise]";case $l:return"[object Set]";case ql:return"[object WeakMap]"}return t});var Ql=Xl,Zl=Object.prototype.hasOwnProperty,Jl=Pe.Uint8Array,en=function(e){var t=new e.constructor(e.byteLength);return new Jl(t).set(new Jl(e)),t},tn=/\w*$/,ln=Re?Re.prototype:void 0,nn=ln?ln.valueOf:void 0,on=Object.create,an=function(){function e(){}return function(t){if(!Ke(t))return{};if(on)return on(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),rn=fl&&fl.isMap,un=rn?El(rn):function(e){return je(e)&&"[object Map]"==Ql(e)},dn=fl&&fl.isSet,sn=dn?El(dn):function(e){return je(e)&&"[object Set]"==Ql(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 mn=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!Ke(t))return t;var c=Ie(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Zl.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!u)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var m=Ql(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(sl(t))return Ol(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!o){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||bl(e)?{}:an(Ml(e))}(t),!u)return d?function(e,t){return nl(e,Fl(e),t)}(t,function(e,t){return e&&nl(t,xl(t),e)}(r,t)):function(e,t){return nl(e,Rl(e),t)}(t,function(e,t){return e&&nl(t,Il(t),e)}(r,t))}else{if(!cn[m])return o?t:{};r=function(e,t,l){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return en(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return function(e,t){var l=t?en(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);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 l=t?en(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,tn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new n;case"[object Symbol]":return nn?Object(nn.call(e)):{}}}(t,m,u)}}a||(a=new Zt);var p=a.get(t);if(p)return p;a.set(t,r),sn(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):un(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?Wl:Ul:d?xl:Il)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),ll(r,o,e(i,l,n,o,t,a))}),r},vn=function(e){return mn(e,5)};const pn=e=>i.createElement("h1",{className:"heading-m"},e.label),En=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),fn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(En,null)),gn=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},_n=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,cardClassName:v,cardFormWrapperClassName:E,cardFormClassName:f,formClassName:g}=e;const{data:_,isLoading:h}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,T]=n.useState({}),[b,y]=n.useState({}),[N,C]=n.useState([]),[A,I]=n.useState({}),[D,x]=n.useState(null),[O,L]=n.useState(null),[P,R]=n.useState(null),k=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){x(e.target.files[0])}return n.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))R(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",D,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),R(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)}}()},[D]),n.useEffect(()=>{var e,t,n,o;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=c)||void 0===n||null===(o=n.processInstance)||void 0===o?void 0:o.businessService)?r&&T((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,E=!0,f=!1;return(null!=o&&null!==(t=o.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(E=!1),o.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(f=!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:E?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},f&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>i.createElement(l.DatePicker,p({onChange:e.onChange,date:e.value},t))}:null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:N,selectedApprover:A,setSelectedApprover:I,selectFile:F,uploadedFile:O,setUploadedFile:L,businessService:m,error:P})):r&&T((e=>{var t;let{t:n,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,p=!0;return(null!=o&&null!==(t=o.action)&&void 0!==t&&t.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==m?void 0:m.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?i.createElement(l.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:i.createElement(l.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:N,selectedApprover:A,setSelectedApprover:I,selectFile:F,uploadedFile:O,setUploadedFile:L,businessService:m,error:P}))},[r,N,O,P]),r&&S.form?i.createElement(l.Modal,{headerBarMain:i.createElement(pn,{label:a(S.label.heading)}),headerBarEnd:i.createElement(fn,{onClick:d}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:k&&M?{width:"100%",height:"auto"}:{}},h?i.createElement(l.Loader,null):i.createElement(l.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,m,v,p;if(null!==(t=c)&&void 0!==t&&t.isBillAmend){var E,f,g,_,h,S,T,b,y;const t={...null===(E=c)||void 0===E||null===(f=E.billAmendmentDetails)||void 0===f?void 0:f.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(g=c)||void 0===g?void 0:g.billAmendmentDetails,workflow:{businessId:null===(_=c)||void 0===_||null===(h=_.billAmendmentDetails)||void 0===h?void 0:h.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=c)&&void 0!==S&&null!==(T=S.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=c)&&void 0!==b&&null!==(y=b.applicationType)&&void 0!==y&&y.includes("WATER")?"WS":"SW",assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:[]}};s({AmendmentUpdate:l})}else{if(c={...c,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:[],assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:null,processInstance:{...null===(l=c)||void 0===l?void 0:l.processInstance,action:null==r?void 0:r.action,assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:[]}},null!=e&&e.date&&null!==(n=c)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=vn(null==e?void 0:e.date);c.disconnectionExecutionDate=gn(t)}else if(null!=e&&e.date){const t=vn(null==e?void 0:e.date);c.connectionExecutionDate=gn(t)}var N;if("DisconnectWSConnection"==(null===(o=c)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=c)||void 0===d||null===(m=d.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(N=c)||void 0===N?void 0:N.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=c)||void 0===v?void 0:v.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(p=c)||void 0===p?void 0:p.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var C,I,x,L,w,P,R,k,M,F,B,U,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(C=t.value)&&void 0!==C&&C.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(W=c)||void 0===W?void 0:W.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:b,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:E,cardClassName:v,formClassName:g})):i.createElement(l.Loader,null)},hn=e=>i.createElement("h1",{className:"heading-m"},e.label),Sn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Sn,null)),bn=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;console.log("applicationData",c);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_PTR_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:t("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_PTR_ACTION_FILEUPLOADED"):t("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:A,businessService:m}))},[r,h,C]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(hn,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Tn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v};C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,filestoreId:C}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},yn=e=>i.createElement("h1",{className:"heading-m"},e.label),Nn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Nn,null)),An=e=>{var t,o,r;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:m,applicationData:v,businessService:p,moduleCode:E,cardClassName:f,cardFormWrapperClassName:g,cardFormClassName:_,formClassName:h}=e;const{data:S}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(t=d.roles)||void 0===t||null===(o=t[0])||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),T=a.useHistory(),[b,y]=n.useState({}),[N,C]=n.useState({}),[A,I]=n.useState([]),[D,x]=n.useState(null),[O,L]=n.useState(null);return n.useEffect(()=>{var e;I(null==S||null===(e=S.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}}))},[S]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?T.push("/digit-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.applicationNo)):y((e=>{let{t:t,action:l,businessService:n}=e;return console.log("njhsegfdhjsbedwfdwe",l),{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:A,selectedApprover:D,setSelectedApprover:x,uploadedFile:O,setUploadedFile:L,businessService:p}))},[d,A,O]),d&&b.form?i.createElement(l.Modal,{headerBarMain:i.createElement(yn,{label:u(b.label.heading)}),headerBarEnd:i.createElement(Cn,{onClick:c}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:E};O&&(t.documents=[]),m({Asset:{...v,workflow:t}})},defaultValues:N,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:g,cardClassName:f,formClassName:h})):i.createElement(l.Loader,null)},In=e=>i.createElement("h1",{className:"heading-m"},e.label),Dn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),xn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Dn,null)),On=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(!1);function L(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",y,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r}=e;return{label:{heading:"CHB_"+(null==n?void 0:n.action),submit:"CHB_"+(null==n?void 0:n.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:t("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("ES_CHB_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+t("CS_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:A,businessService:m}))},[r,h,C]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(In,{label:a(E.label.heading)}),headerBarEnd:i.createElement(xn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:v};C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:C}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},Ln=e=>i.createElement("h1",{className:"heading-m"},e.label),wn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(wn,null)),Rn=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;console.log("snjdskbjdfbjskfjkbs",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(null),[L,P]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?D(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;console.log("action",n);const d=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",d),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==n?void 0:n.state)?{label:t("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==n?void 0:n.state)?{label:t("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==n?void 0:n.state)?{label:t("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:t("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_EW_PHOTO")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:t("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_EW_ACTION_FILEUPLOADED"):t("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:R,uploadedFile:I,setUploadedFile:D,businessService:m}))},[r,h,I]),console.log("conggg",E),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Ln,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Pn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v};console.log("applicationData",e),I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:I},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},kn=e=>i.createElement("h1",{className:"heading-m"},e.label),Mn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Fn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Mn,null)),Bn=e=>{var t,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:m,moduleCode:v}=e;const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(t=r.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,f]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[T,b]=n.useState(null),[y,N]=n.useState(null),[C,A]=n.useState(null),[I,D]=n.useState(null),[x,O]=n.useState(!1);function L(e){O(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)D(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",y,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?A(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):D(a("CS_FILE_UPLOAD_ERROR"))})},function(){D(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(O(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),console.log("actyhdesh,jhfsefsef",r,c),n.useEffect(()=>{f((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const m=()=>i.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:"SV_"+(null==n?void 0:n.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==n?void 0:n.action)||"REJECT"===(null==n?void 0:n.action)||"SENDBACKTOCITIZEN"===(null==n?void 0:n.action)?"":{label:t("SV_ASSIGNEE"),type:"dropdown",populators:i.createElement(l.Dropdown,{option:u,t:t,optionKey:"name",select:s,selected:d})},{label:t("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("SV_ATTATCH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement(m,null),i.createElement("span",null,"Uploading...")):a?"1 "+t("SV_FILE_UPLOADED"):t("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:T,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:A,businessService:m,isUploading:x}))},[r,h,C]),r&&E.form?i.createElement(l.Modal,{headerBarMain:i.createElement(kn,{label:a(E.label.heading)}),headerBarEnd:i.createElement(Fn,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null};C&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:C}]),s({streetVendingDetail:{...c,workflow:l}})},defaultValues:g,formId:"modal-action"})):i.createElement(l.Loader,null)},Un=e=>i.createElement("h1",{className:"heading-m"},e.label),Wn=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Wn,null)),jn=e=>{var t,o,a,r,u;let{t:d,action:s,tenantId:c,closeModal:m,submitAction:v,applicationData:p,businessService:E,moduleCode:f,cardClassName:g,cardFormWrapperClassName:_,cardFormClassName:h,formClassName:S}=e;const{data:T}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(t=s.assigneeRoles)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:b}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let y=[];null==b||null===(a=b.vendor)||void 0===a||a.forEach(e=>{var t,l;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.serviceType)){var n;const t=`${null==e?void 0:e.name} (${null==e||null===(n=e.owner)||void 0===n?void 0:n.mobileNumber})`;y.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:N}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let C=[];null==N||null===(r=N.vehicle)||void 0===r||null===(u=r.filter(e=>{var t,l;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.id)}))||void 0===u||u.map(e=>{var t,l;C.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(l=e.driver)||void 0===l?void 0:l.ownerId)})});const[A,I]=n.useState({}),[D,x]=n.useState({}),[O,L]=n.useState([]),[P,R]=n.useState(null),[k,M]=n.useState(null),[F,B]=n.useState(null),[U,W]=n.useState(null),[H,j]=n.useState(null);function z(e){R(e.target.files[0])}return n.useEffect(()=>{var e;L(null==T||null===(e=T.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}}))},[T]),n.useEffect(()=>{!function(){try{B(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)B(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",P,c)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?M(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(d("CS_FILE_UPLOAD_ERROR"))})},function(){B(d("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)}}()},[P]),n.useEffect(()=>{s&&I((e=>{let{t:t,action:n,selectFile:o,uploadedFile:a,setUploadedFile:r,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:m,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==n?void 0:n.action),submit:"RS_"+(null==n?void 0:n.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:t("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==n?void 0:n.state)&&"ASSIGN_VEHICLE_DRIVER"!==(null==n?void 0:n.action)?{label:t("RS_ASSIGN"),type:"dropdown",populators:i.createElement(l.Dropdown,{option:s,t:t,optionKey:"i18nKey",select:d,selected:u})}:"null","DELIVERY_PENDING"===(null==n?void 0:n.state)||"ASSIGN_VEHICLE_DRIVER"===(null==n?void 0:n.action)?{label:t("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:i.createElement(l.Dropdown,{option:c,t:t,optionKey:"i18nKey",select:v,selected:m})}:"null",{label:`${t("ES_RS_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:i.createElement(l.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:a?"1 "+t("CS_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:d,action:s,selectFile:z,uploadedFile:k,setUploadedFile:M,selectedVendor:U,setSelectedVendor:W,vendorDescription:b?y:void 0,vehicleDescription:N||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?C:void 0,selectVehicle:H,setSelectVehicle:j}))},[s,O,k,b,H,N]),s&&A.form?i.createElement(l.Modal,{headerBarMain:i.createElement(Un,{label:d(A.label.heading)}),headerBarEnd:i.createElement(Hn,{onClick:m}),actionCancelLabel:d(A.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:d(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},i.createElement(l.FormComposer,{config:A.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:E,moduleName:f};k&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:k}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(p.vendorId=null==U?void 0:U.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(p.vehicleId=null==H?void 0:H.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(p.vehicleId=null==H?void 0:H.vehicleId,p.driverId=null==H?void 0:H.driverId);let l="watertanker"===E?{waterTankerBookingDetail:{...p,workflow:t}}:{mobileToiletBookingDetail:{...p,workflow:t}};v(l)},defaultValues:D,formId:"modal-action",cardFormClassName:h,cardFormWrapperClassName:_,cardClassName:g,formClassName:S})):i.createElement(l.Loader,null)},zn=e=>null!=e&&e.businessService.includes("PT")?i.createElement(Rt,e):null!=e&&e.businessService.includes("ptr")?i.createElement(bn,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")?i.createElement(Bt,e):null!=e&&e.moduleCode.includes("BPAREG")?i.createElement(jt,e):null!=e&&e.moduleCode.includes("BPA")?i.createElement(Kt,e):null!=e&&e.moduleCode.includes("NOC")?i.createElement(Xt,e):null!=e&&e.moduleCode.includes("WS")?i.createElement(_n,e):null!=e&&e.businessService.includes("asset-create")?i.createElement(An,e):null!=e&&e.businessService.includes("ewst")?i.createElement(Rn,e):null!=e&&e.businessService.includes("booking-refund")?i.createElement(On,e):null!=e&&e.businessService.includes("street-vending")?i.createElement(Bn,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?i.createElement(jn,e):void 0;function Vn(e){let{documents:t,svgStyles:n={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return i.createElement("div",{style:{marginTop:"19px"}},!s&&(null==t?void 0:t.map((e,n)=>{var o;return i.createElement(i.Fragment,{key:n},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,i.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((e,t)=>{var n;return i.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:t},i.createElement("div",{style:{display:"flex",justifyContent:"center"}},i.createElement(l.PDFSvg,null)),i.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},d(null==e?void 0:e.title)),a?null!=e&&null!==(n=e.documentType)&&void 0!==n&&n.includes("NOC")?i.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):i.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&i.createElement("div",null,i.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==t?void 0:t.length)!=n+1?i.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==t?void 0:t.map((e,t)=>{var o;return i.createElement(i.Fragment,{key:t},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,i.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>i.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=n&&n.minWidth?null==n?void 0:n.minWidth:"160px",marginRight:"20px"},key:t},i.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},i.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?i.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,i.createElement(l.PDFSvg,null),i.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")&&i.createElement("div",null,i.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Gn=e=>{var t,l;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],m=Digit.ULBService.getStateId(),[v,p]=n.useState((null==a||null===(l=a.documents)||void 0===l?void 0:l.documents)||[]),[E,f]=n.useState(null),[g,_]=n.useState([]),[h,S]=n.useState(!0),[T,b]=n.useState(!1),[y,N]=n.useState(!1),{isLoading:C,data:A}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:I,data:D}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=A&&null!==(e=A.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==A||null===(o=A.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;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===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==D||null===(t=D["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===`${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0]}.${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),_(d)},[!C,!I]),n.useEffect(()=>{let e=0;g.map(t=>{let l=!1;v.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,T]),n.useEffect(()=>{N("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),i.createElement("div",null,null==g?void 0:g.map((e,t)=>i.createElement("div",null,i.createElement(Kn,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:y}))))};function Kn(e){var t,o;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:m}=e;const v=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],p=Digit.ULBService.getStateId(),[E,f]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==r||null===(t=r.dropdownData)||void 0===t?void 0:t.length)?null==r?void 0:r.dropdownData[0]:{}),[g,_]=n.useState(null),[h,S]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[T,b]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==h?void 0:h.length)||null===h?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==E?void 0:E.code,fileStoreId:h,documentUid:h,fileName:(null==g?void 0:g.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[h,E]),n.useEffect(()=>{try{T.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],T.map(e=>{var t,l,n;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[T,E]),n.useEffect(()=>{},[g]),i.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},i.createElement(l.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)&&i.createElement(Vn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?i.createElement("div",{style:{marginTop:"20px"}},i.createElement(l.LabelFieldPair,{style:{width:"100%"}},i.createElement(l.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),i.createElement(l.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>f(e),style:{width:"100%"}})),i.createElement(l.LabelFieldPair,{style:{width:"100%"}},i.createElement(l.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),i.createElement("div",{className:"field",style:{width:"100%"}},i.createElement(l.MultiUploadWrapper,{module:"BPA",tenantId:p,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&b(n),(i=n[n.length-1])&&_(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Yn(e){let{fiReport:t,isCitizen:n=!1}=e;const{t:a}=o.useTranslation();return i.createElement(i.Fragment,null,i.createElement("div",{style:{marginTop:"10px"}},i.createElement(n?l.CardHeader:l.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),t.map((e,n)=>{var o,r,u,d,s,c;return i.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},i.createElement(l.StatusTable,null,i.createElement(l.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==t?void 0:t.length)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${n+1}`),i.createElement(l.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(o=e.date)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.date)||void 0===r?void 0:r.split("-")[1]}/${null===(u=e.date)||void 0===u?void 0:u.split("-")[0]}`:null==e?void 0:e.date:"NA"}),i.createElement(l.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>i.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},i.createElement(l.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),i.createElement(l.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),i.createElement(Vn,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function $n(e){let{t:t,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,m]=n.useState(),[v,p]=n.useState(null),[E,f]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==E?void 0:E.length)||null===E?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:E,documentUid:E,fileName:(null==v?void 0:v.name)||""}]})},[E]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,l=function(){if(v.size>=5242880)r(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const l=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(t("NOT_SUPPORTED_FILE_TYPE"));else{const e=w(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var l,n,i,o;(null==e||null===(l=e.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?f(null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId):r(t("CS_FILE_UPLOAD_ERROR"))})},function(){r(t("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(l&&l.then)return l.then(function(){})}}();if(l&&l.then)return l.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),i.createElement("div",{style:{}},i.createElement(l.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},i.createElement(l.CardLabel,{style:{width:"100%"}},null!=o&&o.required?t("TL_BUTTON_UPLOAD FILE")+"*":""+t("TL_BUTTON_UPLOAD FILE")),i.createElement("div",{className:"field",style:{width:"100%"}},i.createElement(l.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&p(n.file)})(e),t:t,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const qn=e=>{var t;let{t:o,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const m=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",p=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[_,h]=n.useState([]),[S,T]=n.useState([]),[b,y]=n.useState(!1),[N,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[A,I]=n.useState(null),D=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,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.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==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;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===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[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(n[0].docTypes[0]));let m=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),m.push(e)}),T(m))},[E,_]),n.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===v&&(null==p?void 0:p.length)>0)},[d,c]),i.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},i.createElement(l.StatusTable,null,i.createElement(l.Row,{label:D?""+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,t)=>{if(null!=e&&e.value)return i.createElement(l.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:D?""+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:"#2E9E8F"}:{color:"#D83A2F"}}:{className:"border-none",label:D?""+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")})})),i.createElement(Vn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>i.createElement($n,{key:t,document:e,t:o,error:A,setError:I,setNocDocuments:C,nocDocuments:N,checkEnablingDocs:b}))))},Xn=e=>{let{permissions:t,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==t?void 0:t.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return i.createElement("div",null,i.createElement(l.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,t)=>i.createElement(l.CheckBox,{key:t,styles:{margin:"20px 0 40px",maxWidth:m?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?{...e,checked:n}:e))})(e,0,t),isLabelFirst:!0,index:t})),null==d?void 0:d.map((e,t)=>i.createElement("div",null,i.createElement(l.TextInput,{key:t,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,t),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),i.createElement(l.LinkButton,{label:i.createElement("div",null,i.createElement("span",null,i.createElement(l.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(t)}))),i.createElement(l.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Qn(e){let{documents:t,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,m]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let l=[];null==t||t.forEach((e,t,n)=>{l=[...l,...e.values?e.values:[]]}),s(null===(e=l)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[t]),n.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==t||null===(e=t[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{m(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{m(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),p=window.location.href.includes("stakeholder");return i.createElement("div",{style:{marginTop:"19px"}},!p&&(null==t?void 0:t.map((e,t)=>{var n;return i.createElement(i.Fragment,{key:t},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:v?{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,i.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===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n,o;return i.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},i.createElement("div",{style:{display:"flex",justifyContent:"center"}},i.createElement(l.PDFSvg,null)),i.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?i.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):i.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&i.createElement("div",null,i.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),p&&(null==t?void 0:t.map((e,t)=>{var n;return i.createElement(i.Fragment,{key:t},null!=e&&e.title?i.createElement(l.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,i.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return i.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:t},i.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},i.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?i.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,i.createElement(l.PDFSvg,null),i.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")&&i.createElement("div",null,i.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Zn(e){let{taxHeadEstimatesCalculation:t}=e;const{taxHeadEstimates:n}=t,{t:a}=o.useTranslation();return i.createElement("div",{style:{marginTop:"40px"}},i.createElement(l.StatusTable,null,i.createElement(l.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),i.createElement(l.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==n?void 0:n.map((e,t)=>i.createElement(l.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:t===(null==n?void 0:n.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),i.createElement(l.BreakLine,{style:{margin:"16px 0",width:"40%"}}),i.createElement(l.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==t?void 0:t.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Jn(e){let{floors:t}=e;const{t:n}=o.useTranslation();return i.createElement(i.Fragment,null,t.map(e=>{var t;return i.createElement("div",{key:n(null==e?void 0:e.title),style:{marginTop:"19px"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},n(null==e?void 0:e.title)),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,t)=>{var o;return i.createElement(i.Fragment,{key:t},i.createElement(l.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==t?"16px":"revert"}},n(e.title)),i.createElement(l.StatusTable,{style:{position:"relative",padding:"8px"}},i.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>{var o;return i.createElement(l.Row,!0===e.map&&"N/A"!==e.value?{key:n(e.title),label:n(e.title),text:i.createElement("img",{src:n(e.value),alt:""})}:{key:n(e.title),label:n(e.title),text:n(e.value)||"N/A",last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function ei(e){let{owners:t}=e,n={};n=window.location.href.includes("/employee/pt/")?t.slice().reverse():t;const{t:a}=o.useTranslation(),r=(null==t?void 0:t.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),t.sort((e,t)=>{var l,n;return(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.ownerSequence)-(null==t||null===(n=t.additionalDetails)||void 0===n?void 0:n.ownerSequence)}),i.createElement(i.Fragment,null,i.createElement("div",{className:"owner-details"},n.map((e,t)=>{var n;return i.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},i.createElement(l.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)} ${t+1}`:a(null==e?void 0:e.title)),i.createElement(i.Fragment,{key:t},i.createElement(l.StatusTable,{style:d},i.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return!0===e.map&&"N/A"!==e.value?i.createElement(l.Row,{key:a(e.title),label:a(e.title),text:i.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):i.createElement("span",null,i.createElement(l.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const ti=e=>{var t,a,r;let{scrutinyDetails:u,paymentsList:d=[]}=e;const{t:s}=o.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?i.createElement("span",{style:{color:"#2E9E8F"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return i.createElement(n.Fragment,null,!(null!=u&&u.isChecklist)&&i.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},i.createElement(l.StatusTable,null,i.createElement("div",null,null==u||null===(t=u.values)||void 0===t?void 0:t.map((e,t)=>null!=e&&e.isUnit?i.createElement(l.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:""+s(""+e.title),text:null!=e&&e.value?`${c(e)} ${s(null==e?void 0:e.isUnit)}`:s("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?i.createElement(l.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:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):i.createElement(l.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):i.createElement(l.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(a=u.permit)||void 0===a?void 0:a.map((e,t)=>i.createElement(l.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),i.createElement("div",null,null==u||null===(r=u.scruntinyDetails)||void 0===r?void 0:r.map((e,t)=>i.createElement(n.Fragment,null,i.createElement(l.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),i.createElement("a",{href:null==e?void 0:e.value}," ",i.createElement(l.PDFSvg,null)," "),i.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},li=e=>{var t,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:m}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=n.useMemo(()=>p.map(e=>({Header:m(""+e.name),accessor:E(e.id),id:e.id})));function g(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:m("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:m(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.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===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:m("BPA_FLOOR_NAME_"+e.number)})}),l}function _(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+m("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return i.createElement(n.Fragment,null,i.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},i.createElement(l.StatusTable,null,null==s||null===(t=s.values)||void 0===t?void 0:t.map((e,t)=>null!=e&&e.isHeader?i.createElement(l.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},m(null==e?void 0:e.title)):i.createElement(l.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+m(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,t)=>{var n,o,a,r,u;return i.createElement("div",{key:t,style:(null==s||null===(n=s.subOccupancyTableDetails)||void 0===n||null===(o=n[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},m("BPA_BLOCK_SUBHEADER")," ",t+1),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+m("BPA_SUB_OCCUPANCY_LABEL"),text:_(t)})),i.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},i.createElement(l.Table,{className:"customTable table-fixed-first-column table-border-style",t:m,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:f,getCellProps:e=>({style:{}})})))})))},ni=e=>{let{headComment:t,otherComment:l}=e;return i.createElement("div",{className:"checkpoint-comments-wrap"},i.createElement("h4",null,t),i.createElement("p",null,l))},ii=e=>{var t,n,a;let{data:r,OpenImage:u,privacy:d={}}=e;const{t:s}=o.useTranslation();return i.createElement("div",null,r.date&&i.createElement("p",null,r.date),i.createElement("p",null,r.name),r.mobileNumber&&i.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},i.createElement(l.TelePhone,{mobile:r.mobileNumber,privacy:d}),i.createElement("p",null," ")),r.source&&i.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&i.createElement(ni,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?i.createElement("div",null,null==r||null===(t=r.wfComment)||void 0===t?void 0:t.map((e,t)=>i.createElement("div",{className:"TLComments",key:t},i.createElement("h3",null,s("WF_COMMON_COMMENTS")),i.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(n=r.thumbnailsToShow)||void 0===n||null===(a=n.thumbs)||void 0===a?void 0:a.length)>0?i.createElement("div",{className:"TLComments"},i.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),i.createElement(l.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function oi(e){let{units:t}=e;const{t:n}=o.useTranslation();return i.createElement(i.Fragment,null,t.map((e,t)=>{var o;return i.createElement("div",{key:n(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"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${n(null==e?void 0:e.title)} ${t+1}`),i.createElement(i.Fragment,{key:t},i.createElement(l.StatusTable,{style:{position:"relative",marginTop:"19px"}},i.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>{var o;return i.createElement(l.Row,!0===e.map&&"N/A"!==e.value?{key:n(e.title),label:n(e.title),text:i.createElement("img",{src:n(e.value),alt:""})}:{key:n(e.title),label:n(e.title)+":",text:n(e.value)||"N/A",last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function ai(e){let{units:t}=e;const{t:n}=o.useTranslation();return i.createElement(i.Fragment,null,t.map((e,t)=>{var o;return i.createElement("div",{key:n(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"}},i.createElement(l.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${n(null==e?void 0:e.title)} ${t+1}`),i.createElement(i.Fragment,{key:t},i.createElement(l.StatusTable,{style:{position:"relative",marginTop:"19px"}},i.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,t)=>{var o;return i.createElement(l.Row,!0===e.map&&"N/A"!==e.value?{key:n(e.title),label:n(e.title),text:i.createElement("img",{src:n(e.value),alt:""})}:{key:n(e.title),label:n(e.title)+":",text:n(e.value)||"NA",last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const ri=e=>{var t,n,a,r;let{wsAdditionalDetails:u}=e;const{t:d}=o.useTranslation();let s=(c=location.search)?(/^[?#]/.test(c)?c.slice(1):c).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var c;const m=null==s?void 0:s.mode;var{connectionDetails:v,plumberDetails:p,roadCuttingDetails:E,activationDetails:f}=(null==u?void 0:u.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return i.createElement(i.Fragment,null,i.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==u||null===(t=u.additionalDetails)||void 0===t?void 0:t.connectionDetails)&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_CONNECTION_DETAIL")),i.createElement("div",null,i.createElement("div",{className:"connection-details-new-value-wrapper"},null==v?void 0:v.map((e,t)=>i.createElement("div",{key:t},i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==u||null===(n=u.additionalDetails)||void 0===n?void 0:n.plumberDetails)&&"MODIFY"!=m&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),i.createElement("div",null,i.createElement("div",{className:"plumber-details-new-value-wrapper"},null==p?void 0:p.map((e,t)=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==u||null===(a=u.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=m&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ROAD_CUTTING_DETAILS")),i.createElement("div",null,i.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,t)=>{var n;return i.createElement("div",{key:t,style:(null==E?void 0:E.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=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.activationDetails)&&i.createElement(l.StatusTable,null,i.createElement(l.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),i.createElement("div",null,i.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,t)=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},ui=[{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"}],di=[{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"}],si=e=>{var t,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[c,m,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==d||null===(t=d.additionalDetails)||void 0===t||!t.isPaid),[S,T]=n.useState(!1),[b,y]=n.useState(c||{}),[N,C]=n.useState(null),[A,I]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[D,x]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),O=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(O,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,l;const n={...null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==c||null===(l=c.billDetails)||void 0===l?void 0:l.length)>0){var o,a,r,u,s,v,p;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:i.createElement("span",null,"₹",null==c||null===(o=c.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:i.createElement("span",null,"₹",null==c||null===(r=c.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:i.createElement("span",null,"₹",null==c||null===(s=c.billDetails)||void 0===s||null===(v=s[0])||void 0===v?void 0:v.taxAmount)}];x(e),I(null==c||null===(p=c.billDetails)||void 0===p?void 0:p[0])}else m(n),y(n)},[]);let L={};const w=e=>i.createElement("h1",{className:"heading-m"},e.label),P=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),R=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(P,null)),k=function(e,t,l){void 0===t&&(t=!1);let n={...b};if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}y(n)};return i.createElement(n.Fragment,null,i.createElement("div",{style:{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}},D&&i.createElement(l.StatusTable,null,i.createElement("div",null,null==D?void 0:D.map((e,t)=>i.createElement(l.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),i.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),i.createElement("div",null,i.createElement(l.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:i.createElement("span",null,"₹",(null==A?void 0:A.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),i.createElement(l.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#2E9E8F"}:{color:"#D83A2F"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?i.createElement("div",{onClick:e=>{T(!0)}},i.createElement("span",{className:"add-details-link hover-button",style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&i.createElement(l.Modal,{headerBarMain:i.createElement(w,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:i.createElement(R,{onClick:()=>{y(c),T(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{y(c),T(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,l=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var n,i;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,c,v,p,E,g,h;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l={...null==d||null===(c=d.additionalDetails)||void 0===c||null===(v=c.appDetails)||void 0===v?void 0:v.additionalDetails,...b};d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(p=d.additionalDetails)||void 0===p||null===(E=p.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(g=d.additionalDetails)||void 0===g||null===(h=g.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,p,E,g,h;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(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}];f(vn(e.Calculation[0])),I(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),x(S),b.billDetails=null==e?void 0:e.Calculation,m(b),T(!1)}).catch(e=>{var t,l,n,i,o,a;C({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto",background:"#f0f3f7"}},i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},i.createElement(l.Card,null,i.createElement(l.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,s("PT_TX_HEADS")),i.createElement("div",{className:"field"},i.createElement(l.Dropdown,{isMandatory:!0,option:ui,optionKey:"title",select:e=>k("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s}))),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,s("PT_REASON")),i.createElement("div",{className:"field"},i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},L={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,s("PT_HEAD_AMT")),i.createElement("div",{className:"field"},i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},L={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))),i.createElement(l.Card,null,i.createElement(l.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,s("PT_TX_HEADS")),i.createElement("div",{className:"field"},i.createElement(l.Dropdown,{isMandatory:!0,option:di,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s}))),"PT_OTHERS"===(null==b||null===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,s("PT_REASON")),i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},L={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),i.createElement(l.LabelFieldPair,null,i.createElement(l.CardLabel,null,s("PT_HEAD_AMT")),i.createElement("div",{className:"field"},i.createElement(l.TextInput,p({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},L={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))))),N&&i.createElement(l.Toast,{style:{zIndex:"10000"},warning:null==N?void 0:N.isWarning,error:null==N||!N.isWarning,label:s(null==N?void 0:N.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},ci=e=>{let{style:t}=e;return i.createElement("span",null,i.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"})))},mi=e=>{let{t:t,userType:n=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;n=n||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return i.createElement(i.Fragment,null,i.createElement("div",{style:d?{}:{width:"80%"}},i.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},i.createElement("div",null,i.createElement(l.InfoBannerIcon,null),i.createElement("h2",{style:{color:"#3498DB"}},t(o))),t(a)+" ",i.createElement(ci,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),i.createElement("div",null," "+t(u)))))},vi=e=>{var t,a,r,u,d,s,c;let{wsAdditionalDetails:m}=e;const{t:v}=o.useTranslation(),[p,E]=n.useState(!1),[f,g]=n.useState({}),_=e=>i.createElement("h1",{className:"heading-m"},e.label),h=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(h,null));return i.createElement(n.Fragment,null,i.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=m&&null!==(t=m.additionalDetails)&&void 0!==t&&t.isViewBreakup?i.createElement("div",{onClick:e=>(()=>{var e;let t=m.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),g(t),E(!0)})(),style:{marginTop:"12px"}},i.createElement("span",{className:"add-details-link hover-button"},v("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&i.createElement(l.Modal,{headerBarMain:i.createElement(_,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:i.createElement(S,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},i.createElement(l.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},i.createElement(l.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==f||null===(a=f.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:i.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),i.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:i.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),i.createElement(l.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==f||null===(u=f.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:i.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),i.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:i.createElement("span",null,"₹",Number(null==f?void 0:f.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==f||null===(s=f.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:i.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),i.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),i.createElement(l.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:i.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},pi={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:{}},Ei=e=>{let{className:t="table",headers:l=[],values:n=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return i.createElement(i.Fragment,null,i.createElement("div",{style:pi.root},i.createElement("table",{className:"table-fixed-column-common-pay",style:pi.table},i.createElement("thead",null,i.createElement("tr",null,i.createElement("th",{style:{...pi.cell,...pi.cellLeft,...pi.cellHeader}},r("CS_BILL_PERIOD")),l.map((e,t)=>i.createElement("th",{style:{...pi.cell,...l.length==t+1?pi.cellRight:{},...pi.cellHeader},key:t},r(e))))),i.createElement("tbody",null,Object.values(n).map((e,t)=>i.createElement("tr",{key:t},i.createElement("td",{style:{...pi.cell,...pi.cellLeft},component:"th",scope:"row"},Object.keys(n)[t]),l.map((t,n)=>i.createElement("td",{style:{...pi.cell,textAlign:"left",...l.length==n+1?pi.cellRight:{},whiteSpace:"pre"},key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),i.createElement("tr",null,i.createElement("td",{style:{...pi.cell,...pi.cellLeft}}),l.map((e,t)=>t==l.length-1?i.createElement("td",{style:{...pi.cell,...pi.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==l.length-2?i.createElement("td",{style:{...pi.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):i.createElement("td",{style:pi.cell,key:t,numeric:!0})))))))},fi={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))"}},gi=e=>{var t,l,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(l=s)||void 0===l?void 0:l.reduce((e,t,l)=>0===l?e:e+t.amount,0))||0;let m="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,l,n;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===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?`FY${l.getYear()+1900}-${n.getYear()-100}`:`${l.toLocaleDateString()}-${n.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let p=[];p=Object.keys(v),p.sort((e,t)=>v[e]-v[t]);const[E,f]=n.useState(!1);return 0==c||c<0?i.createElement("span",null):i.createElement(i.Fragment,null,i.createElement("div",{style:fi.headerStyle},u("CS_ARREARS_DETAILS")),E&&i.createElement(Ei,{headers:[...p],values:d,arrears:m}),!E&&i.createElement("div",{style:fi.buttonStyle},i.createElement("button",{type:"button",onClick:()=>{f(!0)}},u("CS_SHOW_CARD"))),E&&i.createElement("div",{style:fi.buttonStyle},i.createElement("button",{type:"button",onClick:()=>{f(!1)}},u("CS_HIDE_CARD"))))},_i=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),hi=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(_i,null)),Si=e=>{let{t:t,closeModal:n}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const o=a.useHistory();return i.createElement(i.Fragment,null,i.createElement(l.Modal,{headerBarMain:i.createElement(e=>i.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:i.createElement(hi,{onClick:n}),actionCancelLabel:t("CS_COMMON_BACK"),actionCancelOnSubmit:n,hideSubmit:!0,formId:"modal-action"},i.createElement(l.Card,{style:{boxShadow:"none"}},i.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},i.createElement(l.SubmitBar,{label:t("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{o.push("renew-application/info")}}),i.createElement(l.SubmitBar,{label:t("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),o.push("renew-application/check/makePayment")}})))))};function Ti(e){var t,r,u,d,s,c,m,v,p,E,f,g,h,S;let{applicationDetails:T,workflowDetails:b,isDataLoading:y,applicationData:N,timelineStatusPrefix:C,showTimeLine:A=!0,statusAttribute:I="status",paymentsList:D,oldValue:x,isInfoLabel:O=!1}=e;const{t:L}=o.useTranslation(),[w,P]=n.useState(!1);let{id:R}=a.useParams();function k(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const[M,F]=n.useState({}),[B,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!==(null==N?void 0:N.status)||B.loading||B.loaded||B.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==B||!B.canLoad||B.loading||B.loaded||(U({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.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==N?void 0:N.tenantId)||tenantId,null==N?void 0:N.propertyId,F,U));const W=e=>{if(null==e||void 0===e||""===e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${n}/${l}/${t.getFullYear()}`},H=function(e,t,l){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var n;const e={date:W(null==N||null===(n=N.auditDetails)||void 0===n?void 0:n.createdTime),source:(null==N?void 0:N.channel)||""};return i.createElement(ii,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,m,v,p,E,f,g,h,S,b,y,C;const n={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==T?void 0:T.tenantId,businessIds:null==T?void 0:T.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),l}}},A=l[t-1],I={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==N||null===(s=N.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.uuid)&&null!=N&&null!==(E=N.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==N||null===(h=N.processInstance)||void 0===h||null===(S=h.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(C=y[0])||void 0===C?void 0:C.mobileNumber,comment:L(null==e?void 0:e.comment),wfComment:A?A.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return i.createElement(ii,{data:I,OpenImage:k,privacy:n})}{var A,I,D,x,O;const t={date:W(null==N||null===(A=N.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:null==e||null===(I=e.assignes)||void 0===I||null===(D=I[0])||void 0===D?void 0:D.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(x=e.assignes)||void 0===x||null===(O=x[0])||void 0===O?void 0:O.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return i.createElement(ii,{data:t,OpenImage:k})}},j=(e,t)=>e?t?e:L(e):L("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/noc"),G=window.location.href.includes("employee/obps"),K=()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{},Y=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${j(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?j(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):L("N/A"),[$,q]=n.useState(!1);return i.createElement(l.Card,{style:{position:"relative"},className:"employeeCard-override"},O?i.createElement(mi,{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==T||null===(t=T.applicationDetails)||void 0===t?void 0:t.map((e,t)=>{var n,o,r,u,d,s,c,m,v,p,E,f,g,_,h,S,y,N,C,A,I,O,w,k,F,B,U,W,H,j,$,q,X,Q,Z,J,ee,te,le,ne;return i.createElement(i.Fragment,{key:t},i.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")||z?{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}:{}},(null==e||null===(n=e.title)||void 0===n?void 0:n.trim())&&(0!==t||e.asSectionHeader?i.createElement(l.CardSectionHeader,{style:0===t&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},L(e.title),null!=e&&e.Component?i.createElement(e.Component,null):null):i.createElement(l.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},L(e.title))),(null==e?void 0:e.isTable)&&i.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},i.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>i.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},L(e)))),null==e?void 0:e.tableRows.map((t,n)=>i.createElement("tr",{key:n},t.map((t,o)=>Array.isArray(t)&&t.length>1&&!0===e.isMaintenance?i.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:o},i.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},t.map((e,t)=>i.createElement("a",{key:t,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n;const i=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.url;if(i){const e=i.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},i.createElement(l.PDFSvg,{style:{width:"25px",height:"25px"}}))))):i.createElement("td",{key:o,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},t&&!0===t.editButton?i.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},i.createElement(a.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+R,state:{data:t.data}}},i.createElement("button",null," ",i.createElement(l.EditIcon,null)," ")),i.createElement("div",{key:n,onClick:()=>{P(!0)},style:{cursor:"pointer"}},i.createElement(l.ViewsIcon,null))):L(t)))))),i.createElement(l.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(o=e.values)||void 0===o?void 0:o.map((t,n)=>{var o,r,u;return!0===t.map&&"N/A"!==t.value?i.createElement(l.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:L(t.title),label:L(t.title),text:i.createElement("img",{src:L(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):!0===(null==t?void 0:t.isLink)?i.createElement(l.Row,{key:L(t.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?i.createElement("div",{style:{width:"200%"}},i.createElement(a.Link,{to:null==t?void 0:t.to},i.createElement("span",{className:"link",style:{color:"#a82227"}},L(null==t?void 0:t.title)))):V||G?""+L(t.title):L(t.title),text:i.createElement("div",null,i.createElement(a.Link,{to:null==t?void 0:t.to},i.createElement("span",{className:"link",style:{color:"#a82227"}},null==t?void 0:t.value))),last:n===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:t.caption,className:"border-none",rowContainerStyle:K(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):i.createElement("div",{key:n},window.location.href.includes("modify")?i.createElement(l.Row,{className:"border-none",key:""+t.title,label:""+L(""+t.title),privacy:null==t?void 0:t.privacy,text:null!=t&&t.oldValue?null==t?void 0:t.oldValue:null!=t&&t.value?null==t?void 0:t.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):i.createElement(l.Row,{key:L(t.title),label:L(t.title),text:Y(t),last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:t.caption,className:"border-none",privacy:null==t?void 0:t.privacy,rowContainerStyle:K(),labelStyle:{wordBreak:"break-all",fontWeight:t.isBold?"bold":"normal",fontStyle:t.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:t.isBold?"bold":"normal",fontStyle:t.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===t.title?i.createElement(gi,{bill:null===(r=M.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&i.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&i.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:D}),(null==T||null===(u=T.applicationData)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&i.createElement(Yn,{fiReport:null==T||null===(m=T.applicationData)||void 0===m||null===(v=m.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors)&&i.createElement(Jn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&i.createElement(ei,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&i.createElement(ai,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&i.createElement(oi,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions)&&(null==b||null===(C=b.data)||void 0===C||null===(A=C.nextActions)||void 0===A?void 0:A.length)>0&&i.createElement(Xn,{applicationData:null==T?void 0:T.applicationData,t:L,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)&&i.createElement(Gn,{t:L,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&i.createElement(qn,{t:L,isNoc:!0,NOCdata:e.values,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:b}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.scruntinyDetails)&&i.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&i.createElement(ti,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&i.createElement(li,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==T?void 0:T.applicationData}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl)&&i.createElement(Vn,{documents:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents)&&i.createElement(Qn,{documents:null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.documents}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation)&&i.createElement(Zn,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&i.createElement(ri,{wsAdditionalDetails:e,oldValue:x}),(null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.redirectUrl)&&i.createElement(a.Link,{to:null==e||null===(Z=e.additionalDetails)||void 0===Z||null===(J=Z.redirectUrl)||void 0===J?void 0:J.url},i.createElement("span",{className:"add-details-link hover-button"},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title)),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&i.createElement(si,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&i.createElement(vi,{wsAdditionalDetails:e,workflowDetails:b}))}),A&&(null==b||null===(r=b.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&i.createElement(i.Fragment,null,i.createElement(l.BreakLine,null),((null==b?void 0:b.isLoading)||y)&&i.createElement(l.Loader,null),!(null!=b&&b.isLoading)&&!y&&i.createElement(n.Fragment,null,i.createElement("div",{id:"timeline"},i.createElement(l.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},L("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(d=b.data)&&void 0!==d&&d.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?i.createElement(l.CheckPoint,{isCompleted:!0,label:L(`${C}${null==b||null===(m=b.data)||void 0===m||null===(v=m.timeline[0])||void 0===v?void 0:v.state}`),customChild:H(null==b||null===(p=b.data)||void 0===p?void 0:p.timeline[0],null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)}):i.createElement(l.ConnectingCheckPoints,null,(null==b||null===(f=b.data)||void 0===f?void 0:f.timeline)&&(null==b||null===(g=b.data)||void 0===g?void 0:g.timeline.slice(0,$?null==b?void 0:b.data.timeline.length:2).map((e,t,n)=>{var o;let a="";var r,u,d,s,c,m;return window.location.href.includes("/obps/")&&(a=null!=b&&null!==(r=b.data)&&void 0!==r&&null!==(u=r.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[t-1])&&void 0!==c&&null!==(m=c.state)&&void 0!==m&&m.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===t?"":"_DONE"),i.createElement(i.Fragment,{key:t},i.createElement(l.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:L(`${C}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${a}`),customChild:H(e,t,null==b||null===(o=b.data)||void 0===o?void 0:o.timeline)}))}))),(null==b||null===(h=b.data)||void 0===h||null===(S=h.timeline)||void 0===S?void 0:S.length)>2&&i.createElement(l.LinkButton,{label:L($?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{q(e=>!e)}})))),i.createElement("div",null,w&&i.createElement(Si,{t:L,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function bi(e){var t,n,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S;let{t:T,showToast:b,closeToast:y,businessService:N}=e;if(null!=N&&N.includes("NewTL")||null!=N&&N.includes("TL")||null!=N&&N.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===(t=b.error)||void 0===t?void 0:t.message:T("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:T("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:T("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:T("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:T("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:T("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:T("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:T(`ES_${N}_${null==b||null===(c=b.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return i.createElement(i.Fragment,null,b&&i.createElement(l.Toast,{error:"error"===b.key,label:e,onClose:y}))}if(null!=N&&N.includes("BPA")||null!=N&&N.includes("BPA_LOW")||null!=N&&N.includes("BPA_OC")){var A;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=N&&N.includes("BPA_OC")?T(e[1]):T(e[0]),l};let t="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"REVOCATE":t="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":t="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":t="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":t="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":t="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":t="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:t="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:T(`ES_${N}_${null==b||null===(S=b.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return i.createElement(i.Fragment,null,b&&i.createElement(l.Toast,{error:"error"===b.key,label:t,onClose:y}))}{var I,D;const e="error"===(null==b?void 0:b.key)?null==b||null===(I=b.error)||void 0===I?void 0:I.message:`ES_${N}_${null==b||null===(D=b.action)||void 0===D?void 0:D.action}_UPDATE_SUCCESS`;return i.createElement(i.Fragment,null,b&&i.createElement(l.Toast,{error:"error"===b.key,label:T(e),onClose:y}))}}function yi(e){var t,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y;let{workflowDetails:N,displayMenu:C,onActionSelect:A,setDisplayMenu:I,businessService:D,forcedActionPrefix:x,ActionBarStyle:O={},MenuStyle:L={},isAction:w,applicationDetails:P}=e;const{t:R}=o.useTranslation();let k=Digit.UserService.getUser();const M=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):{};k=null==t?void 0:t.value}const F=null===(t=k)||void 0===t||null===(a=t.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let B=!1,U=!1,W=(null==N||null===(u=N.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==F?void 0:F.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==N||null===(c=N.data)||void 0===c||null===(m=c.nextActions)||void 0===m?void 0:m.filter(e=>(null==F?void 0:F.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(M,()=>{I(!1)},C),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==W?void 0:W.length)||null!=W&&null!==(v=W[0])&&void 0!==v&&null!==(p=v.redirectionUrl)&&void 0!==p&&p.pathname.includes("/pt/property-details/")&&1==(null==W?void 0:W.length)?(U=!1,B=!0):(null==W?void 0:W.length)>0&&(U=!0,B=!1);const H=Digit.SessionStorage.get("User"),j=null==H||null===(E=H.info)||void 0===E?void 0:E.uuid,z=null==P||null===(f=P.applicationData)||void 0===f||null===(g=f.auditDetails)||void 0===g?void 0:g.lastModifiedBy;return i.createElement(i.Fragment,null,!(null!=N&&N.isLoading)&&U&&!B&&!w&&i.createElement(l.ActionBar,{style:{...O}},C&&(null!=N&&null!==(_=N.data)&&void 0!==_&&null!==(h=_.actionState)&&void 0!==h&&h.nextActions||null!=N&&null!==(S=N.data)&&void 0!==S&&S.nextActions)?i.createElement(l.Menu,{localeKeyPrefix:x||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:W,optionKey:"action",t:R,onSelect:A,style:L}):null,"ewst"===D?z===j||null==z?i.createElement(l.SubmitBar,{ref:M,label:R("WF_TAKE_ACTION"),onSubmit:()=>I(!C)}):i.createElement(l.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+R("EW_ALERT_ANOTHER_VENDOR")):i.createElement(l.SubmitBar,{ref:M,label:R("WF_TAKE_ACTION"),onSubmit:()=>I(!C)})),!(null!=N&&N.isLoading)&&!U&&B&&!w&&i.createElement(l.ActionBar,{style:{...O}},i.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==W||null===(T=W[0])||void 0===T?void 0:T.action,value:null==W||null===(b=W[0])||void 0===b?void 0:b.action,onClick:e=>{A((null==W?void 0:W[0])||{})}},R(`${x||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase())}_${null==W||null===(y=W[0])||void 0===y?void 0:y.action}`))))}const Ni=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),Ci=e=>i.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},i.createElement(Ni,null));function Ai(e){let{action:t,closeWarningPopup:n}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return i.createElement(i.Fragment,null,i.createElement(l.Modal,{headerBarMain:i.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:i.createElement(Ci,{onClick:()=>{n()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},i.createElement(l.Card,null,i.createElement("div",{style:{marginBottom:"30px"}},i.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==t?void 0:t.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),i.createElement(l.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==t?void 0:t.AmountDueForPay)}),i.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},i.createElement(l.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:n,style:{marginLeft:"10px"}}),i.createElement(l.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==t||null===(e=t.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const Ii=e=>{var t;const u=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=a.useHistory();let{id:m}=a.useParams();const[v,p]=n.useState(!1),[E,f]=n.useState(null),[g,_]=n.useState(!1),[h,S]=n.useState(!1),[T,b]=n.useState(!1),{applicationDetails:y,showToast:N,setShowToast:C,isLoading:A,isDataLoading:I,applicationData:D,mutate:x,nocMutation:O,workflowDetails:L,id:P,businessService:R,closeToast:k,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:B,statusAttribute:U,ActionBarStyle:W,MenuStyle:H,paymentsList:j,showTimeLine:z=!0,oldValue:V,isInfoLabel:G=!1,clearDataDetails:K,isAction:Y=!1}=e;n.useEffect(()=>{N&&L.revalidate()},[N]);const $=r.useQueryClient(),q=()=>{f(null),_(!1)};return A||h?i.createElement(l.Loader,null):i.createElement(i.Fragment,null,A?i.createElement(l.Loader,null):i.createElement(i.Fragment,null,i.createElement(Ti,{applicationDetails:y,id:P,workflowDetails:L,isDataLoading:I,applicationData:D,businessService:R,timelineStatusPrefix:F,statusAttribute:U,paymentsList:j,showTimeLine:z,oldValue:V,isInfoLabel:G}),g?i.createElement(zn,{t:s,action:E,tenantId:u,state:d,id:m,applicationDetails:y,applicationData:null==y?void 0:y.applicationData,closeModal:q,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,d,m,v,p,f,g,_){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)&&0!=(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(m=e.WaterConnection)||void 0===m||null===(v=m.comment)||void 0===v?void 0:v.length)&&0!=(null==e||null===(p=e.SewerageConnection)||void 0===p||null===(f=p.comment)||void 0===f?void 0:f.length)&&0!=(null==e||null===(g=e.BPA)||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length)){function h(t){if(n)return t;x&&(S(!0),x(e,{onError:(e,t)=>{S(!1),C({key:"error",error:e}),setTimeout(k,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u,d,m,v,p,f,g;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),S(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=E,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&c.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0?null!=t&&null!==(r=t.AmendmentUpdate)&&void 0!==r&&null!==(u=r.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(m=d.workflow)&&void 0!==m&&m.action.includes("RE-SUBMIT")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(p=v.workflow)&&void 0!==p&&p.action.includes("APPROVE")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(g=f.workflow)&&void 0!==g&&g.action.includes("REJECT")&&C({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(C({key:"success",action:E}),K&&setTimeout(K,3e3),setTimeout(k,5e3),$.clear(),$.refetchQueries("APPLICATION_SEARCH"))}})),q()}S(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&O){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==O?void 0:O.mutateAsync(e)),i=w(function(){return S(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,c,m,v,p;S(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?s(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(c=e.response)||void 0===c||null===(m=c.data)||void 0===m||null===(v=m.Errors)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.message)||e;q(),C({key:"error",error:{message:E}}),setTimeout(k,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(h):h(i)}alert("Please fill in the comments before submitting")}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==L||null===(t=L.data)||void 0===t?void 0:t.timeline,businessService:R,workflowDetails:L,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,T?i.createElement(Ai,{action:E,workflowDetails:L,businessService:R,isWarningPop:T,closeWarningPopup:()=>{b(!1)}}):null,i.createElement(bi,{t:s,showToast:N,closeToast:k,businessService:R}),i.createElement(yi,{isAction:Y,workflowDetails:L,displayMenu:v,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)C({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(k,5e3);else if(null!=e&&e.isWarningPopUp)b(!0);else if(null!=e&&e.redirectionUrll){var t,l,n,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))c.push(""+(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.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===(l=e.redirectionUrll)||void 0===l?void 0:l.action)){var a,r;c.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var u;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname}`)}}else if(null!=e&&e.redirectionUrl){var d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else _(!0);f(e),p(!1)},setDisplayMenu:p,businessService:R,forcedActionPrefix:B,ActionBarStyle:W,MenuStyle:H,applicationDetails:y})))},Di=()=>i.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("polyline",{points:"20 6 9 17 4 12"})),xi=()=>i.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("circle",{cx:"12",cy:"12",r:"10"}),i.createElement("polyline",{className:"clock-hands2",points:"12 6 12 12 16 14"})),Oi=e=>{var t;let{workflowDetails:n,hideTimeline:a,setHideTimeline:r}=e;const{t:u}=o.useTranslation(),d=null==n||null===(t=n.data)||void 0===t?void 0:t.processInstances;return d&&0!==d.length?i.createElement(l.Card,{className:"workflow-timeline-card2 digit-form-composer",style:{background:"#fafafa",padding:"16px",height:a?"100%":""}},i.createElement("div",{className:"timeline-header-wrapper "+(a?"collapsed":"")},i.createElement(l.CardSubHeader,{style:{marginBottom:"0",fontSize:"16px",fontWeight:"700",color:"#374151"},className:a?"hidden-content":""},u("WORKFLOW_TIMELINE")),i.createElement("button",{onClick:()=>r(!a)},i.createElement("svg",{className:"timeline-arrow "+(a?"collapsed":""),width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M11 17l-5-5 5-5M18 17l-5-5 5-5"})))),i.createElement("div",{className:a?"hidden-content":"timeline-container2"},d.map((e,t)=>{var l,n,o,a,r,s,c;const m=(e=>0===e?"current2":"completed2")(t),v=t!==d.length-1&&d.length>1,p=(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.lastModifiedTime)||(null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime);return i.createElement("div",{key:t,className:"timeline-item2 "+m},i.createElement("div",{className:"timeline-marker2"},i.createElement("div",{className:"timeline-circle2"},i.createElement("completed2"===m?Di:xi,null)),v&&i.createElement("div",{className:"timeline-line2"})),i.createElement("div",{className:"timeline-content2"},i.createElement("div",{className:"timeline-header2"},i.createElement("div",{className:"timeline-title2"},u("WF_"+(null==e||null===(o=e.state)||void 0===o?void 0:o.state))),i.createElement("span",{className:"timeline-date2"},(e=>{if(!e)return"N/A";const t=new Date(e);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear().toString().slice(-2)} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`})(p))),i.createElement("div",{className:"timeline-body2"},i.createElement("div",{className:"timeline-status-tag2 status-"+m},u((null==e||null===(a=e.state)||void 0===a?void 0:a.applicationStatus)||(null==e||null===(r=e.state)||void 0===r?void 0:r.state))),(null==e?void 0:e.comment)&&i.createElement("div",{className:"timeline-comment2"},e.comment)),(null==e||null===(s=e.assigner)||void 0===s?void 0:s.name)&&i.createElement("div",{className:"timeline-footer2"},i.createElement("span",null,u("ES_COMMON_ASSIGNED_TO"),": ",i.createElement("strong",null,null==e||null===(c=e.assigner)||void 0===c?void 0:c.name)))))}))):null};var Li=i.memo(()=>{var e,t,l,r;const{t:u}=o.useTranslation(),[d,s]=i.useState("undefined"!=typeof window&&window.innerWidth<768),c=Digit.ULBService.getCurrentTenantId(),{id:m}=a.useParams(),[v,p]=n.useState(null),[E,f]=n.useState({}),[g,_]=n.useState("watertanker"),h=null==m?void 0:m.startsWith("WT"),S=null==m?void 0:m.startsWith("TP"),T=h?"watertanker":S?"treePruning":"mobileToilet",b=Digit.UserService.getUser().info;sessionStorage.setItem(h?"wt":S?"tp":"mt",m);const{isLoading:y,data:N}=h?Digit.Hooks.wt.useWTApplicationDetail(u,c,m):S?Digit.Hooks.wt.useTPApplicationDetail(u,c,m):Digit.Hooks.wt.useMTApplicationDetail(u,c,m),{mutate:C}=h?Digit.Hooks.wt.useWTApplicationAction(c):S?Digit.Hooks.wt.useTPApplicationAction(c):Digit.Hooks.wt.useMTApplicationAction(c);let A=Digit.Hooks.useWorkflowDetails({tenantId:(null==N||null===(e=N.applicationData)||void 0===e?void 0:e.tenantId)||c,id:null==N||null===(t=N.applicationData)||void 0===t||null===(l=t.applicationData)||void 0===l?void 0:l.bookingNo,moduleCode:T,role:h?["WT_CEMP"]:S?["TP_CEMP"]:["MT_CEMP"]});return n.useEffect(()=>{N&&f(Ct.cloneDeep(N))},[N]),n.useEffect(()=>{var e,t,l,n,i;null!=A&&null!==(e=A.data)&&void 0!==e&&e.applicationBusinessService&&!("watertanker"===(null==A||null===(t=A.data)||void 0===t?void 0:t.applicationBusinessService)&&"watertanker"===T||"mobileToilet"===(null==A||null===(l=A.data)||void 0===l?void 0:l.applicationBusinessService)&&"mobileToilet"===T||"treePruning"===(null==A||null===(n=A.data)||void 0===n?void 0:n.applicationBusinessService)&&"treePruning"===T)&&_(null==A||null===(i=A.data)||void 0===i?void 0:i.applicationBusinessService)},[A.data]),i.createElement("div",{className:"employee-form-content-with-action-bar",style:{padding:"CITIZEN"===(null==b?void 0:b.type)?"0 15px":"",height:"100%"}},i.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px",height:"100%"}},i.createElement("div",{className:"workflow-timeline-wrapper "+(d?"hide-workflow":"")},i.createElement(Oi,{hideTimeline:d,setHideTimeline:s,workflowDetails:A})),i.createElement("div",{className:d?"":"hidden-card ",style:{flex:"1",overflowY:"scroll"}},i.createElement(Ii,{applicationDetails:null==E?void 0:E.applicationData,isLoading:y,isDataLoading:y,applicationData:null==E||null===(r=E.applicationData)||void 0===r?void 0:r.applicationData,mutate:C,workflowDetails:A,businessService:T,moduleCode:"request-service",showToast:v,setShowToast:p,closeToast:()=>{p(null)},timelineStatusPrefix:"",forcedActionPrefix:"RS",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"},showTimeLine:!1}))))});const wi=()=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},i.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i.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"})),Pi=e=>{let{onClick:t}=e;return i.createElement("div",{className:"icon-bg-secondary",onClick:t},i.createElement(wi,null))},Ri=e=>i.createElement("h1",{className:"heading-m"},e.t("SERVICE_TYPE")),ki=e=>e.substr(0,1).toUpperCase()+e.substr(1),Mi=function(e,t,l){try{var n,i,o,a,r,u,d,s,c,m,v,p,E,_;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${h=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),h.toLowerCase().split(" ").map(ki).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("MT_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:l("WT_CITY"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(_=e.address)||void 0===_?void 0:_.landmark}].filter(e=>e.value)},{title:l("MT_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_NUMBER_OF_MOBILE_TOILETS"),value:null==e?void 0:e.noOfMobileToilet},{title:l("MT_DELIVERY_FROM_DATE"),value:g(null==e?void 0:e.deliveryFromDate)},{title:l("MT_DELIVERY_TO_DATE"),value:g(null==e?void 0:e.deliveryToDate)},{title:l("MT_REQUIREMENT_TIME"),value:`${f(null==e?void 0:e.deliveryFromTime)} - ${f(null==e?void 0:e.deliveryToTime)}`},{title:l("MT_SPECIAL_REQUEST"),value:null==e?void 0:e.description}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var h},Fi=e=>{console.log("GetActionMessage",e);const{t:t}=o.useTranslation();return e.isSuccess?t("MT_SUBMIT_SUCCESSFULL"):e.isLoading?t("MT_APPLICATION_PENDING"):e.isSuccess?void 0:t("MT_APPLICATION_FAILED")},Bi={padding:"4px 0px",justifyContent:"space-between"},Ui=e=>{var t,n;return console.log("BannerPicker",e),i.createElement(l.Banner,{message:Fi(e),applicationNumber:null===(t=e.data)||void 0===t||null===(n=t.mobileToiletBookingDetail)||void 0===n?void 0:n.bookingNo,info:e.isSuccess?e.t("MT_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Wi=e=>e.substr(0,1).toUpperCase()+e.substr(1),Hi=function(e,t,l){try{var n,i,o,a,r,u,d,s,c,m,v,p,E,f;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${g=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),g.toLowerCase().split(" ").map(Wi).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,applicationNumber:null==e?void 0:e.bookingNo,isTOCRequired:!1,heading:l("TP_ACKNOWLEDGEMENT"),details:[{title:l("MT_APPLICANT_DETAILS"),asSectionHeader:!0,values:[{title:l("MT_APPLICANT_NAME"),value:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.name},{title:l("MT_MOBILE_NUMBER"),value:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.mobileNumber},{title:l("MT_ALT_MOBILE_NUMBER"),value:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.alternateNumber},{title:l("MT_EMAIL_ID"),value:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.emailId}].filter(e=>e.value)},{title:l("WT_ADDRESS_DETAILS"),asSectionHeader:!0,values:[{title:l("WT_PINCODE"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.pincode},{title:l("WT_CITY"),value:null==e||null===(d=e.address)||void 0===d?void 0:d.city},{title:l("WT_LOCALITY"),value:null==e||null===(s=e.address)||void 0===s?void 0:s.locality},{title:l("WT_STREET_NAME"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.streetName},{title:l("WT_DOOR_NO"),value:null==e||null===(m=e.address)||void 0===m?void 0:m.doorNo},{title:l("WT_HOUSE_NO"),value:null==e||null===(v=e.address)||void 0===v?void 0:v.houseNo},{title:l("WT_ADDRESS_LINE1"),value:null==e||null===(p=e.address)||void 0===p?void 0:p.addressLine1},{title:l("WT_ADDRESS_LINE2"),value:null==e||null===(E=e.address)||void 0===E?void 0:E.addressLine2},{title:l("WT_LANDMARK"),value:null==e||null===(f=e.address)||void 0===f?void 0:f.landmark}].filter(e=>e.value)},{title:l("TP_REQUEST_DETAILS"),asSectionHeader:!0,values:[{title:l("REASON_FOR_PRUNING"),value:l(null==e?void 0:e.reasonForPruning)},{title:l("LATITUDE_GEOTAG"),value:null==e?void 0:e.latitude},{title:l("LONGITUDE_GEOTAG"),value:null==e?void 0:e.longitude}].filter(e=>e.value)}]})}catch(e){return Promise.reject(e)}var g},ji=e=>{const{t:t}=o.useTranslation();return e.isSuccess?t("TP_SUBMIT_SUCCESSFULL"):e.isLoading?t("TP_APPLICATION_PENDING"):e.isSuccess?void 0:t("TP_APPLICATION_FAILED")},zi={padding:"4px 0px",justifyContent:"space-between"},Vi=e=>{var t,n;return console.log("BannerPicker",e),i.createElement(l.Banner,{message:ji(e),applicationNumber:null===(t=e.data)||void 0===t||null===(n=t.treePruningBookingDetail)||void 0===n?void 0:n.bookingNo,info:e.isSuccess?e.t("TP_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},Gi=e=>{let{stateCode:t,userType:l,tenants:o}=e;const{path:r,url:u}=a.useRouteMatch(),d=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"WT",language:d}),Digit.SessionStorage.set("WT_TENANTS",o),n.useEffect(()=>"employee"===l&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===l?i.createElement(Ce,{path:r,url:u,userType:l}):i.createElement(b,null)},Ki=e=>{let{matchPath:t}=e;const{t:a}=o.useTranslation(),[r,u,d]=Digit.Hooks.useSessionStorage("WT",{});n.useEffect(()=>{d()},[]);const s=[{link:t+"/wt",i18nKey:a("WT_REQUEST_TANKER")},{link:t+"/wt/status",i18nKey:a("WT_VIEW_APPLICATIONS")},{link:t+"/wt/wt-Vendor",i18nKey:a("WT_VENDOR_LOGIN")}];return i.createElement(l.CitizenHomeCard,{header:a("WATER_TANKER_SERVICE"),links:s,Icon:()=>i.createElement(l.PTIcon,{className:"fill-path-primary-main"})})},Yi={ApplicantDetails:l.ApplicantDetails,AddressDetails:l.AddressDetails,WTCreate:()=>{var e,t,l,u,d,s,c,p,E;const f=r.useQueryClient(),g=a.useRouteMatch(),{t:_}=o.useTranslation(),{pathname:h}=a.useLocation(),S=a.useHistory();let T=[];const[b,y,N]=Digit.Hooks.useSessionStorage("WT_Create",{}),C=Digit.UserService.getUser(),A=Digit.ULBService.getCurrentTenantId(),I=null==C||null===(e=C.info)||void 0===e?void 0:e.uuid,{data:D}=Digit.Hooks.useUserSearch(A,{uuid:[I]},{},{enabled:!!I});function x(e,t,l,n,i){if(void 0===i&&(i=!1),"owners"===e){let l=b.owners||[];l[n]=t,y({...b,[e]:[...l]})}else if("units"===e){let e=b.units||[];e=t,y({...b,units:e})}else y({...b,[e]:{...b[e],...t}});((e,t,l,n)=>{let i,o=h.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=h.slice(0,-3),o=o.split("/").pop(),r=!0):(o=h.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let u=T.find(e=>n?e.key===n:e.route===o);u||(u=T.find(e=>e.route===o));let{nextStep:d={}}=u||{},s=S.push;if(e&&(s=S.replace),l&&(d=n),"request-details"===d){var c,m;const e=null==b||null===(c=b.serviceType)||void 0===c||null===(m=c.serviceType)||void 0===m?void 0:m.code;"MobileToilet"===e?d="toiletRequest-details":"TREE_PRUNING"===e&&(d="treePruningRequest-details")}if(null===d)return s(g.path+"/check");i=isNaN(d.split("/").pop())&&r&&"map"!==d?`${g.path}/${d}/${t}`:`${g.path}/${d}`,s(i)})(l,n,i,e)}b.serviceType&&0!==Object.keys(b.serviceType).length||!h.includes("employee")||(h.includes("mt")?y({serviceType:{serviceType:{code:"MobileToilet",i18nKey:"Mobile Toilet",value:"Mobile Toilet"}}}):h.includes("tp")?y({serviceType:{serviceType:{code:"TREE_PRUNING",i18nKey:"Tree Pruning",value:"Tree Pruning"}}}):y({serviceType:{serviceType:{code:"WT",i18nKey:"Water Tanker",value:"Water Tanker"}}})),b&&Object.keys(b).length>0&&window.location.href.includes("/service-type")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(N(),f.invalidateQueries("WT_Create"));const O=()=>{N(),f.invalidateQueries("WT_Create")};m.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute=h.includes("citizen")?"service-type":"info";const L=null===(t=Digit)||void 0===t||null===(l=t.ComponentRegistryService)||void 0===l?void 0:l.getComponent("WTCheckPage"),w=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("WTAcknowledgement"),P=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("MTAcknowledgement"),R=null===(p=Digit)||void 0===p||null===(E=p.ComponentRegistryService)||void 0===E?void 0:E.getComponent("TPAcknowledgement"),k=["applicant-details","address-details","request-details","toiletRequest-details","treePruningRequest-details"],M=k.some(e=>h.includes(e)),F=n.useRef({});return n.useEffect(()=>{if(M){const e=h.split("/").pop();F.current[e]&&F.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[h,M]),i.createElement(i.Fragment,null,i.createElement("div",{className:"employee-form-section-wrapper"},!h.includes("/info")&&i.createElement(v,{config:T,showFinalStep:!0}),i.createElement("div",{className:"employee-form-section"},i.createElement(a.Switch,null,i.createElement(a.Route,{path:g.path+"/check"},i.createElement(L,{onSubmit:function(){try{var e,t,l,n,i,o;return"WT"===(null==b||null===(e=b.serviceType)||void 0===e||null===(t=e.serviceType)||void 0===t?void 0:t.code)&&S.push(g.path+"/wt-acknowledgement"),"MobileToilet"===(null==b||null===(l=b.serviceType)||void 0===l||null===(n=l.serviceType)||void 0===n?void 0:n.code)&&S.push(g.path+"/mt-acknowledgement"),"TREE_PRUNING"===(null==b||null===(i=b.serviceType)||void 0===i||null===(o=i.serviceType)||void 0===o?void 0:o.code)&&S.push(g.path+"/tp-acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:b})),i.createElement(a.Route,{path:g.path+"/wt-acknowledgement"},i.createElement(w,{data:b,onSuccess:O})),i.createElement(a.Route,{path:g.path+"/mt-acknowledgement"},i.createElement(P,{data:b,onSuccess:O})),i.createElement(a.Route,{path:g.path+"/tp-acknowledgement"},i.createElement(R,{data:b,onSuccess:O})),T.map((e,t)=>{if(!k.includes(e.route)){var l;const{component:n,texts:o,inputs:r,key:u,additionaFields:d}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return i.createElement(a.Route,{path:`${g.path}/${e.route}`,key:t},i.createElement(s,{config:{texts:o,inputs:r,key:u,additionaFields:d},onSelect:x,t:_,formData:b,userDetails:null==D||null===(l=D.user)||void 0===l?void 0:l[0]}))}return null}),i.createElement(a.Route,{path:k.map(e=>`${g.path}/${e}`)},i.createElement("div",{className:"single-page-form-container"},T.filter(e=>k.includes(e.route)).map((e,t)=>{var l,n,o;const{component:a}=e,r="string"==typeof a?Digit.ComponentRegistryService.getComponent(a):a,u=null==b||null===(l=b.serviceType)||void 0===l||null===(n=l.serviceType)||void 0===n?void 0:n.code;return"request-details"===e.route&&"WT"!==u||"toiletRequest-details"===e.route&&"MobileToilet"!==u||"treePruningRequest-details"===e.route&&"TREE_PRUNING"!==u?null:i.createElement("div",{key:t,ref:t=>F.current[e.route]=t,className:"form-section-unit"},i.createElement(r,{config:{...e,isCollapsible:!0,defaultOpen:!0},onSelect:x,t:_,formData:b,userDetails:null==D||null===(o=D.user)||void 0===o?void 0:o[0]}))}))),i.createElement(a.Route,null,i.createElement(a.Redirect,{to:`${g.path}/${T.indexRoute}`}))))))},InfoPage:e=>{var t,o;let{t:a,onSelect:r,formData:u,config:d}=e;const[s,c]=n.useState(""),[m,v]=n.useState(!1),[p,E]=n.useState(!1),f={MobileToilet:"MT_MODULE",WT:"WT_MODULE",TREE_PRUNING:"TREE_PRUNING"}[null==u||null===(t=u.serviceType)||void 0===t||null===(o=t.serviceType)||void 0===o?void 0:o.code],g=()=>{const e={...u.infodetails||{},existingDataSet:s};r(d.key,{...u[d.key],...e})};return i.createElement(i.Fragment,null,i.createElement(l.Card,{className:"search-form-wrapper",style:{flexDirection:"column",gap:"12px",justifyContent:"flex-start"}},f&&i.createElement(l.CardHeader,null,a(f)),i.createElement("div",null,i.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_HEADER")),i.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_TEXT")),i.createElement("p",{className:"primaryColor"},a("SV_DOC_REQ_SCREEN_SUB_TEXT"))),i.createElement("span",null,i.createElement(l.SubmitBar,{label:a("COMMON_NEXT"),onSubmit:()=>{p?v(!0):g()}}))),m&&i.createElement(I,{t:a,closeModal:()=>v(!1),actionCancelOnSubmit:()=>v(!1),onSubmit:()=>{g(),v(!1)},setExistingDataSet:c}))},RequestDetails:e=>{var t,o,a,r,u,d,s,c,m;let{t:v,config:E,onSelect:f,formData:g}=e;Digit.UserService.getUser();let _={};const[h,S]=n.useState((null==g||null===(t=g.requestDetails)||void 0===t?void 0:t.tankerType)||""),[T,b]=n.useState((null==g||null===(o=g.requestDetails)||void 0===o?void 0:o.tankerQuantity)||{i18nKey:"1",code:"1",value:"1"}),[y,N]=n.useState((null==g||null===(a=g.requestDetails)||void 0===a?void 0:a.waterQuantity)||""),[C,A]=n.useState((null==g||null===(r=g.requestDetails)||void 0===r?void 0:r.waterType)||""),[I,D]=n.useState((null==g||null===(u=g.requestDetails)||void 0===u?void 0:u.deliveryDate)||""),[x,O]=n.useState((null==g||null===(d=g.requestDetails)||void 0===d?void 0:d.description)||""),[L,P]=n.useState((null==g||null===(s=g.requestDetails)||void 0===s?void 0:s.deliveryTime)||""),[R,k]=n.useState((null==g||null===(c=g.requestDetails)||void 0===c?void 0:c.extraCharge)||!1),[M,F]=n.useState((null==g||null===(m=g.requestDetails)||void 0===m?void 0:m.fileStoreId)||null),[B,U]=n.useState(null),[W,H]=n.useState(null),j=Digit.ULBService.getStateId(),z={width:"100%"},{data:V}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"VehicleType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.VehicleType}}),{data:G}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerType}}),{data:K}=Digit.Hooks.useCustomMDMS(j,"request-service",[{name:"TankerQuantity"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.TankerQuantity}}),{data:Y}=Digit.Hooks.useCustomMDMS(j,"Request-service",[{name:"WaterType"}],{select:e=>{var t;return null==e||null===(t=e["Request-service"])||void 0===t?void 0:t.WaterType}});let $=[],q=[],X=[],Q=[];Y&&Y.map(e=>{Q.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),K&&K.map(e=>{q.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})}),V&&V.map(e=>{$.push({i18nKey:""+e.capacity,code:""+e.capacity,value:""+e.capacity,vehicleType:e.vehicleType,capacityName:e.capacityName})}),G&&G.map(e=>{X.push({i18nKey:""+e.i18nKey,code:""+e.code,value:""+e.value})});const Z=$.map(e=>{if(h.code===e.vehicleType)return{i18nKey:e.capacityName,code:e.code,value:e.capacityName}}).filter(e=>void 0!==e),J=()=>i.createElement("div",{className:"flex items-center"},i.createElement(l.TextInput,{type:"time",value:L,style:z,onChange:e=>P(e.target.value),min:"06:00",max:"23:59"}));return n.useEffect(()=>{!function(){try{H(null);const e=function(){if(B){const e=function(){if(B.size>=2e6)H(v("WT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage("wt",B,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?F(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):H(v("WT_FILE_UPLOAD_ERROR"))})},function(){H(v("WT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[B]),n.useEffect(()=>{!h&&null!=X&&X.length&&S(X[0])},[X]),i.createElement(i.Fragment,null,i.createElement(l.FormStep,{config:E,onSelect:()=>{let e={...g.requestDetails,tankerType:h,deliveryDate:I,tankerQuantity:T,waterType:C,waterQuantity:y,deliveryTime:L,description:x,extraCharge:R,fileStoreId:M};f(E.key,e,!1)},t:v,isDisabled:!(h&&I&&T&&y&&L&&x&&C),className:"card-form-container"},i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_TANKER_TYPE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.RadioButtons,{t:v,options:X,style:{display:"flex",flexWrap:"wrap",maxHeight:"30px"},innerStyles:{minWidth:"24%"},optionsKey:"i18nKey",name:"tankerType",value:h,selectedOption:h,onSelect:S,labelKey:"i18nKey",isPTFlow:!0})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_WATER_TYPE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:C,placeholder:v("WT_SELECT_WATER_TYPE"),select:A,option:Q,style:z,optionKey:"i18nKey",t:v})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_WATER_QUANTITY")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:y,placeholder:"Select Water Quantity",select:N,option:Z,style:z,optionKey:"i18nKey",t:v})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_TANKER_QUANTITY")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:T,placeholder:"Select Tanker Quantity",select:b,option:q,style:z,optionKey:"i18nKey",t:v})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_DELIVERY_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:v,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:z,value:I,onChange:function(e){D(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:v("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||v("ERR_DEFAULT_INPUT_FIELD_MSG")}})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_DELIVERY_TIME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(J,null)),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_UPLOAD_DOCUMENT")),i.createElement(l.UploadFile,{id:"wt-doc",extraStyleName:"propertyCreate",accept:".jpg,.png,.pdf,.jpeg",onUpload:function(e){F(null),U(e.target.files[0])},onDelete:()=>{F(null)},message:M?"1 "+v("WT_ACTION_FILEUPLOADED"):v("WT_ACTION_NO_FILEUPLOADED"),error:W})),i.createElement("div",null,i.createElement(l.CardLabel,null,""+v("WT_DESCRIPTION")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextArea,p({t:v,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"description",value:x,onChange:function(e){O(e.target.value)},style:z,ValidationRequired:!0},_={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:v("PT_NAME_ERROR_MESSAGE")}))),W?i.createElement("div",{style:{height:"20px",width:"100%",fontSize:"20px",color:"red",marginTop:"5px"}},W):"",i.createElement(l.CheckBox,{label:v("WT_IMMEDIATE"),onChange:()=>{k(!R)},checked:R})))},WTCheckPage:e=>{var t,r,u,d,s,c,m,v,p,_,h,S;let{onSubmit:T,value:b={}}=e;const{t:y}=o.useTranslation(),{pathname:N}=a.useLocation(),{owner:C,requestDetails:A,address:I,serviceType:D,toiletRequestDetails:x,treePruningRequestDetails:O}=b,[L,w]=n.useState(!1),P=null!=A&&A.extraCharge?"YES":"NO",[M,F]=n.useState(null),B=N.includes("citizen")?"/digit-ui/citizen/wt/request-service":"/digit-ui/employee/wt/request-service";return i.useEffect(()=>{null!=A&&A.fileStoreId&&Digit.UploadServices.Filefetch([null==A?void 0:A.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,l,n,i;const o=null==e||null===(t=e.data)||void 0===t||null===(l=t.fileStoreIds)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.url)||void 0===i?void 0:i.split(",")[0];F(o)})},[null==A?void 0:A.fileStoreId]),i.createElement(i.Fragment,null,i.createElement(l.Card,{className:"overflow-y-scroll"},i.createElement(l.CardHeader,null,y("WT_SUMMARY_PAGE")),i.createElement("div",null,i.createElement(l.CardSubHeader,null,y("ES_TITILE_OWNER_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:y("COMMON_APPLICANT_NAME"),text:""+y(E(null==C?void 0:C.applicantName)),actionButton:i.createElement(R,{jumpTo:B+"/applicant-details"})}),i.createElement(l.Row,{label:y("COMMON_MOBILE_NUMBER"),text:""+y(E(null==C?void 0:C.mobileNumber))}),i.createElement(l.Row,{label:y("COMMON_ALT_MOBILE_NUMBER"),text:""+y(E(null==C?void 0:C.alternateNumber))}),i.createElement(l.Row,{label:y("COMMON_EMAIL_ID"),text:""+y(E(null==C?void 0:C.emailId))})),i.createElement(l.CardSubHeader,null,y("ES_TITLE_ADDRESS_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:y("HOUSE_NO"),text:""+y(E(null==I?void 0:I.houseNo)),actionButton:i.createElement(R,{jumpTo:B+"/address-details"})}),i.createElement(l.Row,{label:y("ADDRESS_LINE1"),text:""+y(E(null==I?void 0:I.addressLine1))}),i.createElement(l.Row,{label:y("ADDRESS_LINE2"),text:""+y(E(null==I?void 0:I.addressLine2))}),i.createElement(l.Row,{label:y("CITY"),text:""+y(E(null==I||null===(t=I.city)||void 0===t||null===(r=t.city)||void 0===r?void 0:r.name))}),i.createElement(l.Row,{label:y("LOCALITY"),text:""+y(E(null==I||null===(u=I.locality)||void 0===u?void 0:u.i18nKey))}),i.createElement(l.Row,{label:y("PINCODE"),text:""+y(E(null==I?void 0:I.pincode))}),i.createElement(l.Row,{label:y("LANDMARK"),text:""+y(E(null==I?void 0:I.landmark))}),i.createElement(l.Row,{label:y("STREET_NAME"),text:""+y(E(null==I?void 0:I.streetName))})),"WT"===(null==D||null===(d=D.serviceType)||void 0===d?void 0:d.code)&&i.createElement(n.Fragment,null,i.createElement(l.CardSubHeader,null,y("WT_REQUEST_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:y("WT_TANKER_TYPE"),text:""+y(E(null==A||null===(s=A.tankerType)||void 0===s?void 0:s.value)),actionButton:i.createElement(R,{jumpTo:B+"/request-details"})}),i.createElement(l.Row,{label:y("WT_WATER_TYPE"),text:""+y(E(null==A||null===(c=A.waterType)||void 0===c?void 0:c.code))}),i.createElement(l.Row,{label:y("WT_TANKER_QUANTITY"),text:""+y(E(null==A||null===(m=A.tankerQuantity)||void 0===m?void 0:m.code))}),i.createElement(l.Row,{label:y("WT_WATER_QUANTITY"),text:""+y(E(null==A||null===(v=A.waterQuantity)||void 0===v?void 0:v.value))}),i.createElement(l.Row,{label:y("WT_DELIVERY_DATE"),text:""+y(E(g(null==A?void 0:A.deliveryDate)))}),i.createElement(l.Row,{label:y("WT_DELIVERY_TIME"),text:""+E(f(null==A?void 0:A.deliveryTime))}),i.createElement(l.Row,{label:y("WT_DESCRIPTION"),text:""+y(E(null==A?void 0:A.description))}),(null==A?void 0:A.fileStoreId)&&i.createElement(l.Row,{label:y("WT_UPLOAD_DOCUMENT"),text:i.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>k(null==A?void 0:A.fileStoreId)},i.createElement(l.GenericFileIcon,null))}),i.createElement(l.Row,{label:y("WT_IMMEDIATE"),text:""+y(E(P))}))),"MobileToilet"===(null==D||null===(p=D.serviceType)||void 0===p?void 0:p.code)&&i.createElement(n.Fragment,null,i.createElement(l.CardSubHeader,null,y("ES_REQUEST_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:y("MT_NUMBER_OF_MOBILE_TOILETS"),text:""+y(E(null==x||null===(_=x.mobileToilet)||void 0===_?void 0:_.code)),actionButton:i.createElement(R,{jumpTo:B+"/toiletRequest-details"})}),i.createElement(l.Row,{label:y("MT_DELIVERY_FROM_DATE"),text:""+y(E(g(null==x?void 0:x.deliveryfromDate)))}),i.createElement(l.Row,{label:y("MT_DELIVERY_TO_DATE"),text:""+y(g(E(null==x?void 0:x.deliverytoDate)))}),i.createElement(l.Row,{label:y("MT_REQUIREMNENT_FROM_TIME"),text:E(f(null==x?void 0:x.deliveryfromTime))}),i.createElement(l.Row,{label:y("MT_REQUIREMNENT_TO_TIME"),text:E(f(null==x?void 0:x.deliverytoTime))}),i.createElement(l.Row,{label:y("MT_SPECIAL_REQUEST"),text:""+y(E(null==x?void 0:x.specialRequest))}))),"TREE_PRUNING"===(null==D||null===(h=D.serviceType)||void 0===h?void 0:h.code)&&i.createElement(n.Fragment,null,i.createElement(l.CardSubHeader,null,y("TP_REQUEST_DETAILS")),i.createElement(l.StatusTable,{style:{marginTop:"30px",marginBottom:"30px"}},i.createElement(l.Row,{label:y("REASON_FOR_PRUNING"),text:""+y(E(null==O||null===(S=O.reasonOfPruning)||void 0===S?void 0:S.code)),actionButton:i.createElement(R,{jumpTo:B+"/treePruningRequest-details"})}),i.createElement(l.Row,{label:y("LOCATION_GEOTAG"),text:""+y(E(null==O?void 0:O.geoTagLocation))}),i.createElement(l.Row,{label:y("UPLOAD_THE_SITE_PHOTOGRAPH"),text:i.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>k(null==O?void 0:O.supportingDocumentFile)},i.createElement(l.GenericFileIcon,null))}))),i.createElement(l.CheckBox,{label:y("FINAL_DECLARATION_MESSAGE"),onChange:()=>{w(!L)},checked:L})),i.createElement(l.SubmitBar,{label:y("COMMON_BUTTON_SUBMIT"),onSubmit:T,disabled:!L})))},WTAcknowledgement:e=>{let{data:t,onSuccess:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTankerCreateAPI(d),c=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=m||{};return n.useEffect(()=>{try{t.tenantId=d;let e=(e=>{var t,l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,N,C,A,I,D,x,O,L,w,P,R,k,M,F,B;return{waterTankerBookingDetail:{tenantId:null==e?void 0:e.tenantId,tankerType:null==e||null===(t=e.requestDetails)||void 0===t||null===(l=t.tankerType)||void 0===l?void 0:l.code,waterType:null==e||null===(n=e.requestDetails)||void 0===n||null===(i=n.waterType)||void 0===i?void 0:i.code,tankerQuantity:null==e||null===(o=e.requestDetails)||void 0===o||null===(a=o.tankerQuantity)||void 0===a?void 0:a.code,waterQuantity:null==e||null===(r=e.requestDetails)||void 0===r||null===(u=r.waterQuantity)||void 0===u?void 0:u.code,description:null==e||null===(d=e.requestDetails)||void 0===d?void 0:d.description,deliveryDate:null==e||null===(s=e.requestDetails)||void 0===s?void 0:s.deliveryDate,deliveryTime:null==e||null===(c=e.requestDetails)||void 0===c?void 0:c.deliveryTime,extraCharge:null!=e&&null!==(m=e.requestDetails)&&void 0!==m&&m.extraCharge?"Y":"N",addressDetailId:(null==e||null===(v=e.address)||void 0===v?void 0:v.addressDetailId)||"",applicantDetail:{name:null==e||null===(p=e.owner)||void 0===p?void 0:p.applicantName,mobileNumber:null==e||null===(E=e.owner)||void 0===E?void 0:E.mobileNumber,alternateNumber:null==e||null===(f=e.owner)||void 0===f?void 0:f.alternateNumber,emailId:null==e||null===(g=e.owner)||void 0===g?void 0:g.emailId},address:{addressType:null==e||null===(_=e.address)||void 0===_||null===(h=_.addressType)||void 0===h?void 0:h.code,pincode:null==e||null===(S=e.address)||void 0===S?void 0:S.pincode,city:null==e||null===(T=e.address)||void 0===T||null===(b=T.city)||void 0===b||null===(y=b.city)||void 0===y?void 0:y.name,cityCode:null==e||null===(N=e.address)||void 0===N||null===(C=N.city)||void 0===C||null===(A=C.city)||void 0===A?void 0:A.code,addressLine1:null==e||null===(I=e.address)||void 0===I?void 0:I.addressLine1,addressLine2:null==e||null===(D=e.address)||void 0===D?void 0:D.addressLine2,locality:null==e||null===(x=e.address)||void 0===x||null===(O=x.locality)||void 0===O?void 0:O.i18nKey,localityCode:null==e||null===(L=e.address)||void 0===L||null===(w=L.locality)||void 0===w?void 0:w.code,streetName:null==e||null===(P=e.address)||void 0===P?void 0:P.streetName,houseNo:null==e||null===(R=e.address)||void 0===R?void 0:R.houseNo,landmark:null==e||null===(k=e.address)||void 0===k?void 0:k.landmark,latitude:null==e||null===(M=e.address)||void 0===M?void 0:M.latitude,longitude:null==e||null===(F=e.address)||void 0===F?void 0:F.longitude},WTfileStoreId:null==e||null===(B=e.requestDetails)||void 0===B?void 0:B.fileStoreId,bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"watertanker",moduleName:"request-service.water_tanker"}}}})(t);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?i.createElement(l.Loader,null):i.createElement(l.Card,{className:"vehicle-details-card"},i.createElement(W,{t:u,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),i.createElement(l.StatusTable,null,s.isSuccess&&i.createElement(l.Row,{rowContainerStyle:U,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&i.createElement(l.SubmitBar,{label:u("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.waterTankerBookingDetail;const l=v.find(e=>e.code===t.tenantId);return Promise.resolve(F({...t},l,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),i.createElement(a.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},i.createElement(l.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},WTApplicationDetails:()=>{var e,t,r,u,d,s,c,m,v,p,E,_,h;const{t:S}=o.useTranslation(),{acknowledgementIds:T,tenantId:b}=a.useParams(),[y,N]=n.useState(!1),[C,A]=n.useState(null),{data:I}=Digit.Hooks.useStore.getInitData(),{tenants:D}=I||{},{isLoading:x,data:O,refetch:L}=Digit.Hooks.wt.useTankerSearchAPI({tenantId:b,filters:{bookingNo:T}}),w=Nt(O,"waterTankerBookingDetail",[]);Nt(O,"waterTankerBookingDetail[0].bookingNo",[]);let P=w&&w.length>0&&w[0]||{};const R=P;sessionStorage.setItem("wt",JSON.stringify(R));let k="N"===(null==P?void 0:P.extraCharge)?"No":"Yes";const M=Digit.Hooks.wt.useTankerCreateAPI(b,!1),{data:B,isLoading:U}=Digit.Hooks.useRecieptSearch({tenantId:b,businessService:"request-service.water_tanker",consumerCodes:T,isEmployee:!1},{enabled:!!T});let W=[];W.push({label:S("WT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>H()});const H=function(){try{const e=R||{},t=D.find(t=>t.code===e.tenantId);return Promise.resolve(F({...e},t,S)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return x?i.createElement(l.Loader,null):(B&&(null==B?void 0:B.Payments.length)>0&&0==U&&W.push({label:S("WT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=w[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.water_tanker-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(M.mutateAsync({waterTankerBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],L()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}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]})}}),i.createElement(i.Fragment,null,i.createElement("div",null,i.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},i.createElement(l.Header,{styles:{fontSize:"32px"}},S("WT_BOOKING_DETAILS")),W&&W.length>0&&i.createElement(l.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>N(!y),displayOptions:y,options:W})),i.createElement(l.Card,null,i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_BOOKING_NO"),text:null==P?void 0:P.bookingNo})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},S("WT_APPLICANT_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_APPLICANT_NAME"),text:(null==P||null===(e=P.applicantDetail)||void 0===e?void 0:e.name)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_MOBILE_NUMBER"),text:(null==P||null===(t=P.applicantDetail)||void 0===t?void 0:t.mobileNumber)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_ALT_MOBILE_NUMBER"),text:(null==P||null===(r=P.applicantDetail)||void 0===r?void 0:r.alternateNumber)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_EMAIL_ID"),text:(null==P||null===(u=P.applicantDetail)||void 0===u?void 0:u.emailId)||S("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},S("WT_ADDRESS_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_PINCODE"),text:(null==P||null===(d=P.address)||void 0===d?void 0:d.pincode)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_CITY"),text:(null==P||null===(s=P.address)||void 0===s?void 0:s.city)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_LOCALITY"),text:(null==P||null===(c=P.address)||void 0===c?void 0:c.locality)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_STREET_NAME"),text:(null==P||null===(m=P.address)||void 0===m?void 0:m.streetName)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DOOR_NO"),text:(null==P||null===(v=P.address)||void 0===v?void 0:v.doorNo)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_HOUSE_NO"),text:(null==P||null===(p=P.address)||void 0===p?void 0:p.houseNo)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_ADDRESS_LINE1"),text:(null==P||null===(E=P.address)||void 0===E?void 0:E.addressLine1)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_ADDRESS_LINE2"),text:(null==P||null===(_=P.address)||void 0===_?void 0:_.addressLine2)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_LANDMARK"),text:(null==P||null===(h=P.address)||void 0===h?void 0:h.landmark)||S("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},S("ES_REQUEST_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:S("WT_TANKER_TYPE"),text:(null==P?void 0:P.tankerType)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_WATER_TYPE"),text:S(null==P?void 0:P.waterType)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_TANKER_QUANTITY"),text:(null==P?void 0:P.tankerQuantity)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_WATER_QUANTITY"),text:(null==P?void 0:P.waterQuantity)+" Ltr"||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DELIVERY_DATE"),text:g(null==P?void 0:P.deliveryDate)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DELIVERY_TIME"),text:f(null==P?void 0:P.deliveryTime)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_DESCRIPTION"),text:(null==P?void 0:P.description)||S("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:S("WT_IMMEDIATE"),text:k||S("CS_NA")})),i.createElement(It,{application:R,id:null==R?void 0:R.bookingNo,userType:"citizen"}),C&&i.createElement(l.Toast,{error:C.key,label:S(C.label),style:{bottom:"0px"},onClose:()=>{A(null)}})))))},MTApplicationDetails:()=>{var e,t,r,u,d,s,c,m,v,p,E,_;const{t:h}=o.useTranslation(),{acknowledgementIds:S,tenantId:T}=a.useParams(),[b,y]=n.useState(!1),[N,C]=n.useState(null),{data:A}=Digit.Hooks.useStore.getInitData(),{tenants:I}=A||{},{isLoading:D,data:x,refetch:O}=Digit.Hooks.wt.useMobileToiletSearchAPI({tenantId:T,filters:{bookingNo:S}}),L=Nt(x,"mobileToiletBookingDetails",[]);Nt(x,"mobileToiletBookingDetails[0].bookingNo",[]);let w=L&&L.length>0&&L[0]||{};const P=w;sessionStorage.setItem("mt",JSON.stringify(P));const R=Digit.Hooks.wt.useMobileToiletCreateAPI(T,!1),{data:k,isLoading:M}=Digit.Hooks.useRecieptSearch({tenantId:T,businessService:"request-service.mobile_toilet",consumerCodes:S,isEmployee:!1},{enabled:!!S});let F=[];if(F.push({label:h("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>B()}),D)return i.createElement(l.Loader,null);k&&(null==k?void 0:k.Payments.length)>0&&0==M&&F.push({label:h("MT_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=L[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.mobile_toilet-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(R.mutateAsync({mobileToiletBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],O()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==k||null===(e=k.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==k?void 0:k.Payments[0]})}});const B=function(){try{const e=P||{},t=I.find(t=>t.code===e.tenantId);return Promise.resolve(Mi({...e},t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return i.createElement(i.Fragment,null,i.createElement("div",null,i.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},i.createElement(l.Header,{styles:{fontSize:"32px"}},h("MT_BOOKING_DETAILS")),F.length>0&&i.createElement(l.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>y(!b),displayOptions:b,options:F})),i.createElement(l.Card,null,i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("MT_BOOKING_NO"),text:null==w?void 0:w.bookingNo})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},h("MT_APPLICANT_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("MT_APPLICANT_NAME"),text:(null==w||null===(e=w.applicantDetail)||void 0===e?void 0:e.name)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_MOBILE_NUMBER"),text:(null==w||null===(t=w.applicantDetail)||void 0===t?void 0:t.mobileNumber)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_ALT_MOBILE_NUMBER"),text:(null==w||null===(r=w.applicantDetail)||void 0===r?void 0:r.alternateNumber)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_EMAIL_ID"),text:(null==w||null===(u=w.applicantDetail)||void 0===u?void 0:u.emailId)||h("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},h("ES_TITLE_ADDRESS_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("PINCODE"),text:(null==w||null===(d=w.address)||void 0===d?void 0:d.pincode)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("CITY"),text:(null==w||null===(s=w.address)||void 0===s?void 0:s.city)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("LOCALITY"),text:(null==w||null===(c=w.address)||void 0===c?void 0:c.locality)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("STREET_NAME"),text:(null==w||null===(m=w.address)||void 0===m?void 0:m.streetName)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("HOUSE_NO"),text:(null==w||null===(v=w.address)||void 0===v?void 0:v.houseNo)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("ADDRESS_LINE1"),text:(null==w||null===(p=w.address)||void 0===p?void 0:p.addressLine1)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("ADDRESS_LINE2"),text:(null==w||null===(E=w.address)||void 0===E?void 0:E.addressLine2)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("LANDMARK"),text:(null==w||null===(_=w.address)||void 0===_?void 0:_.landmark)||h("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},h("ES_REQUEST_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:h("MT_NUMBER_OF_MOBILE_TOILETS"),text:(null==w?void 0:w.noOfMobileToilet)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_DELIVERY_FROM_DATE"),text:g(null==w?void 0:w.deliveryFromDate)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_DELIVERY_TO_DATE"),text:g(null==w?void 0:w.deliveryToDate)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_REQUIREMNENT_FROM_TIME"),text:f(null==w?void 0:w.deliveryFromTime)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_REQUIREMNENT_TO_TIME"),text:f(null==w?void 0:w.deliveryToTime)||h("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:h("MT_SPECIAL_REQUEST"),text:(null==w?void 0:w.description)||h("CS_NA")})),i.createElement(It,{application:P,id:null==P?void 0:P.bookingNo,userType:"citizen"}),N&&i.createElement(l.Toast,{error:N.key,label:h(N.label),style:{bottom:"0px"},onClose:()=>{C(null)}}))))},TPApplicationDetails:()=>{var e,t,r,u,d,s,c,m,v,p,E,f;const{t:g}=o.useTranslation(),{acknowledgementIds:_,tenantId:h}=a.useParams(),[S,T]=n.useState(!1),[b,y]=n.useState(null),{data:N}=Digit.Hooks.useStore.getInitData(),{tenants:C}=N||{},{isLoading:A,data:I,refetch:D}=Digit.Hooks.wt.useTreePruningSearchAPI({tenantId:h,filters:{bookingNo:_}}),x=Nt(I,"treePruningBookingDetails",[]);Nt(I,"treePruningBookingDetails[0].bookingNo",[]);let O=x&&x.length>0&&x[0]||{};console.log("tp_details",O);const L=O;sessionStorage.setItem("tp",JSON.stringify(L));const w=Digit.Hooks.wt.useTreePruningCreateAPI(h,!1),{data:P,isLoading:R}=Digit.Hooks.useRecieptSearch({tenantId:h,businessService:"request-service.tree_pruning",consumerCodes:_,isEmployee:!1},{enabled:!!_});let k=[];if(k.push({label:g("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onClick:()=>M()}),A)return i.createElement(l.Loader,null);P&&(null==P?void 0:P.Payments.length)>0&&0==R&&k.push({label:g("TP_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=x[0]||{},n=null==e?void 0:e.paymentReceiptFilestoreId;const o=function(){if(!n){let i={filestoreIds:[null==l?void 0:l.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"request-service.tree_pruning-receipt")).then(function(t){var l;i=t;const o={...e,paymentReceiptFilestoreId:null===(l=i)||void 0===l?void 0:l.filestoreIds[0]};return Promise.resolve(w.mutateAsync({treePruningBookingDetail:o})).then(function(){var e;n=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],D()})})}}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==P||null===(e=P.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==P?void 0:P.Payments[0]})}});const M=function(){try{const e=L||{},t=C.find(t=>t.code===e.tenantId);return Promise.resolve(Hi({...e},t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}};return i.createElement(i.Fragment,null,i.createElement("div",null,i.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},i.createElement(l.Header,{styles:{fontSize:"32px"}},g("TP_BOOKING_DETAILS")),k.length>0&&i.createElement(l.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>T(!S),displayOptions:S,options:k})),i.createElement(l.Card,null,i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("WT_BOOKING_NO"),text:null==O?void 0:O.bookingNo})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},g("TP_APPLICANT_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("WT_APPLICANT_NAME"),text:(null==O||null===(e=O.applicantDetail)||void 0===e?void 0:e.name)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("WT_MOBILE_NUMBER"),text:(null==O||null===(t=O.applicantDetail)||void 0===t?void 0:t.mobileNumber)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("WT_ALT_MOBILE_NUMBER"),text:(null==O||null===(r=O.applicantDetail)||void 0===r?void 0:r.alternateNumber)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("WT_EMAIL_ID"),text:(null==O||null===(u=O.applicantDetail)||void 0===u?void 0:u.emailId)||g("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},g("ES_TITLE_ADDRESS_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("PINCODE"),text:(null==O||null===(d=O.address)||void 0===d?void 0:d.pincode)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("CITY"),text:(null==O||null===(s=O.address)||void 0===s?void 0:s.city)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LOCALITY"),text:(null==O||null===(c=O.address)||void 0===c?void 0:c.locality)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("STREET_NAME"),text:(null==O||null===(m=O.address)||void 0===m?void 0:m.streetName)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("HOUSE_NO"),text:(null==O||null===(v=O.address)||void 0===v?void 0:v.houseNo)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("ADDRESS_LINE1"),text:(null==O||null===(p=O.address)||void 0===p?void 0:p.addressLine1)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("ADDRESS_LINE2"),text:(null==O||null===(E=O.address)||void 0===E?void 0:E.addressLine2)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LANDMARK"),text:(null==O||null===(f=O.address)||void 0===f?void 0:f.landmark)||g("CS_NA")})),i.createElement(l.CardSubHeader,{style:{fontSize:"24px"}},g("TP_REQUEST_DETAILS")),i.createElement(l.StatusTable,null,i.createElement(l.Row,{className:"border-none",label:g("REASON_FOR_PRUNING"),text:g(null==O?void 0:O.reasonForPruning)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LATITUDE_GEOTAG"),text:(null==O?void 0:O.latitude)||g("CS_NA")}),i.createElement(l.Row,{className:"border-none",label:g("LONGITUDE_GEOTAG"),text:(null==O?void 0:O.longitude)||g("CS_NA")})),i.createElement(It,{application:L,id:null==L?void 0:L.bookingNo,userType:"citizen"}),b&&i.createElement(l.Toast,{error:b.key,label:g(b.label),style:{bottom:"0px"},onClose:()=>{y(null)}}))))},WTMyApplications:()=>{const{t:e}=o.useTranslation(),t=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,[u,d]=n.useState(""),[s,c]=n.useState(null),[m,v]=n.useState(null),[p,E]=n.useState("watertanker"),[f,g]=n.useState("watertanker");let _,h,S=window.location.href.split("/").pop();isNaN(parseInt(S))?_=4:(h=S,_=parseInt(S)+50);let T=isNaN(parseInt(S))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:t,MobileNumber:null==r?void 0:r.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:h,tenantId:t,MobileNumber:null==r?void 0:r.mobileNumber};n.useEffect(()=>{v(T)},[S]);const{isLoading:b,data:y}=Digit.Hooks.wt.useTankerSearchAPI({filters:m},{enabled:!!m&&"watertanker"===p}),{isLoading:N,data:C}=Digit.Hooks.wt.useMobileToiletSearchAPI({filters:m},{enabled:!!m&&"mobileToilet"===p}),{isLoading:A,data:I}=Digit.Hooks.wt.useTreePruningSearchAPI({filters:m},{enabled:!!m&&"treePruning"===p});let D=!1,x=[];if("watertanker"===p?(D=b,x=(null==y?void 0:y.waterTankerBookingDetail)||[]):"mobileToilet"===p?(D=N,x=(null==C?void 0:C.mobileToiletBookingDetails)||[]):"treePruning"===p?(D=A,x=null==I?void 0:I.treePruningBookingDetails):(D=b||N||A,x=[...(null==C?void 0:C.mobileToiletBookingDetails)||[],...(null==y?void 0:y.waterTankerBookingDetail)||[],...(null==I?void 0:I.treePruningBookingDetails)||[]]),D)return i.createElement(l.Loader,null);const O=[{label:e("MOBILE_TOILET"),code:"mobileToilet"},{label:e("WATER_TANKER"),code:"watertanker"},{label:e("TREE_PRUNING"),code:"treePruning"}],L=[{i18nKey:"Booking Created",code:"BOOKING_CREATED",value:e("WT_BOOKING_CREATED")},{i18nKey:"Booking Approved",code:"APPROVED",value:e("WT_BOOKING_APPROVED")},{i18nKey:"Tanker Delivered",code:"TANKER_DELIVERED",value:e("WT_TANKER_DELIVERED")},{i18nKey:"Vendor Assigned",code:"ASSIGN_VENDOR",value:e("WT_ASSIGN_VENDOR")},{i18nKey:"Rejected",code:"REJECT",value:e("WT_BOOKING_REJECTED")}],w=[{i18nKey:"BOOKING_CREATED",code:"BOOKING_CREATED",value:e("TP_BOOKING_CREATED")},{i18nKey:"PENDING_FOR_APPROVAL",code:"PENDING_FOR_APPROVAL",value:e("TP_PENDING_FOR_APPROVAL")},{i18nKey:"PAYMENT_PENDING",code:"PAYMENT_PENDING",value:e("TP_PAYMENT_PENDING")},{i18nKey:"TEAM_ASSIGNMENT_FOR_VERIFICATION",code:"TEAM_ASSIGNMENT_FOR_VERIFICATION",value:e("TP_TEAM_ASSIGNMENT_FOR_VERIFICATION")},{i18nKey:"TEAM_ASSIGNMENT_FOR_EXECUTION",code:"TEAM_ASSIGNMENT_FOR_EXECUTION",value:e("TP_TEAM_ASSIGNMENT_FOR_EXECUTION")},{i18nKey:"TREE_PRUNING_SERVICE_COMPLETED",code:"TREE_PRUNING_SERVICE_COMPLETED",value:e("TP_TREE_PRUNING_SERVICE_COMPLETED")}];return i.createElement(i.Fragment,null,i.createElement(l.Header,null,`${e("MY_BOOKINGS")} (${x.length})`),i.createElement(l.Card,null,i.createElement("div",{style:{marginLeft:"16px"}},i.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},i.createElement("div",{style:{flex:1}},i.createElement(l.CardLabel,null,e("SERVICE_TYPE")),i.createElement(l.Dropdown,{selected:O.find(e=>e.code===f),select:e=>{g(e.code),c("")},option:O,placeholder:e("Select Service Type"),optionKey:"label",t:e})),i.createElement("div",{style:{flex:1}},i.createElement(l.CardLabel,null,e("BOOKING_NO")),i.createElement(l.TextInput,{placeholder:e("Enter Booking No."),value:u,onChange:e=>d(e.target.value)})),i.createElement("div",{style:{flex:1}},i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(l.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),i.createElement(l.Dropdown,{className:"form-field",selected:s,select:c,option:"treePruning"===f?w:L,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),i.createElement("div",null,i.createElement("div",{style:{marginTop:"17%"}},i.createElement(l.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{E(f);const e=u.trim(),t={...T,bookingNo:e||void 0,status:(null==s?void 0:s.code)||void 0};v(t)}}),i.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{d(""),c("")}},e("ES_COMMON_CLEAR_ALL"))))),i.createElement(a.Link,{to:"request-service/service-type"},i.createElement(l.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("NEW_REQUEST")+" +"})))),i.createElement("div",null,x.length>0&&x.map((l,n)=>i.createElement("div",{key:n},i.createElement(Ae,{application:l,tenantId:t,buttonLabel:e("SUMMARY")}))),0===x.length&&!D&&i.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("NO_APPLICATION_FOUND_MSG")),0!==x.length&&((null==C?void 0:C.count)||0)+((null==y?void 0:y.count)||0)+((null==I?void 0:I.count)||0)>_&&i.createElement("div",null,i.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},i.createElement("span",{className:"link"},i.createElement(a.Link,{to:"/digit-ui/citizen/wt/status/"+_},e("LOAD_MORE_MSG")))))))},ApplicationDetails:Li,WFApplicationTimeline:It,WFCaption:At,WTEmpInbox:Z,WTCitizenCard:()=>{const{t:e}=o.useTranslation(),t=a.useHistory(),[r,u]=n.useState("-"),d=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getCitizenCurrentTenant(!0),{data:s,isFetching:c,isSuccess:m}=Digit.Hooks.useNewInboxGeneral({tenantId:d,ModuleCode:"WT",filters:{limit:10,offset:0,services:["watertanker"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.wtAccess()}});n.useEffect(()=>{!c&&m&&u(s)},[c]);const v=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/my-bookings"}],p={Icon:i.createElement(l.CHBIcon,null),moduleName:e("WT_MODULE_NAME"),kpis:[{count:null==r?void 0:r.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/citizen/wt/inbox"}],links:v,onDetailsClick:()=>{t.push("/digit-ui/citizen/wt/inbox")}};return i.createElement("div",{className:"wt-citizen-card-premium"},i.createElement(l.EmployeeModuleCard,p))},WTCard:H,ServiceTypes:e=>{var t;let{t:o,config:a,onSelect:r,userType:u,formData:d}=e;const s=Digit.ULBService.getStateId(),{data:c}=Digit.Hooks.useCustomMDMS(s,"request-service",[{name:"ServiceType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ServiceType}}),[m,v]=(Digit.UserService.getUser(),n.useState((null==d||null===(t=d.serviceType)||void 0===t?void 0:t.serviceType)||"")),p=n.useCallback(()=>{let e={...d.serviceType,serviceType:m};r(a.key,e,!1)},[d.serviceType,m,r,a.key]);return n.useEffect(()=>{"citizen"===u&&(console.log("calling meeeeeee"),p())},[m,u,p]),i.createElement(l.Modal,{headerBarMain:i.createElement(Ri,{t:o}),headerBarEnd:i.createElement(Pi,{onClick:()=>window.history.back()}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"50vh",width:"50%",overflowY:"visible"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},i.createElement(i.Fragment,null,i.createElement(l.FormStep,{config:a,onSelect:p,t:o,isDisabled:!m},i.createElement("div",null,i.createElement(l.CardLabel,null,""+o("REQUEST_TYPE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:m,placeholder:"Select Service Type",select:v,option:c,optionKey:"i18nKey",t:o})))))},ToiletRequestDetails:e=>{var t,o,a,r,u,d;let{t:s,config:c,onSelect:m,userType:v,formData:p}=e;const E=Digit.UserService.getUser().info,[f,g]=n.useState((null==p||null===(t=p.toiletRequestDetails)||void 0===t?void 0:t.mobileToilet)||""),[_,h]=n.useState((null==p||null===(o=p.toiletRequestDetails)||void 0===o?void 0:o.deliveryfromTime)||""),[S,T]=n.useState((null==p||null===(a=p.toiletRequestDetails)||void 0===a?void 0:a.deliverytoTime)||""),[b,y]=n.useState((null==p||null===(r=p.toiletRequestDetails)||void 0===r?void 0:r.deliveryfromDate)||""),[N,C]=n.useState((null==p||null===(u=p.toiletRequestDetails)||void 0===u?void 0:u.deliverytoDate)||""),[A,I]=n.useState((null==p||null===(d=p.toiletRequestDetails)||void 0===d?void 0:d.specialRequest)||""),D=Digit.ULBService.getStateId(),x={width:"EMPLOYEE"===E.type?"52%":"100%"},{data:O}=Digit.Hooks.useCustomMDMS(D,"request-service",[{name:"NoOfMobileToilet"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.NoOfMobileToilet}});let L=[];O&&O.map(e=>{L.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const w=()=>i.createElement("div",{className:"flex items-center"},i.createElement(l.TextInput,{type:"time",value:_,style:x,onChange:e=>h(e.target.value),min:"06:00",max:"23:59"})),P=()=>i.createElement("div",{className:"flex items-center"},i.createElement(l.TextInput,{type:"time",value:S,style:x,onChange:e=>T(e.target.value),min:"06:00",max:"23:59"})),R=()=>{let e={...p.toiletRequestDetails,mobileToilet:f,deliveryfromTime:_,deliverytoTime:S,deliveryfromDate:b,deliverytoDate:N,specialRequest:A};m(c.key,e,!1)};return n.useEffect(()=>{"citizen"===v&&R()},[f,_,S,b,N,A]),i.createElement(i.Fragment,null,i.createElement(l.FormStep,{config:c,onSelect:R,t:s,isDisabled:!(f&&_&&S&&b&&N&&A)},i.createElement("div",null,i.createElement(l.CardLabel,null,s("MT_NUMBER_OF_MOBILE_TOILETS")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:f,placeholder:"Select Number of Mobile Toilets",select:g,option:L,style:x,optionKey:"i18nKey",t:s}),i.createElement(l.CardLabel,null,""+s("MT_DELIVERY_FROM_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",style:x,value:b,onChange:function(e){y(e.target.value)},min:(new Date).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),i.createElement(l.CardLabel,null,""+s("MT_DELIVERY_TO_DATE")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(l.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"deliveryDate",value:N,style:x,onChange:function(e){C(e.target.value)},min:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),i.createElement(l.CardLabel,null,""+s("MT_REQUIREMNENT_FROM_TIME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(w,null),i.createElement(l.CardLabel,null,""+s("MT_REQUIREMNENT_TO_TIME")," ",i.createElement("span",{className:"astericColor"},"*")),i.createElement(P,null),i.createElement(l.CardLabel,null,""+s("MT_SPECIAL_REQUEST")," ",i.createElement("span",{className:"check-page-link-button"})),i.createElement(l.TextArea,{t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"mobileToilet",style:x,placeholder:"Special Request",value:A,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===E.type?"51.6%":null}}))))},TreePruningRequestDetails:e=>{var t,o,a;let{t:r,config:u,onSelect:d,userType:s,formData:c}=e;const m=Digit.UserService.getUser().info,[v,p]=n.useState((null==c||null===(t=c.treePruningRequestDetails)||void 0===t?void 0:t.reasonOfPruning)||""),[E,f]=n.useState(""),[g,_]=n.useState(""),[h,S]=n.useState((null==c||null===(o=c.treePruningRequestDetails)||void 0===o?void 0:o.geoTagLocation)||""),[T,b]=n.useState((null==c||null===(a=c.treePruningRequestDetails)||void 0===a?void 0:a.supportingDocumentFile)||""),[y,N]=n.useState(!1),[C,A]=n.useState(""),I=Digit.ULBService.getStateId(),D={width:"EMPLOYEE"===m.type?"50%":"100%"},{data:x}=Digit.Hooks.useCustomMDMS(I,"request-service",[{name:"ReasonPruningType"}],{select:e=>{var t;return null==e||null===(t=e["request-service"])||void 0===t?void 0:t.ReasonPruningType}}),O=()=>{let e={...c.treePruningRequestDetails,reasonOfPruning:v,geoTagLocation:h,supportingDocumentFile:T,latitude:E,longitude:g};d(u.key,e,!1)};n.useEffect(()=>{"citizen"===s&&O()},[v,h,T,y]);const L=()=>i.createElement("div",{className:"loading-spinner"});return i.createElement(l.FormStep,{config:u,onSelect:O,t:r,isDisabled:!v||!T},i.createElement("div",null,i.createElement(l.CardLabel,null,r("REASON_FOR_PRUNING")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement(l.Dropdown,{className:"form-field",selected:v,placeholder:"Select Reason",select:p,option:x,style:D,optionKey:"code",t:r}),i.createElement(l.CardLabel,null,r("LOCATION_GEOTAG")),i.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:"8px",width:"EMPLOYEE"===m.type?"53%":"100%"}},i.createElement(l.TextInput,{t:r,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"geoTagLocation",value:h,placeholder:"Select Location",onChange:e=>{const{name:t,value:l}=e.target?e.target:{name:e.name,value:e};"reasonOfPruning"===t?p(l):"geoTagLocation"===t||"location"===t?S(l):"supportingDocumentFile"===t&&b(l)},max:(new Date).toISOString().split("T")[0],style:{flex:1},rules:{required:r("dddddddd"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||r("hhhhhhh")},className:"location-input"}),i.createElement("div",{className:"butt-icon",onClick:()=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{const{latitude:t,longitude:l}=e.coords;S(`${t}, ${l}`),f(t),_(l)},e=>{console.error("Error getting location:",e),alert("Unable to retrieve your location. Please check your browser settings.")}):alert("Geolocation is not supported by your browser.")},style:{cursor:"pointer",width:"25px",marginBottom:"8px"}},i.createElement(l.LocationIcon,{className:"fill-path-primary-main"}))),i.createElement(l.CardLabel,null,r("UPLOAD_THE_SITE_PHOTOGRAPH")," ",i.createElement("span",{className:"check-page-link-button"},"*")),i.createElement("div",{style:{marginBottom:"16px",...D}},i.createElement(l.UploadFile,{id:"supportingDocument",onUpload:e=>((e,t)=>{const l=e.target.files[0];l.size>=5242880?(setError("supportingDocument",{message:r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")}),t(null)):(N(!0),Digit.UploadServices.Filestorage("TP",l,Digit.ULBService.getStateId()).then(e=>{var l,n;(null==e||null===(l=e.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?t(e.data.files[0].fileStoreId):setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})}).catch(()=>setError("supportingDocument",{message:r("CS_FILE_UPLOAD_ERROR")})).finally(()=>N(!1)))})(e,b),onDelete:()=>{b(null)},message:y?i.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},i.createElement(L,null),i.createElement("span",null,"Uploading...")):T?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},accept:"image/*, .pdf, .png, .jpeg, .jpg",buttonType:"button",error:C||!T}))))},MTAcknowledgement:e=>{let{data:t,onSuccess:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useMobileToiletCreateAPI(d),c=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=m||{};return n.useEffect(()=>{try{t.tenantId=d;let e=(e=>{var t,l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,N,C,A,I,D,x,O;return{mobileToiletBookingDetail:{tenantId:null==e?void 0:e.tenantId,description:null==e||null===(t=e.toiletRequestDetails)||void 0===t?void 0:t.specialRequest,noOfMobileToilet:null==e||null===(l=e.toiletRequestDetails)||void 0===l||null===(n=l.mobileToilet)||void 0===n?void 0:n.code,deliveryFromDate:null==e||null===(i=e.toiletRequestDetails)||void 0===i?void 0:i.deliveryfromDate,deliveryToDate:null==e||null===(o=e.toiletRequestDetails)||void 0===o?void 0:o.deliverytoDate,deliveryFromTime:null==e||null===(a=e.toiletRequestDetails)||void 0===a?void 0:a.deliveryfromTime,deliveryToTime:null==e||null===(r=e.toiletRequestDetails)||void 0===r?void 0:r.deliverytoTime,addressDetailId:(null==e||null===(u=e.address)||void 0===u?void 0:u.addressDetailId)||"",applicantDetail:{name:null==e||null===(d=e.owner)||void 0===d?void 0:d.applicantName,mobileNumber:null==e||null===(s=e.owner)||void 0===s?void 0:s.mobileNumber,alternateNumber:null==e||null===(c=e.owner)||void 0===c?void 0:c.alternateNumber,emailId:null==e||null===(m=e.owner)||void 0===m?void 0:m.emailId},address:{addressType:null==e||null===(v=e.address)||void 0===v||null===(p=v.addressType)||void 0===p?void 0:p.code,pincode:null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,city:null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.name,cityCode:null==e||null===(h=e.address)||void 0===h||null===(S=h.city)||void 0===S||null===(T=S.city)||void 0===T?void 0:T.code,addressLine1:null==e||null===(b=e.address)||void 0===b?void 0:b.addressLine1,addressLine2:null==e||null===(y=e.address)||void 0===y?void 0:y.addressLine2,locality:null==e||null===(N=e.address)||void 0===N||null===(C=N.locality)||void 0===C?void 0:C.i18nKey,localityCode:null==e||null===(A=e.address)||void 0===A||null===(I=A.locality)||void 0===I?void 0:I.code,streetName:null==e||null===(D=e.address)||void 0===D?void 0:D.streetName,houseNo:null==e||null===(x=e.address)||void 0===x?void 0:x.houseNo,landmark:null==e||null===(O=e.address)||void 0===O?void 0:O.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"mobileToilet",moduleName:"request-service.mobile_toilet"}}}})(t);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?i.createElement(l.Loader,null):i.createElement(l.Card,null,i.createElement(Ui,{t:u,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),i.createElement(l.StatusTable,null,s.isSuccess&&i.createElement(l.Row,{rowContainerStyle:Bi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&i.createElement(l.SubmitBar,{label:u("MT_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.mobileToiletBookingDetail;const l=v.find(e=>e.code===t.tenantId);return Promise.resolve(Mi({...t},l,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),i.createElement(a.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},i.createElement(l.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},TPAcknowledgement:e=>{let{data:t,onSuccess:r}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.wt.useTreePruningCreateAPI(d),c=Digit.UserService.getUser().info,{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=m||{};return n.useEffect(()=>{try{t.tenantId=d;let e=(e=>{var t,l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,g,_,h,S,T,b,y,N,C,A,I;return{treePruningBookingDetail:{tenantId:null==e?void 0:e.tenantId,latitude:null==e||null===(t=e.treePruningRequestDetails)||void 0===t?void 0:t.latitude,longitude:null==e||null===(l=e.treePruningRequestDetails)||void 0===l?void 0:l.longitude,reasonForPruning:null==e||null===(n=e.treePruningRequestDetails)||void 0===n||null===(i=n.reasonOfPruning)||void 0===i?void 0:i.code,applicantDetail:{name:null==e||null===(o=e.owner)||void 0===o?void 0:o.applicantName,mobileNumber:null==e||null===(a=e.owner)||void 0===a?void 0:a.mobileNumber,alternateNumber:null==e||null===(r=e.owner)||void 0===r?void 0:r.alternateNumber,emailId:null==e||null===(u=e.owner)||void 0===u?void 0:u.emailId},documentDetails:[{documentType:"Site Photograph",fileStoreId:null==e||null===(d=e.treePruningRequestDetails)||void 0===d?void 0:d.supportingDocumentFile}],address:{addressType:null==e||null===(s=e.address)||void 0===s||null===(c=s.addressType)||void 0===c?void 0:c.code,pincode:null==e||null===(m=e.address)||void 0===m?void 0:m.pincode,city:null==e||null===(v=e.address)||void 0===v||null===(p=v.city)||void 0===p||null===(E=p.city)||void 0===E?void 0:E.name,cityCode:null==e||null===(f=e.address)||void 0===f||null===(g=f.city)||void 0===g||null===(_=g.city)||void 0===_?void 0:_.code,addressLine1:null==e||null===(h=e.address)||void 0===h?void 0:h.addressLine1,addressLine2:null==e||null===(S=e.address)||void 0===S?void 0:S.addressLine2,locality:null==e||null===(T=e.address)||void 0===T||null===(b=T.locality)||void 0===b?void 0:b.i18nKey,localityCode:null==e||null===(y=e.address)||void 0===y||null===(N=y.locality)||void 0===N?void 0:N.code,streetName:null==e||null===(C=e.address)||void 0===C?void 0:C.streetName,houseNo:null==e||null===(A=e.address)||void 0===A?void 0:A.houseNo,landmark:null==e||null===(I=e.address)||void 0===I?void 0:I.landmark},bookingStatus:"BOOKING_CREATED",workflow:{action:"APPLY",comments:"",businessService:"treePruning",moduleName:"request-service.tree_pruning"}}}})(t);s.mutate(e,{onSuccess:r})}catch(e){}},[]),Digit.Hooks.useCustomBackNavigation({redirectPath:"${APPLICATION_PATH}/citizen"}),s.isLoading||s.isIdle?i.createElement(l.Loader,null):i.createElement(l.Card,null,i.createElement(Vi,{t:u,data:s.data,isSuccess:s.isSuccess,isLoading:s.isIdle||s.isLoading}),i.createElement(l.StatusTable,null,s.isSuccess&&i.createElement(l.Row,{rowContainerStyle:zi,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),s.isSuccess&&i.createElement(l.SubmitBar,{label:u("TP_DOWNLOAD_ACKNOWLEDGEMENT"),onSubmit:function(){try{var e;let t=null===(e=s.data)||void 0===e?void 0:e.treePruningBookingDetail;const l=v.find(e=>e.code===t.tenantId);return Promise.resolve(Hi({...t},l,u)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),i.createElement(a.Link,"CITIZEN"===(null==c?void 0:c.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},i.createElement(l.LinkButton,{label:u("CORE_COMMON_GO_TO_HOME")})))},MTCitizenCard:()=>{const{t:e}=o.useTranslation(),[t,a]=n.useState("-"),r=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),{data:u,isFetching:d,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:r,ModuleCode:"WT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}});n.useEffect(()=>{!d&&s&&a(u)},[d]);const c=[{label:e("ES_COMMON_INBOX"),link:"/digit-ui/citizen/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/citizen/wt/mt/my-bookings"}],m={Icon:i.createElement(l.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==t?void 0:t.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"}],links:c};return i.createElement(l.EmployeeModuleCard,m)},FixedPointScheduleManagement:ee,LiveTrackingSystem:Ee,AddFillingPointAddress:he,AddFixPointAddress:Se,AddFillingPointMetaData:fe,WTSearchPointAddress:be,VendorAssign:Ne};exports.WTComponents={WTCard:H,WTModule:Gi,MTCard:()=>{const{t:e}=o.useTranslation(),[t,a]=n.useState("-"),{data:r,isLoading:u,isFetching:d,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"MT",filters:{limit:10,offset:0,services:["mobileToilet"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.mtAccess()}});if(n.useEffect(()=>{!d&&s&&a(r)},[d]),!Digit.Utils.mtAccess())return null;const c=[{count:u?"-":null==t?void 0:t.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/mt/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/mt/my-bookings"},{label:e("MT_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/mt/request-service"}],m=Digit.UserService.hasAccess(["MT_CEMP"])||!1,v={Icon:i.createElement(l.CHBIcon,null),moduleName:e("ACTION_TEST_MT"),kpis:[{count:null==t?void 0:t.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/mt/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||m)};return i.createElement(l.EmployeeModuleCard,v)},TPCard:()=>{const{t:e}=o.useTranslation(),[t,a]=n.useState("-"),{data:r,isLoading:u,isFetching:d,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"TP",filters:{limit:10,offset:0,services:["treePruning"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.tpAccess()}});n.useEffect(()=>{!d&&s&&a(r)},[d]);const c=[{count:u?"-":null==t?void 0:t.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/wt/tp/my-bookings"},{label:e("TP_APPLICATION_CREATE"),link:"/digit-ui/employee/wt/tp/request-service"}],m=Digit.UserService.hasAccess(["TP_CEMP"])||!1,v={Icon:i.createElement(l.CHBIcon,null),moduleName:e("ACTION_TEST_TP"),kpis:[{count:null==t?void 0:t.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/wt/tp/inbox"}],links:c.filter(e=>!(null!=e&&e.role)||m)};return i.createElement(l.EmployeeModuleCard,v)},WTLinks:Ki,WT_INBOX_FILTER:e=>i.createElement(Ot,e),WTInboxTableConfig:e=>({WT:{inboxColumns:t=>[{Header:e("WT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,n,o,r;let{row:u}=e;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:`${t.detailRoute||t.parentRoute+"/booking-details"}/${null==u||null===(l=u.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.bookingNo}`},null===(o=u.original)||void 0===o||null===(r=o.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return xt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("WT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("WT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n;let{row:i}=t;return Dt(e(""+(null===(l=i.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode)))},mobileCell:t=>{var l;return xt(e(""+(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode)))}},{Header:e("WT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return Dt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return xt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},MT:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,n,o,r;let{row:u}=e;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(l=u.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.bookingNo)},null===(o=u.original)||void 0===o||null===(r=o.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return xt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n;let{row:i}=t;return Dt(e(""+(null===(l=i.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode)))},mobileCell:t=>{var l;return xt(e(""+(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode)))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return Dt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return xt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}},TP:{inboxColumns:t=>[{Header:e("MT_BOOKING_NO"),id:"bookingNo",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)||""},Cell:e=>{var l,n,o,r;let{row:u}=e;return i.createElement("div",null,i.createElement("span",{className:"link"},i.createElement(a.Link,{to:t.parentRoute+"/booking-details/"+(null==u||null===(l=u.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.bookingNo)},null===(o=u.original)||void 0===o||null===(r=o.searchData)||void 0===r?void 0:r.bookingNo)))},mobileCell:e=>{var t;return xt(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("MT_APPLICANT_NAME"),id:"applicantName",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.name))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.name)}},{Header:e("MT_MOBILE_NUMBER"),id:"mobileNumber",accessor:e=>{var t,l;return(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)||""},Cell:e=>{var t,l,n,i,o;return Dt(""+(null==e||null===(t=e.cell)||void 0===t||null===(l=t.row)||void 0===l||null===(n=l.original)||void 0===n||null===(i=n.searchData)||void 0===i||null===(o=i.applicantDetail)||void 0===o?void 0:o.mobileNumber))},mobileCell:e=>{var t,l;return xt(null==e||null===(t=e.searchData)||void 0===t||null===(l=t.applicantDetail)||void 0===l?void 0:l.mobileNumber)}},{Header:e("LOCALITY"),id:"localityCode",accessor:e=>{var t;return(null==e||null===(t=e.searchData)||void 0===t?void 0:t.localityCode)||""},Cell:t=>{var l,n;let{row:i}=t;return Dt(e(""+(null===(l=i.original)||void 0===l||null===(n=l.searchData)||void 0===n?void 0:n.localityCode)))},mobileCell:t=>{var l;return xt(e(""+(null==t||null===(l=t.searchData)||void 0===l?void 0:l.localityCode)))}},{Header:e("MT_STATUS"),id:"applicationStatus",accessor:e=>{var t,l;return(null==e||null===(t=e.workflowData)||void 0===t||null===(l=t.state)||void 0===l?void 0:l.applicationStatus)||""},Cell:t=>{var l,n,i;let{row:o}=t;return Dt(e(""+(null==o||null===(l=o.original)||void 0===l||null===(n=l.workflowData)||void 0===n||null===(i=n.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var l,n;return xt(e("ES_WT_COMMON_STATUS_"+(null==t||null===(l=t.workflowData)||void 0===l||null===(n=l.state)||void 0===n?void 0:n.applicationStatus)))}}],serviceRequestIdKey:t=>{var l,n;return null==t||null===(l=t[e("WT_INBOX_UNIQUE_BOOKING_NO")])||void 0===l||null===(n=l.props)||void 0===n?void 0:n.children}}})},exports.WTLinks=Ki,exports.WTModule=Gi,exports.initWTComponents=()=>{Object.entries(Yi).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
|