@mseva/upyog-ui-module-ads 1.0.70 → 1.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),a=require("react-router-dom"),i=require("react-hook-form"),l=require("react-query"),s=require("react-redux"),u=require("redux");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function d(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"CS_NA"},f=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},m=e=>r.createElement("h1",{className:"heading-m"},e.t("CHB_CANCEL")),v=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),g=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(v,null)),h=e=>{let{t:o,closeModal:a,actionCancelLabel:l,actionCancelOnSubmit:s,actionSaveLabel:u,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,f]=n.useState(!1),{handleSubmit:v}=i.useForm();return r.createElement(t.Modal,{headerBarMain:r.createElement(m,{t:o}),headerBarEnd:r.createElement(g,{onClick:a}),actionCancelLabel:o(l),actionCancelOnSubmit:s,actionSaveLabel:o(u),actionSaveOnSubmit:v(c),isDisabled:!p,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},r.createElement("form",{onSubmit:v(d)},r.createElement(t.CheckBox,{label:o("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{f(!p)},style:{height:"auto"}}))))},y=e=>{var o,l,s;let{tenantId:u,isLoading:d,t:p,onSubmit:f,data:m,count:v,setShowToast:g,userType:y}=e;const E=window.Digit.Utils.browser.isMobile(),{register:S,control:b,handleSubmit:D,setValue:A,getValues:_,reset:T,formState:C}=i.useForm({defaultValues:{offset:0,limit:!E&&10,sortBy:"createdTime",sortOrder:"DESC",fromDate:(new Date).toISOString().split("T")[0],toDate:(new Date).toISOString().split("T")[0],status:""}});console.log("data :>> ",m),n.useEffect(()=>{S("offset",0),S("limit",10),S("sortBy","createdTime"),S("sortOrder","DESC"),D(f)()},[S]);const[N,x]=n.useState(""),[w,I]=n.useState(!1),L=Digit.Hooks.ads.useADSCreateAPI(u,!1),k=a.useHistory(),{data:O}=(((null==k||null===(o=k.location)||void 0===o?void 0:o.pathname)||"").split("/").pop(),Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}));O&&O.map(e=>{});const R=e=>r.createElement("span",{className:"cell-text"},e),P=function(){try{I(!1);const e=c({},N,{bookingStatus:"CANCELLED"});return Promise.resolve(L.mutateAsync({bookingApplication:e})).then(function(){D(f)()})}catch(e){return Promise.reject(e)}},M=n.useMemo(()=>[{Header:p("ADS_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(a.Link,{to:"citizen"===y?"/digit-ui/citizen/ads/application/"+t.original.bookingNo+"/"+u:"/digit-ui/employee/ads/applicationsearch/application-details/"+t.original.bookingNo},t.original.bookingNo)))}},{Header:p("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r;return R(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(r=n.applicantDetail)||void 0===r?void 0:r.applicantName))},disableSortBy:!0},{Header:p("ADS_LOCALITY"),Cell:e=>{var t;let{row:n}=e;const r=null==n||null===(t=n.original)||void 0===t?void 0:t.cartDetails,o=null==r?void 0:r.map(e=>null==e?void 0:e.location).join(", ");return R(o)},disableSortBy:!0},{Header:p("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{let{row:t}=e;return R(""+p(null==t?void 0:t.original.bookingStatus))},disableSortBy:!0}],[]),B=[{i18nKey:"Booked",code:"BOOKED",value:p("ADS_BOOKED")},{i18nKey:"Booking in Progress",code:"BOOKING_CREATED",value:p("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:p("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:p("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:p("ADS_CANCELLED")},{i18nKey:"Available",code:"AVAILABLE",value:p("ADS_AVAILABLE")}],F=n.useCallback(e=>{0!==e.length&&(A("sortBy",e.id),A("sortOrder",e.desc?"DESC":"ASC"))},[]);function j(){A("offset",_("offset")-_("limit")),D(f)()}return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(t.Header,null,p("ADS_SEARCH_BOOKINGS")),r.createElement(t.Card,{className:"card-search-heading"},r.createElement("span",{style:{color:"#505A5F"}},p("Provide at least one parameter to search for an application"))),r.createElement(t.SearchForm,{onSubmit:f,handleSubmit:D},r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_BOOKING_NO")),r.createElement(t.TextInput,{name:"bookingNo",inputRef:S({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_APPLICANT_NAME")),r.createElement(t.TextInput,{name:"applicantName",inputRef:S({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("PT_COMMON_TABLE_COL_STATUS_LABEL")),r.createElement(i.Controller,{control:b,name:"status",render:e=>r.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:B,optionKey:"i18nKey",t:p,disable:!1})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:S({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:r.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),r.createElement(t.CardLabelError,null,null==C||null===(l=C.errors)||void 0===l||null===(s=l.mobileNumber)||void 0===s?void 0:s.message)),r.createElement(t.SearchField,null,r.createElement("label",null,p("FROM_DATE")),r.createElement(i.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:b})),r.createElement(t.SearchField,null,r.createElement("label",null,p("TO_DATE")),r.createElement(i.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:b})),r.createElement(t.SearchField,{className:"submit"},r.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),r.createElement("p",{style:{marginTop:"10px"},onClick:()=>{T({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),g(null),j()}},p("ES_COMMON_CLEAR_ALL")))),!d&&null!=m&&m.display?r.createElement(t.Card,{style:{marginTop:20}},p(m.display).split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):d||""===m?""!==m||d&&r.createElement(t.Loader,null):r.createElement(t.Table,{t:p,data:m,totalRecords:v,columns:M,getCellProps:e=>({style:{minWidth:e.column.Header===p("ADS_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){A("limit",Number(e.target.value)),D(f)()},currentPage:_("offset")/_("limit"),onNextPage:function(){A("offset",_("offset")+_("limit")),D(f)()},onPrevPage:j,pageSizeLimit:_("limit"),onSort:F,disableSort:!1,sortParams:[{id:_("sortBy"),desc:"DESC"===_("sortOrder")}]})),w&&r.createElement(h,{t:p,closeModal:()=>I(!1),actionCancelLabel:"BACK",actionCancelOnSubmit:()=>I(!1),actionSaveLabel:"ADS_CANCEL",actionSaveOnSubmit:P,onSubmit:P}))},E=e=>{var i,l;let{userType:s}=e;a.useParams();const{t:u}=o.useTranslation(),d="undefined"!=typeof window&&(null===(i=window.location)||void 0===i||null===(l=i.href)||void 0===l?void 0:l.includes("citizen"))?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState({}),[m,v]=n.useState(null);n.useEffect(()=>{if(m){const e=setTimeout(()=>{v(null)},1e3);return()=>clearTimeout(e)}},[m]);const g={enabled:!!(p&&Object.keys(p).length>0)},{isLoading:h,isSuccess:E,data:{bookingApplication:S,Count:b}={}}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:p},g);return r.createElement(r.Fragment,null,r.createElement(y,{t:u,isLoading:h,tenantId:d,setShowToast:v,onSubmit:function(e){const t=c({},e,e.toDate?{toDate:null==e?void 0:e.toDate}:{},e.fromDate?{fromDate:null==e?void 0:e.fromDate}:{});let n=Object.keys(t).filter(e=>t[e]).reduce((e,n)=>c({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{});!(Object.entries(n).length>0)||n.bookingNo||n.fromDate||n.status||n.applicantName||n.faceArea||n.toDate||n.mobileNumber?Object.entries(n).length>0&&n.fromDate&&!n.toDate||!n.fromDate&&n.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):f(n):v({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:E&&!h?S.length>0?S:{display:"ES_COMMON_NO_DATA"}:"",count:b,userType:s}),m&&r.createElement(t.Toast,{error:m.error,warning:m.warning,label:u(m.label),onClose:()=>{v(null)}}))},S=["path","url"],b=[],D=()=>{var e,n,i,l,s,u,c,p,f,m;const v=a.useRouteMatch(),{path:g}=v,h=(d(v,S),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewADSStepperForm")),y=null===(i=Digit)||void 0===i||null===(l=i.ComponentRegistryService)||void 0===l?void 0:l.getComponent("ADSMyApplications"),E=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSApplicationDetails"),D=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ADSResponseCitizen"),A=null===(f=Digit)||void 0===f||null===(m=f.ComponentRegistryService)||void 0===m?void 0:m.getComponent("CitizenApplicationOverview");return r.createElement("span",{className:"ads-citizen",style:{width:"100%"}},r.createElement(a.Switch,null,r.createElement(t.AppContainer,null,(void 0===(_=b)&&(_=[]),_.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":r.createElement(t.BackButton,null,"Back")),r.createElement(t.PrivateRoute,{path:g+"/bookad",component:h}),r.createElement(t.PrivateRoute,{path:g+"/myBookings",component:y}),r.createElement(t.PrivateRoute,{path:g+"/application/:acknowledgementIds/:tenantId",component:E}),r.createElement(t.PrivateRoute,{path:g+"/adsservice/:response/:bookingNo",component:D}),r.createElement(t.PrivateRoute,{path:g+"/adsservice/:application-overview/:bookingNo",component:A}))));var _},A=e=>{var n;let{status:a,searchParams:i,onAssignmentChange:l,statusMap:s}=e;return o.useTranslation(),r.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>l(c({},e,{state:a.state}),a),checked:null==i||null===(u=i.applicationStatus)||void 0===u?void 0:u.some(e=>e.uuid===a.uuid),label:a.name+" ("+((null==s||null===(n=s.find(e=>e.statusid===a.uuid))||void 0===n?void 0:n.count)||"-")+")"});var u},_=e=>{var a,i,l,s,u;let{onAssignmentChange:d,searchParams:p,businessServices:f,statusMap:m}=e;const{t:v}=o.useTranslation(),[g,h]=n.useState(!1),{data:y,isLoading:E}=Digit.Hooks.useApplicationStatusGeneral({businessServices:f},{});console.log("statusData :>> ",y);const{userRoleStates:S}=y||{},b={"ADV.CREATE":v("ES_ADV_NEW_BOOKING"),"ADV.UPDATE":v("ES_ADV_UPDATE_BOOKING")},D=(e,t)=>t(b[e.stateBusinessService])+" - "+t("ES_ADS_COMMON_STATUS_"+(e.state||"CREATED"));return E?r.createElement(t.Loader,null):null!=S&&S.filter(e=>!e.isTerminateState).length?r.createElement("div",{className:"status-container"},r.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_INBOX_STATUS")),null==S||null===(a=S.filter(e=>!e.isTerminateState))||void 0===a||null===(i=a.slice(0,4))||void 0===i?void 0:i.map((e,t)=>r.createElement(A,{businessServices:f,key:t,onAssignmentChange:d,status:c({name:D(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m})),(null==S||null===(l=S.filter(e=>!e.isTerminateState))||void 0===l?void 0:l.slice(4).length)>0?r.createElement(r.Fragment,null,g&&(null==S||null===(s=S.filter(e=>!e.isTerminateState))||void 0===s||null===(u=s.slice(4))||void 0===u?void 0:u.map((e,t)=>r.createElement(A,{businessServices:f,key:e.uuid,onAssignmentChange:d,status:c({name:D(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m}))),r.createElement("div",{className:"filter-button",onClick:()=>h(!g)}," ",v(g?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(e,t){return e(t={exports:{}},t.exports),t.exports}var N=C(function(e,t){(function(){var n="Expected a function",r="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],a="[object Arguments]",i="[object Array]",l="[object Boolean]",s="[object Date]",u="[object Error]",c="[object Function]",d="[object GeneratorFunction]",p="[object Map]",f="[object Number]",m="[object Object]",v="[object RegExp]",g="[object Set]",h="[object String]",y="[object Symbol]",E="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",D="[object Float32Array]",A="[object Float64Array]",_="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",x="[object Uint8Array]",w="[object Uint16Array]",I="[object Uint32Array]",L=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(R.source),B=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,V=RegExp(W.source),G=/^\s+/,K=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,re=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ae=/^0o[0-7]+$/i,ie=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",fe="["+ce+"]",me="\\d+",ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",ge="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",he="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",De="(?:"+ve+"|"+ge+")",Ae="(?:"+be+"|"+ge+")",_e="(?:"+fe+"|"+he+")?",Te="[\\ufe0e\\ufe0f]?"+_e+"(?:\\u200d(?:"+[ye,Ee,Se].join("|")+")[\\ufe0e\\ufe0f]?"+_e+")*",Ce="(?:"+["[\\u2700-\\u27bf]",Ee,Se].join("|")+")"+Te,Ne="(?:"+[ye+fe+"?",fe,Ee,Se,"[\\ud800-\\udfff]"].join("|")+")",xe=RegExp("['’]","g"),we=RegExp(fe,"g"),Ie=RegExp(he+"(?="+he+")|"+Ne+Te,"g"),Le=RegExp([be+"?"+ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,be+De,"$"].join("|")+")",be+"?"+De+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ce].join("|"),"g"),ke=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Oe=/[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"],Pe=-1,Me={};Me[D]=Me[A]=Me[_]=Me[C]=Me[N]=Me[x]=Me["[object Uint8ClampedArray]"]=Me[w]=Me[I]=!0,Me[a]=Me[i]=Me[S]=Me[l]=Me[b]=Me[s]=Me[u]=Me[c]=Me[p]=Me[f]=Me[m]=Me[v]=Me[g]=Me[h]=Me[E]=!1;var Be={};Be[a]=Be[i]=Be[S]=Be[b]=Be[l]=Be[s]=Be[D]=Be[A]=Be[_]=Be[C]=Be[N]=Be[p]=Be[f]=Be[m]=Be[v]=Be[g]=Be[h]=Be[y]=Be[x]=Be["[object Uint8ClampedArray]"]=Be[w]=Be[I]=!0,Be[u]=Be[c]=Be[E]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},je=parseFloat,He=parseInt,Ue="object"==typeof T&&T&&T.Object===Object&&T,ze="object"==typeof self&&self&&self.Object===Object&&self,qe=Ue||ze||Function("return this")(),We=t&&!t.nodeType&&t,Ve=We&&e&&!e.nodeType&&e,Ge=Ve&&Ve.exports===We,Ke=Ge&&Ue.process,$e=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ye=$e&&$e.isArrayBuffer,Xe=$e&&$e.isDate,Ze=$e&&$e.isMap,Je=$e&&$e.isRegExp,Qe=$e&&$e.isSet,et=$e&&$e.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,r){for(var o=-1,a=null==e?0:e.length;++o<a;){var i=e[o];t(r,i,n(i),e)}return r}function rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function at(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function it(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}function lt(e,t){return!(null==e||!e.length)&&ht(e,t,0)>-1}function st(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function dt(e,t,n,r){var o=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++o]);++o<a;)n=t(n,e[o],o,e);return n}function pt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function ft(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=bt("length");function vt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function gt(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}function ht(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):gt(e,Et,n)}function yt(e,t,n,r){for(var o=n-1,a=e.length;++o<a;)if(r(e[o],t))return o;return-1}function Et(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?_t(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function Dt(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,r,o){return o(e,function(e,o,a){n=r?(r=!1,e):t(n,e,o,a)}),n}function _t(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);void 0!==a&&(n=void 0===n?a:n+a)}return n}function Tt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ct(e){return e?e.slice(0,Wt(e)+1).replace(G,""):e}function Nt(e){return function(t){return e(t)}}function xt(e,t){return ut(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function It(e,t){for(var n=-1,r=e.length;++n<r&&ht(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&&ht(t,e[n],0)>-1;);return n}function kt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Ot=Dt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=Dt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Pt(e){return"\\"+Fe[e]}function Mt(e){return ke.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function jt(e,t){for(var n=-1,o=e.length,a=0,i=[];++n<o;){var l=e[n];l!==t&&l!==r||(e[n]=r,i[a++]=n)}return i}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return Mt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):mt(e)}function qt(e){return Mt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Wt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Vt=Dt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var T,K=(t=null==t?qe:Gt.defaults(qe.Object(),t,Gt.pick(qe,Re))).Array,ce=t.Date,de=t.Error,pe=t.Function,fe=t.Math,me=t.Object,ve=t.RegExp,ge=t.String,he=t.TypeError,ye=K.prototype,Ee=me.prototype,Se=t["__core-js_shared__"],be=pe.prototype.toString,De=Ee.hasOwnProperty,Ae=0,_e=(T=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",Te=Ee.toString,Ce=be.call(me),Ne=qe._,Ie=ve("^"+be.call(De).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=Ge?t.Buffer:void 0,Fe=t.Symbol,Ue=t.Uint8Array,ze=ke?ke.allocUnsafe:void 0,We=Ft(me.getPrototypeOf,me),Ve=me.create,Ke=Ee.propertyIsEnumerable,$e=ye.splice,mt=Fe?Fe.isConcatSpreadable:void 0,Dt=Fe?Fe.iterator:void 0,Kt=Fe?Fe.toStringTag:void 0,$t=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==qe.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==qe.Date.now&&ce.now,Zt=t.setTimeout!==qe.setTimeout&&t.setTimeout,Jt=fe.ceil,Qt=fe.floor,en=me.getOwnPropertySymbols,tn=ke?ke.isBuffer:void 0,nn=t.isFinite,rn=ye.join,on=Ft(me.keys,me),an=fe.max,ln=fe.min,sn=ce.now,un=t.parseInt,cn=fe.random,dn=ye.reverse,pn=Qo(t,"DataView"),fn=Qo(t,"Map"),mn=Qo(t,"Promise"),vn=Qo(t,"Set"),gn=Qo(t,"WeakMap"),hn=Qo(me,"create"),yn=gn&&new gn,En={},Sn=xa(pn),bn=xa(fn),Dn=xa(mn),An=xa(vn),_n=xa(gn),Tn=Fe?Fe.prototype:void 0,Cn=Tn?Tn.valueOf:void 0,Nn=Tn?Tn.toString:void 0;function xn(e){if(Vi(e)&&!Ri(e)&&!(e instanceof kn)){if(e instanceof Ln)return e;if(De.call(e,"__wrapped__"))return wa(e)}return new Ln(e)}var wn=function(){function e(){}return function(t){if(!Wi(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function Ln(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function kn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Rn(e);this.size=t.size}function Fn(e,t){var n=Ri(e),r=!n&&Oi(e),o=!n&&!r&&Fi(e),a=!n&&!r&&!o&&Qi(e),i=n||r||o||a,l=i?Tt(e.length,ge):[],s=l.length;for(var u in e)!t&&!De.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ia(u,s))||l.push(u);return l}function jn(e){var t=e.length;return t?e[Pr(0,t-1)]:void 0}function Hn(e,t){return Aa(ho(e),Yn(t,0,e.length))}function Un(e){return Aa(ho(e))}function zn(e,t,n){(void 0!==n&&!Ii(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function qn(e,t,n){var r=e[t];De.call(e,t)&&Ii(r,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(Ii(e[n][0],t))return n;return-1}function Vn(e,t,n,r){return er(e,function(e,o,a){t(r,e,n(e),a)}),r}function Gn(e,t){return e&&yo(t,bl(t),e)}function Kn(e,t,n){"__proto__"==t&&$t?$t(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function $n(e,t){for(var n=-1,r=t.length,o=K(r),a=null==e;++n<r;)o[n]=a?void 0:gl(e,t[n]);return o}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,r,o,i){var u,E=1&t,T=2&t,L=4&t;if(n&&(u=o?n(e,r,o,i):n(e)),void 0!==u)return u;if(!Wi(e))return e;var k=Ri(e);if(k){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!E)return ho(e,u)}else{var O=na(e),R=O==c||O==d;if(Fi(e))return co(e,E);if(O==m||O==a||R&&!o){if(u=T||R?{}:oa(e),!E)return T?function(e,t){return yo(e,ta(e),t)}(e,function(e,t){return e&&yo(t,Dl(t),e)}(u,e)):function(e,t){return yo(e,ea(e),t)}(e,Gn(u,e))}else{if(!Be[O])return o?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case S:return po(e);case l:case s:return new r(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case A:case _:case C:case N:case x:case"[object Uint8ClampedArray]":case w:case I:return fo(e,n);case p:return new r;case f:case h:return new r(e);case v:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new r;case y:return Cn?me(Cn.call(e)):{}}}(e,O,E)}}i||(i=new Bn);var P=i.get(e);if(P)return P;i.set(e,u),Xi(e)?e.forEach(function(r){u.add(Xn(r,t,n,r,e,i))}):Gi(e)&&e.forEach(function(r,o){u.set(o,Xn(r,t,n,o,e,i))});var M=k?void 0:(L?T?Go:Vo:T?Dl:bl)(e);return rt(M||e,function(r,o){M&&(r=e[o=r]),qn(u,o,Xn(r,t,n,o,e,i))}),u}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var o=n[r],a=e[o];if(void 0===a&&!(o in e)||!(0,t[o])(a))return!1}return!0}function Jn(e,t,r){if("function"!=typeof e)throw new he(n);return Ea(function(){e.apply(void 0,r)},t)}function Qn(e,t,n,r){var o=-1,a=lt,i=!0,l=e.length,s=[],u=t.length;if(!l)return s;n&&(t=ut(t,Nt(n))),r?(a=st,i=!1):t.length>=200&&(a=wt,i=!1,t=new Mn(t));e:for(;++o<l;){var c=e[o],d=null==n?c:n(c);if(c=r||0!==c?c:0,i&&d==d){for(var p=u;p--;)if(t[p]===d)continue e;s.push(c)}else a(t,d,r)||s.push(c)}return s}xn.templateSettings={escape:F,evaluate:j,interpolate:H,variable:"",imports:{_:xn}},(xn.prototype=In.prototype).constructor=xn,(Ln.prototype=wn(In.prototype)).constructor=Ln,(kn.prototype=wn(In.prototype)).constructor=kn,On.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return De.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:De.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0||(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return Wn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(fn||Rn),string:new On}},Pn.prototype.delete=function(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Zo(this,e).get(e)},Pn.prototype.has=function(e){return Zo(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=bo(sr),tr=bo(ur,!0);function nr(e,t){var n=!0;return er(e,function(e,r,o){return n=!!t(e,r,o)}),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],i=t(a);if(null!=i&&(void 0===l?i==i&&!Ji(i):n(i,l)))var l=i,s=a}return s}function or(e,t){var n=[];return er(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function ar(e,t,n,r,o){var a=-1,i=e.length;for(n||(n=aa),o||(o=[]);++a<i;){var l=e[a];t>0&&n(l)?t>1?ar(l,t-1,n,r,o):ct(o,l):r||(o[o.length]=l)}return o}var ir=Do(),lr=Do(!0);function sr(e,t){return e&&ir(e,t,bl)}function ur(e,t){return e&&lr(e,t,bl)}function cr(e,t){return it(t,function(t){return Ui(e[t])})}function dr(e,t){for(var n=0,r=(t=io(t,e)).length;null!=e&&n<r;)e=e[Na(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ri(e)?r:ct(r,n(e))}function fr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=De.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var r=!0}catch(e){}var o=Te.call(e);return r&&(t?e[Kt]=n:delete e[Kt]),o}(e):function(e){return Te.call(e)}(e)}function mr(e,t){return e>t}function vr(e,t){return null!=e&&De.call(e,t)}function gr(e,t){return null!=e&&t in me(e)}function hr(e,t,n){for(var r=n?st:lt,o=e[0].length,a=e.length,i=a,l=K(a),s=Infinity,u=[];i--;){var c=e[i];i&&t&&(c=ut(c,Nt(t))),s=ln(c.length,s),l[i]=!n&&(t||o>=120&&c.length>=120)?new Mn(i&&c):void 0}c=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<s;){var f=c[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?wt(p,m):r(u,m,n))){for(i=a;--i;){var v=l[i];if(!(v?wt(v,m):r(e[i],m,n)))continue e}p&&p.push(m),u.push(f)}}return u}function yr(e,t,n){var r=null==(e=va(e,t=io(t,e)))?e:e[Na(Ha(t))];return null==r?void 0:tt(r,e,n)}function Er(e){return Vi(e)&&fr(e)==a}function Sr(e,t,n,r,o){return e===t||(null==e||null==t||!Vi(e)&&!Vi(t)?e!=e&&t!=t:function(e,t,n,r,o,c){var d=Ri(e),E=Ri(t),D=d?i:na(e),A=E?i:na(t),_=(D=D==a?m:D)==m,T=(A=A==a?m:A)==m,C=D==A;if(C&&Fi(e)){if(!Fi(t))return!1;d=!0,_=!1}if(C&&!_)return c||(c=new Bn),d||Qi(e)?qo(e,t,n,r,o,c):function(e,t,n,r,o,a,i){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!a(new Ue(e),new Ue(t)));case l:case s:case f:return Ii(+e,+t);case u:return e.name==t.name&&e.message==t.message;case v:case h:return e==t+"";case p:var c=Bt;case g:if(c||(c=Ht),e.size!=t.size&&!(1&r))return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var m=qo(c(e),c(t),r,o,a,i);return i.delete(e),m;case y:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,D,n,r,o,c);if(!(1&n)){var N=_&&De.call(e,"__wrapped__"),x=T&&De.call(t,"__wrapped__");if(N||x){var w=N?e.value():e,I=x?t.value():t;return c||(c=new Bn),o(w,I,n,r,c)}}return!!C&&(c||(c=new Bn),function(e,t,n,r,o,a){var i=1&n,l=Vo(e),s=l.length;if(s!=Vo(t).length&&!i)return!1;for(var u=s;u--;){var c=l[u];if(!(i?c in t:De.call(t,c)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var f=!0;a.set(e,t),a.set(t,e);for(var m=i;++u<s;){var v=e[c=l[u]],g=t[c];if(r)var h=i?r(g,v,c,t,e,a):r(v,g,c,e,t,a);if(!(void 0===h?v===g||o(v,g,n,r,a):h)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var y=e.constructor,E=t.constructor;y==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof E&&E instanceof E||(f=!1)}return a.delete(e),a.delete(t),f}(e,t,n,r,o,c))}(e,t,n,r,Sr,o))}function br(e,t,n,r){var o=n.length,a=o,i=!r;if(null==e)return!a;for(e=me(e);o--;){var l=n[o];if(i&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var s=(l=n[o])[0],u=e[s],c=l[1];if(i&&l[2]){if(void 0===u&&!(s in e))return!1}else{var d=new Bn;if(r)var p=r(u,c,s,e,t,d);if(!(void 0===p?Sr(c,u,3,r,d):p))return!1}}return!0}function Dr(e){return!(!Wi(e)||(t=e,_e&&_e in t))&&(Ui(e)?Ie:oe).test(xa(e));var t}function Ar(e){return"function"==typeof e?e:null==e?Kl:"object"==typeof e?Ri(e)?xr(e[0],e[1]):Nr(e):ns(e)}function _r(e){if(!da(e))return on(e);var t=[];for(var n in me(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Tr(e,t){return e<t}function Cr(e,t){var n=-1,r=Mi(e)?K(e.length):[];return er(e,function(e,o,a){r[++n]=t(e,o,a)}),r}function Nr(e){var t=Jo(e);return 1==t.length&&t[0][2]?fa(t[0][0],t[0][1]):function(n){return n===e||br(n,e,t)}}function xr(e,t){return sa(e)&&pa(t)?fa(Na(e),t):function(n){var r=gl(n,e);return void 0===r&&r===t?hl(n,e):Sr(t,r,3)}}function wr(e,t,n,r,o){e!==t&&ir(t,function(a,i){if(o||(o=new Bn),Wi(a))!function(e,t,n,r,o,a,i){var l=ha(e,n),s=ha(t,n),u=i.get(s);if(u)zn(e,n,u);else{var c=a?a(l,s,n+"",e,t,i):void 0,d=void 0===c;if(d){var p=Ri(s),f=!p&&Fi(s),m=!p&&!f&&Qi(s);c=s,p||f||m?Ri(l)?c=l:Bi(l)?c=ho(l):f?(d=!1,c=co(s,!0)):m?(d=!1,c=fo(s,!0)):c=[]:$i(s)||Oi(s)?(c=l,Oi(l)?c=ll(l):Wi(l)&&!Ui(l)||(c=oa(s))):d=!1}d&&(i.set(s,c),o(c,s,r,a,i),i.delete(s)),zn(e,n,c)}}(e,t,i,n,wr,r,o);else{var l=r?r(ha(e,i),a,i+"",e,t,o):void 0;void 0===l&&(l=a),zn(e,i,l)}},Dl)}function Ir(e,t){var n=e.length;if(n)return ia(t+=t<0?n:0,n)?e[t]:void 0}function Lr(e,t,n){t=t.length?ut(t,function(e){return Ri(e)?function(t){return dr(t,1===e.length?e[0]:e)}:e}):[Kl];var r=-1;return t=ut(t,Nt(Xo())),function(e,t){var r=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,a=t.criteria,i=o.length,l=n.length;++r<i;){var s=mo(o[r],a[r]);if(s)return r>=l?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Cr(e,function(e,n,o){return{criteria:ut(t,function(t){return t(e)}),index:++r,value:e}}))}function kr(e,t,n){for(var r=-1,o=t.length,a={};++r<o;){var i=t[r],l=dr(e,i);n(l,i)&&Hr(a,io(i,e),l)}return a}function Or(e,t,n,r){var o=r?yt:ht,a=-1,i=t.length,l=e;for(e===t&&(t=ho(t)),n&&(l=ut(e,Nt(n)));++a<i;)for(var s=0,u=t[a],c=n?n(u):u;(s=o(l,c,s,r))>-1;)l!==e&&$e.call(l,s,1),$e.call(e,s,1);return e}function Rr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==a){var a=o;ia(o)?$e.call(e,o,1):Jr(e,o)}}return e}function Pr(e,t){return e+Qt(cn()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return Sa(ma(e,t,Kl),e+"")}function Fr(e){return jn(Il(e))}function jr(e,t){var n=Il(e);return Aa(n,Yn(t,0,n.length))}function Hr(e,t,n,r){if(!Wi(e))return e;for(var o=-1,a=(t=io(t,e)).length,i=a-1,l=e;null!=l&&++o<a;){var s=Na(t[o]),u=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=i){var c=l[s];void 0===(u=r?r(c,s,l):void 0)&&(u=Wi(c)?c:ia(t[o+1])?[]:{})}qn(l,s,u),l=l[s]}return e}var Ur=yn?function(e,t){return yn.set(e,t),e}:Kl,zr=$t?function(e,t){return $t(e,"toString",{configurable:!0,enumerable:!1,value:Wl(t),writable:!0})}:Kl;function qr(e){return Aa(Il(e))}function Wr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=K(o);++r<o;)a[r]=e[r+t];return a}function Vr(e,t){var n;return er(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var a=r+o>>>1,i=e[a];null!==i&&!Ji(i)&&(n?i<=t:i<t)?r=a+1:o=a}return o}return Kr(e,t,Kl,n)}function Kr(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var i=(t=n(t))!=t,l=null===t,s=Ji(t),u=void 0===t;o<a;){var c=Qt((o+a)/2),d=n(e[c]),p=void 0!==d,f=null===d,m=d==d,v=Ji(d);if(i)var g=r||m;else g=u?m&&(r||p):l?m&&p&&(r||!f):s?m&&p&&!f&&(r||!v):!f&&!v&&(r?d<=t:d<t);g?o=c+1:a=c}return ln(a,4294967294)}function $r(e,t){for(var n=-1,r=e.length,o=0,a=[];++n<r;){var i=e[n],l=t?t(i):i;if(!n||!Ii(l,s)){var s=l;a[o++]=0===i?0:i}}return a}function Yr(e){return"number"==typeof e?e:Ji(e)?NaN:+e}function Xr(e){if("string"==typeof e)return e;if(Ri(e))return ut(e,Xr)+"";if(Ji(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zr(e,t,n){var r=-1,o=lt,a=e.length,i=!0,l=[],s=l;if(n)i=!1,o=st;else if(a>=200){var u=t?null:Bo(e);if(u)return Ht(u);i=!1,o=wt,s=new Mn}else s=t?[]:l;e:for(;++r<a;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,i&&d==d){for(var p=s.length;p--;)if(s[p]===d)continue e;t&&s.push(d),l.push(c)}else o(s,d,n)||(s!==l&&s.push(d),l.push(c))}return l}function Jr(e,t){return null==(e=va(e,t=io(t,e)))||delete e[Na(Ha(t))]}function Qr(e,t,n,r){return Hr(e,t,n(dr(e,t)),r)}function eo(e,t,n,r){for(var o=e.length,a=r?o:-1;(r?a--:++a<o)&&t(e[a],a,e););return n?Wr(e,r?0:a,r?a+1:o):Wr(e,r?a+1:0,r?o:a)}function to(e,t){var n=e;return n instanceof kn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function no(e,t,n){var r=e.length;if(r<2)return r?Zr(e[0]):[];for(var o=-1,a=K(r);++o<r;)for(var i=e[o],l=-1;++l<r;)l!=o&&(a[o]=Qn(a[o]||i,e[l],t,n));return Zr(ar(a,1),t,n)}function ro(e,t,n){for(var r=-1,o=e.length,a=t.length,i={};++r<o;)n(i,e[r],r<a?t[r]:void 0);return i}function oo(e){return Bi(e)?e:[]}function ao(e){return"function"==typeof e?e:Kl}function io(e,t){return Ri(e)?e:sa(e,t)?[e]:Ca(sl(e))}var lo=Br;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Wr(e,t,n)}var uo=Yt||function(e){return qe.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function fo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,a=Ji(e),i=void 0!==t,l=null===t,s=t==t,u=Ji(t);if(!l&&!u&&!a&&e>t||a&&i&&s&&!l&&!u||r&&i&&s||!n&&s||!o)return 1;if(!r&&!a&&!u&&e<t||u&&n&&o&&!r&&!a||l&&n&&o||!i&&o||!s)return-1}return 0}function vo(e,t,n,r){for(var o=-1,a=e.length,i=n.length,l=-1,s=t.length,u=an(a-i,0),c=K(s+u),d=!r;++l<s;)c[l]=t[l];for(;++o<i;)(d||o<a)&&(c[n[o]]=e[o]);for(;u--;)c[l++]=e[o++];return c}function go(e,t,n,r){for(var o=-1,a=e.length,i=-1,l=n.length,s=-1,u=t.length,c=an(a-l,0),d=K(c+u),p=!r;++o<c;)d[o]=e[o];for(var f=o;++s<u;)d[f+s]=t[s];for(;++i<l;)(p||o<a)&&(d[f+n[i]]=e[o++]);return d}function ho(e,t){var n=-1,r=e.length;for(t||(t=K(r));++n<r;)t[n]=e[n];return t}function yo(e,t,n,r){var o=!n;n||(n={});for(var a=-1,i=t.length;++a<i;){var l=t[a],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),o?Kn(n,l,s):qn(n,l,s)}return n}function Eo(e,t){return function(n,r){var o=Ri(n)?nt:Vn,a=t?t():{};return o(n,e,Xo(r,2),a)}}function So(e){return Br(function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,i=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&la(n[0],n[1],i)&&(a=o<3?void 0:a,o=1),t=me(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t})}function bo(e,t){return function(n,r){if(null==n)return n;if(!Mi(n))return e(n,r);for(var o=n.length,a=t?o:-1,i=me(n);(t?a--:++a<o)&&!1!==r(i[a],a,i););return n}}function Do(e){return function(t,n,r){for(var o=-1,a=me(t),i=r(t),l=i.length;l--;){var s=i[e?l:++o];if(!1===n(a[s],s,a))break}return t}}function Ao(e){return function(t){var n=Mt(t=sl(t))?qt(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function _o(e){return function(t){return dt(Ul(Ol(t).replace(xe,"")),e,"")}}function To(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=wn(e.prototype),r=e.apply(n,t);return Wi(r)?r:n}}function Co(e){return function(t,n,r){var o=me(t);if(!Mi(t)){var a=Xo(n,3);t=bl(t),n=function(e){return a(o[e],e,o)}}var i=e(t,n,r);return i>-1?o[a?t[i]:i]:void 0}}function No(e){return Wo(function(t){var r=t.length,o=r,a=Ln.prototype.thru;for(e&&t.reverse();o--;){var i=t[o];if("function"!=typeof i)throw new he(n);if(a&&!l&&"wrapper"==$o(i))var l=new Ln([],!0)}for(o=l?o:r;++o<r;){var s=$o(i=t[o]),u="wrapper"==s?Ko(i):void 0;l=u&&ua(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[$o(u[0])].apply(l,u[3]):1==i.length&&ua(i)?l[s]():l.thru(i)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ri(n))return l.plant(n).value();for(var o=0,a=r?t[o].apply(this,e):n;++o<r;)a=t[o].call(this,a);return a}})}function xo(e,t,n,r,o,a,i,l,s,u){var c=128&t,d=1&t,p=2&t,f=24&t,m=512&t,v=p?void 0:To(e);return function g(){for(var h=arguments.length,y=K(h),E=h;E--;)y[E]=arguments[E];if(f)var S=Yo(g),b=kt(y,S);if(r&&(y=vo(y,r,o,f)),a&&(y=go(y,a,i,f)),h-=b,f&&h<u){var D=jt(y,S);return Po(e,t,xo,g.placeholder,n,y,D,l,s,u-h)}var A=d?n:this,_=p?A[e]:e;return h=y.length,l?y=ga(y,l):m&&h>1&&y.reverse(),c&&s<h&&(y.length=s),this&&this!==qe&&this instanceof g&&(_=v||To(_)),_.apply(A,y)}}function wo(e,t){return function(n,r){return function(e,t,n,r){return sr(e,function(e,o,a){t(r,n(e),o,a)}),r}(n,e,t(r),{})}}function Io(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Xr(n),r=Xr(r)):(n=Yr(n),r=Yr(r)),o=e(n,r)}return o}}function Lo(e){return Wo(function(t){return t=ut(t,Nt(Xo())),Br(function(n){var r=this;return e(t,function(e){return tt(e,r,n)})})})}function ko(e,t){var n=(t=void 0===t?" ":Xr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Jt(e/zt(t)));return Mt(t)?so(qt(r),0,e).join(""):r.slice(0,e)}function Oo(e){return function(t,n,r){return r&&"number"!=typeof r&&la(t,n,r)&&(n=r=void 0),t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n,r){for(var o=-1,a=an(Jt((t-e)/(n||1)),0),i=K(a);a--;)i[r?a:++o]=e,e+=n;return i}(t,n,r=void 0===r?t<n?1:-1:rl(r),e)}}function Ro(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=il(t),n=il(n)),e(t,n)}}function Po(e,t,n,r,o,a,i,l,s,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?a:void 0,c?i:void 0,c?void 0:a,c?void 0:i,l,s,u],p=n.apply(void 0,d);return ua(e)&&ya(p,d),p.placeholder=r,ba(p,e,t)}function Mo(e){var t=fe[e];return function(e,n){if(e=il(e),(n=null==n?0:ln(ol(n),292))&&nn(e)){var r=(sl(e)+"e").split("e");return+((r=(sl(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Bo=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Jl;function Fo(e){return function(t){var n=na(t);return n==p?Bt(t):n==g?Ut(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function jo(e,t,o,a,i,l,s,u){var c=2&t;if(!c&&"function"!=typeof e)throw new he(n);var d=a?a.length:0;if(d||(t&=-97,a=i=void 0),s=void 0===s?s:an(ol(s),0),u=void 0===u?u:ol(u),d-=i?i.length:0,64&t){var p=a,f=i;a=i=void 0}var m=c?void 0:Ko(e),v=[e,t,o,a,i,p,f,l,s,u];if(m&&function(e,t){var n=e[1],o=t[1],a=n|o;if(!(a<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],a|=1&n?0:4);var i=t[3];if(i){var l=e[3];e[3]=l?vo(l,i,t[4]):i,e[4]=l?jt(e[3],r):t[4]}(i=t[5])&&(e[5]=(l=e[5])?go(l,i,t[6]):i,e[6]=l?jt(e[5],r):t[6]),(i=t[7])&&(e[7]=i),128&o&&(e[8]=null==e[8]?t[8]:ln(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=a}(v,m),e=v[0],t=v[1],o=v[2],a=v[3],i=v[4],!(u=v[9]=void 0===v[9]?c?0:e.length:an(v[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var r=To(e);return function o(){for(var a=arguments.length,i=K(a),l=a,s=Yo(o);l--;)i[l]=arguments[l];var u=a<3&&i[0]!==s&&i[a-1]!==s?[]:jt(i,s);if((a-=u.length)<n)return Po(e,t,xo,o.placeholder,void 0,i,u,void 0,void 0,n-a);var c=this&&this!==qe&&this instanceof o?r:e;return tt(c,this,i)}}(e,t,u):32!=t&&33!=t||i.length?xo.apply(void 0,v):function(e,t,n,r){var o=1&t,a=To(e);return function t(){for(var i=-1,l=arguments.length,s=-1,u=r.length,c=K(u+l),d=this&&this!==qe&&this instanceof t?a:e;++s<u;)c[s]=r[s];for(;l--;)c[s++]=arguments[++i];return tt(d,o?n:this,c)}}(e,t,o,a);else var g=function(e,t,n){var r=1&t,o=To(e);return function t(){var a=this&&this!==qe&&this instanceof t?o:e;return a.apply(r?n:this,arguments)}}(e,t,o);return ba((m?Ur:ya)(g,v),e,t)}function Ho(e,t,n,r){return void 0===e||Ii(e,Ee[n])&&!De.call(r,n)?t:e}function Uo(e,t,n,r,o,a){return Wi(e)&&Wi(t)&&(a.set(t,e),wr(e,t,void 0,Uo,a),a.delete(t)),e}function zo(e){return $i(e)?void 0:e}function qo(e,t,n,r,o,a){var i=1&n,l=e.length,s=t.length;if(l!=s&&!(i&&s>l))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new Mn:void 0;for(a.set(e,t),a.set(t,e);++d<l;){var m=e[d],v=t[d];if(r)var g=i?r(v,m,d,t,e,a):r(m,v,d,e,t,a);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!ft(t,function(e,t){if(!wt(f,t)&&(m===e||o(m,e,n,r,a)))return f.push(t)})){p=!1;break}}else if(m!==v&&!o(m,v,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function Wo(e){return Sa(ma(e,void 0,Pa),e+"")}function Vo(e){return pr(e,bl,ea)}function Go(e){return pr(e,Dl,ta)}var Ko=yn?function(e){return yn.get(e)}:Jl;function $o(e){for(var t=e.name+"",n=En[t],r=De.call(En,t)?n.length:0;r--;){var o=n[r],a=o.func;if(null==a||a==e)return o.name}return t}function Yo(e){return(De.call(xn,"placeholder")?xn:e).placeholder}function Xo(){var e=xn.iteratee||$l;return e=e===$l?Ar:e,arguments.length?e(arguments[0],arguments[1]):e}function Zo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=bl(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,pa(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Dr(n)?n:void 0}var ea=en?function(e){return null==e?[]:(e=me(e),it(en(e),function(t){return Ke.call(e,t)}))}:as,ta=en?function(e){for(var t=[];e;)ct(t,ea(e)),e=We(e);return t}:as,na=fr;function ra(e,t,n){for(var r=-1,o=(t=io(t,e)).length,a=!1;++r<o;){var i=Na(t[r]);if(!(a=null!=e&&n(e,i)))break;e=e[i]}return a||++r!=o?a:!!(o=null==e?0:e.length)&&qi(o)&&ia(i,o)&&(Ri(e)||Oi(e))}function oa(e){return"function"!=typeof e.constructor||da(e)?{}:wn(We(e))}function aa(e){return Ri(e)||Oi(e)||!!(mt&&e&&e[mt])}function ia(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ie.test(e))&&e>-1&&e%1==0&&e<t}function la(e,t,n){if(!Wi(n))return!1;var r=typeof t;return!!("number"==r?Mi(n)&&ia(t,n.length):"string"==r&&t in n)&&Ii(n[t],e)}function sa(e,t){if(Ri(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ji(e))||z.test(e)||!U.test(e)||null!=t&&e in me(t)}function ua(e){var t=$o(e),n=xn[t];if("function"!=typeof n||!(t in kn.prototype))return!1;if(e===n)return!0;var r=Ko(n);return!!r&&e===r[0]}(pn&&na(new pn(new ArrayBuffer(1)))!=b||fn&&na(new fn)!=p||mn&&"[object Promise]"!=na(mn.resolve())||vn&&na(new vn)!=g||gn&&na(new gn)!=E)&&(na=function(e){var t=fr(e),n=t==m?e.constructor:void 0,r=n?xa(n):"";if(r)switch(r){case Sn:return b;case bn:return p;case Dn:return"[object Promise]";case An:return g;case _n:return E}return t});var ca=Se?Ui:is;function da(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function pa(e){return e==e&&!Wi(e)}function fa(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function ma(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=an(r.length-t,0),i=K(a);++o<a;)i[o]=r[t+o];o=-1;for(var l=K(t+1);++o<t;)l[o]=r[o];return l[t]=n(i),tt(e,this,l)}}function va(e,t){return t.length<2?e:dr(e,Wr(t,0,-1))}function ga(e,t){for(var n=e.length,r=ln(t.length,n),o=ho(e);r--;){var a=t[r];e[r]=ia(a,n)?o[a]:void 0}return e}function ha(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ya=Da(Ur),Ea=Zt||function(e,t){return qe.setTimeout(e,t)},Sa=Da(zr);function ba(e,t,n){var r=t+"";return Sa(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace($,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return rt(o,function(n){var r="_."+n[0];t&n[1]&&!lt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(X):[]}(r),n)))}function Da(e){var t=0,n=0;return function(){var r=sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Aa(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var a=Pr(n,o),i=e[a];e[a]=e[n],e[n]=i}return e.length=t,e}var _a,Ta,Ca=(_a=_i(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(q,function(e,n,r,o){t.push(r?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ta.size&&Ta.clear(),e}),Ta=_a.cache,_a);function Na(e){if("string"==typeof e||Ji(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function xa(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wa(e){if(e instanceof kn)return e.clone();var t=new Ln(e.__wrapped__,e.__chain__);return t.__actions__=ho(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ia=Br(function(e,t){return Bi(e)?Qn(e,ar(t,1,Bi,!0)):[]}),La=Br(function(e,t){var n=Ha(t);return Bi(n)&&(n=void 0),Bi(e)?Qn(e,ar(t,1,Bi,!0),Xo(n,2)):[]}),ka=Br(function(e,t){var n=Ha(t);return Bi(n)&&(n=void 0),Bi(e)?Qn(e,ar(t,1,Bi,!0),void 0,n):[]});function Oa(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),gt(e,Xo(t,3),o)}function Ra(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ol(n),o=n<0?an(r+o,0):ln(o,r-1)),gt(e,Xo(t,3),o,!0)}function Pa(e){return null!=e&&e.length?ar(e,1):[]}function Ma(e){return e&&e.length?e[0]:void 0}var Ba=Br(function(e){var t=ut(e,oo);return t.length&&t[0]===e[0]?hr(t):[]}),Fa=Br(function(e){var t=Ha(e),n=ut(e,oo);return t===Ha(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hr(n,Xo(t,2)):[]}),ja=Br(function(e){var t=Ha(e),n=ut(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hr(n,void 0,t):[]});function Ha(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ua=Br(za);function za(e,t){return e&&e.length&&t&&t.length?Or(e,t):e}var qa=Wo(function(e,t){var n=null==e?0:e.length,r=$n(e,t);return Rr(e,ut(t,function(e){return ia(e,n)?+e:e}).sort(mo)),r});function Wa(e){return null==e?e:dn.call(e)}var Va=Br(function(e){return Zr(ar(e,1,Bi,!0))}),Ga=Br(function(e){var t=Ha(e);return Bi(t)&&(t=void 0),Zr(ar(e,1,Bi,!0),Xo(t,2))}),Ka=Br(function(e){var t=Ha(e);return t="function"==typeof t?t:void 0,Zr(ar(e,1,Bi,!0),void 0,t)});function $a(e){if(!e||!e.length)return[];var t=0;return e=it(e,function(e){if(Bi(e))return t=an(e.length,t),!0}),Tt(t,function(t){return ut(e,bt(t))})}function Ya(e,t){if(!e||!e.length)return[];var n=$a(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var Xa=Br(function(e,t){return Bi(e)?Qn(e,t):[]}),Za=Br(function(e){return no(it(e,Bi))}),Ja=Br(function(e){var t=Ha(e);return Bi(t)&&(t=void 0),no(it(e,Bi),Xo(t,2))}),Qa=Br(function(e){var t=Ha(e);return t="function"==typeof t?t:void 0,no(it(e,Bi),void 0,t)}),ei=Br($a),ti=Br(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ya(e,n)});function ni(e){var t=xn(e);return t.__chain__=!0,t}function ri(e,t){return t(e)}var oi=Wo(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return $n(t,e)};return!(t>1||this.__actions__.length)&&r instanceof kn&&ia(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new Ln(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ai=Eo(function(e,t,n){De.call(e,n)?++e[n]:Kn(e,n,1)}),ii=Co(Oa),li=Co(Ra);function si(e,t){return(Ri(e)?rt:er)(e,Xo(t,3))}function ui(e,t){return(Ri(e)?ot:tr)(e,Xo(t,3))}var ci=Eo(function(e,t,n){De.call(e,n)?e[n].push(t):Kn(e,n,[t])}),di=Br(function(e,t,n){var r=-1,o="function"==typeof t,a=Mi(e)?K(e.length):[];return er(e,function(e){a[++r]=o?tt(t,e,n):yr(e,t,n)}),a}),pi=Eo(function(e,t,n){Kn(e,n,t)});function fi(e,t){return(Ri(e)?ut:Cr)(e,Xo(t,3))}var mi=Eo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),vi=Br(function(e,t){if(null==e)return[];var n=t.length;return n>1&&la(e,t[0],t[1])?t=[]:n>2&&la(t[0],t[1],t[2])&&(t=[t[0]]),Lr(e,ar(t,1),[])}),gi=Xt||function(){return qe.Date.now()};function hi(e,t,n){return t=n?void 0:t,jo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function yi(e,t){var r;if("function"!=typeof t)throw new he(n);return e=ol(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var Ei=Br(function(e,t,n){var r=1;if(n.length){var o=jt(n,Yo(Ei));r|=32}return jo(e,r,t,n,o)}),Si=Br(function(e,t,n){var r=3;if(n.length){var o=jt(n,Yo(Si));r|=32}return jo(t,r,e,n,o)});function bi(e,t,r){var o,a,i,l,s,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new he(n);function m(t){var n=o,r=a;return o=a=void 0,c=t,l=e.apply(r,n)}function v(e){return c=e,s=Ea(h,t),d?m(e):l}function g(e){var n=e-u;return void 0===u||n>=t||n<0||p&&e-c>=i}function h(){var e=gi();if(g(e))return y(e);s=Ea(h,function(e){var n=t-(e-u);return p?ln(n,i-(e-c)):n}(e))}function y(e){return s=void 0,f&&o?m(e):(o=a=void 0,l)}function E(){var e=gi(),n=g(e);if(o=arguments,a=this,u=e,n){if(void 0===s)return v(u);if(p)return uo(s),s=Ea(h,t),m(u)}return void 0===s&&(s=Ea(h,t)),l}return t=il(t)||0,Wi(r)&&(d=!!r.leading,i=(p="maxWait"in r)?an(il(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),E.cancel=function(){void 0!==s&&uo(s),c=0,o=u=a=s=void 0},E.flush=function(){return void 0===s?l:y(gi())},E}var Di=Br(function(e,t){return Jn(e,1,t)}),Ai=Br(function(e,t,n){return Jn(e,il(t)||0,n)});function _i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(_i.Cache||Pn),r}function Ti(e){if("function"!=typeof e)throw new he(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}_i.Cache=Pn;var Ci=lo(function(e,t){var n=(t=1==t.length&&Ri(t[0])?ut(t[0],Nt(Xo())):ut(ar(t,1),Nt(Xo()))).length;return Br(function(r){for(var o=-1,a=ln(r.length,n);++o<a;)r[o]=t[o].call(this,r[o]);return tt(e,this,r)})}),Ni=Br(function(e,t){return jo(e,32,void 0,t,jt(t,Yo(Ni)))}),xi=Br(function(e,t){return jo(e,64,void 0,t,jt(t,Yo(xi)))}),wi=Wo(function(e,t){return jo(e,256,void 0,void 0,void 0,t)});function Ii(e,t){return e===t||e!=e&&t!=t}var Li=Ro(mr),ki=Ro(function(e,t){return e>=t}),Oi=Er(function(){return arguments}())?Er:function(e){return Vi(e)&&De.call(e,"callee")&&!Ke.call(e,"callee")},Ri=K.isArray,Pi=Ye?Nt(Ye):function(e){return Vi(e)&&fr(e)==S};function Mi(e){return null!=e&&qi(e.length)&&!Ui(e)}function Bi(e){return Vi(e)&&Mi(e)}var Fi=tn||is,ji=Xe?Nt(Xe):function(e){return Vi(e)&&fr(e)==s};function Hi(e){if(!Vi(e))return!1;var t=fr(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!$i(e)}function Ui(e){if(!Wi(e))return!1;var t=fr(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function zi(e){return"number"==typeof e&&e==ol(e)}function qi(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Wi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vi(e){return null!=e&&"object"==typeof e}var Gi=Ze?Nt(Ze):function(e){return Vi(e)&&na(e)==p};function Ki(e){return"number"==typeof e||Vi(e)&&fr(e)==f}function $i(e){if(!Vi(e)||fr(e)!=m)return!1;var t=We(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Ce}var Yi=Je?Nt(Je):function(e){return Vi(e)&&fr(e)==v},Xi=Qe?Nt(Qe):function(e){return Vi(e)&&na(e)==g};function Zi(e){return"string"==typeof e||!Ri(e)&&Vi(e)&&fr(e)==h}function Ji(e){return"symbol"==typeof e||Vi(e)&&fr(e)==y}var Qi=et?Nt(et):function(e){return Vi(e)&&qi(e.length)&&!!Me[fr(e)]},el=Ro(Tr),tl=Ro(function(e,t){return e<=t});function nl(e){if(!e)return[];if(Mi(e))return Zi(e)?qt(e):ho(e);if(Dt&&e[Dt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Dt]());var t=na(e);return(t==p?Bt:t==g?Ht:Il)(e)}function rl(e){return e?(e=il(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ol(e){var t=rl(e),n=t%1;return t==t?n?t-n:t:0}function al(e){return e?Yn(ol(e),0,4294967295):0}function il(e){if("number"==typeof e)return e;if(Ji(e))return NaN;if(Wi(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Wi(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ct(e);var n=re.test(e);return n||ae.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ll(e){return yo(e,Dl(e))}function sl(e){return null==e?"":Xr(e)}var ul=So(function(e,t){if(da(t)||Mi(t))yo(t,bl(t),e);else for(var n in t)De.call(t,n)&&qn(e,n,t[n])}),cl=So(function(e,t){yo(t,Dl(t),e)}),dl=So(function(e,t,n,r){yo(t,Dl(t),e,r)}),pl=So(function(e,t,n,r){yo(t,bl(t),e,r)}),fl=Wo($n),ml=Br(function(e,t){e=me(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&la(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],i=Dl(a),l=-1,s=i.length;++l<s;){var u=i[l],c=e[u];(void 0===c||Ii(c,Ee[u])&&!De.call(e,u))&&(e[u]=a[u])}return e}),vl=Br(function(e){return e.push(void 0,Uo),tt(_l,void 0,e)});function gl(e,t,n){var r=null==e?void 0:dr(e,t);return void 0===r?n:r}function hl(e,t){return null!=e&&ra(e,t,gr)}var yl=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Te.call(t)),e[t]=n},Wl(Kl)),El=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Te.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]},Xo),Sl=Br(yr);function bl(e){return Mi(e)?Fn(e):_r(e)}function Dl(e){return Mi(e)?Fn(e,!0):function(e){if(!Wi(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=da(e),n=[];for(var r in e)("constructor"!=r||!t&&De.call(e,r))&&n.push(r);return n}(e)}var Al=So(function(e,t,n){wr(e,t,n)}),_l=So(function(e,t,n,r){wr(e,t,n,r)}),Tl=Wo(function(e,t){var n={};if(null==e)return n;var r=!1;t=ut(t,function(t){return t=io(t,e),r||(r=t.length>1),t}),yo(e,Go(e),n),r&&(n=Xn(n,7,zo));for(var o=t.length;o--;)Jr(n,t[o]);return n}),Cl=Wo(function(e,t){return null==e?{}:function(e,t){return kr(e,t,function(t,n){return hl(e,n)})}(e,t)});function Nl(e,t){if(null==e)return{};var n=ut(Go(e),function(e){return[e]});return t=Xo(t),kr(e,n,function(e,n){return t(e,n[0])})}var xl=Fo(bl),wl=Fo(Dl);function Il(e){return null==e?[]:xt(e,bl(e))}var Ll=_o(function(e,t,n){return t=t.toLowerCase(),e+(n?kl(t):t)});function kl(e){return Hl(sl(e).toLowerCase())}function Ol(e){return(e=sl(e))&&e.replace(le,Ot).replace(we,"")}var Rl=_o(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Pl=_o(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ml=Ao("toLowerCase"),Bl=_o(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fl=_o(function(e,t,n){return e+(n?" ":"")+Hl(t)}),jl=_o(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hl=Ao("toUpperCase");function Ul(e,t,n){return e=sl(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var zl=Br(function(e,t){try{return tt(e,void 0,t)}catch(e){return Hi(e)?e:new de(e)}}),ql=Wo(function(e,t){return rt(t,function(t){t=Na(t),Kn(e,t,Ei(e[t],e))}),e});function Wl(e){return function(){return e}}var Vl=No(),Gl=No(!0);function Kl(e){return e}function $l(e){return Ar("function"==typeof e?e:Xn(e,1))}var Yl=Br(function(e,t){return function(n){return yr(n,e,t)}}),Xl=Br(function(e,t){return function(n){return yr(e,n,t)}});function Zl(e,t,n){var r=bl(t),o=cr(t,r);null!=n||Wi(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=cr(t,bl(t)));var a=!(Wi(n)&&"chain"in n&&!n.chain),i=Ui(e);return rt(o,function(n){var r=t[n];e[n]=r,i&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),o=n.__actions__=ho(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ct([this.value()],arguments))})}),e}function Jl(){}var Ql=Lo(ut),es=Lo(at),ts=Lo(ft);function ns(e){return sa(e)?bt(Na(e)):function(e){return function(t){return dr(t,e)}}(e)}var rs=Oo(),os=Oo(!0);function as(){return[]}function is(){return!1}var ls,ss=Io(function(e,t){return e+t},0),us=Mo("ceil"),cs=Io(function(e,t){return e/t},1),ds=Mo("floor"),ps=Io(function(e,t){return e*t},1),fs=Mo("round"),ms=Io(function(e,t){return e-t},0);return xn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=ol(e),function(){if(--e<1)return t.apply(this,arguments)}},xn.ary=hi,xn.assign=ul,xn.assignIn=cl,xn.assignInWith=dl,xn.assignWith=pl,xn.at=fl,xn.before=yi,xn.bind=Ei,xn.bindAll=ql,xn.bindKey=Si,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ri(e)?e:[e]},xn.chain=ni,xn.chunk=function(e,t,n){t=(n?la(e,t,n):void 0===t)?1:an(ol(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,a=0,i=K(Jt(r/t));o<r;)i[a++]=Wr(e,o,o+=t);return i},xn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var a=e[t];a&&(o[r++]=a)}return o},xn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return ct(Ri(n)?ho(n):[n],ar(t,1))},xn.cond=function(e){var t=null==e?0:e.length,r=Xo();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new he(n);return[r(e[0]),e[1]]}):[],Br(function(n){for(var r=-1;++r<t;){var o=e[r];if(tt(o[0],this,n))return tt(o[1],this,n)}})},xn.conforms=function(e){return function(e){var t=bl(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},xn.constant=Wl,xn.countBy=ai,xn.create=function(e,t){var n=wn(e);return null==t?n:Gn(n,t)},xn.curry=function e(t,n,r){var o=jo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},xn.curryRight=function e(t,n,r){var o=jo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},xn.debounce=bi,xn.defaults=ml,xn.defaultsDeep=vl,xn.defer=Di,xn.delay=Ai,xn.difference=Ia,xn.differenceBy=La,xn.differenceWith=ka,xn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=n||void 0===t?1:ol(t))<0?0:t,r):[]},xn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,0,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t):[]},xn.dropRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0,!0):[]},xn.dropWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0):[]},xn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&la(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ol(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ol(r))<0&&(r+=o),r=n>r?0:al(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},xn.filter=function(e,t){return(Ri(e)?it:or)(e,Xo(t,3))},xn.flatMap=function(e,t){return ar(fi(e,t),1)},xn.flatMapDeep=function(e,t){return ar(fi(e,t),1/0)},xn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ol(n),ar(fi(e,t),n)},xn.flatten=Pa,xn.flattenDeep=function(e){return null!=e&&e.length?ar(e,1/0):[]},xn.flattenDepth=function(e,t){return null!=e&&e.length?ar(e,t=void 0===t?1:ol(t)):[]},xn.flip=function(e){return jo(e,512)},xn.flow=Vl,xn.flowRight=Gl,xn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},xn.functions=function(e){return null==e?[]:cr(e,bl(e))},xn.functionsIn=function(e){return null==e?[]:cr(e,Dl(e))},xn.groupBy=ci,xn.initial=function(e){return null!=e&&e.length?Wr(e,0,-1):[]},xn.intersection=Ba,xn.intersectionBy=Fa,xn.intersectionWith=ja,xn.invert=yl,xn.invertBy=El,xn.invokeMap=di,xn.iteratee=$l,xn.keyBy=pi,xn.keys=bl,xn.keysIn=Dl,xn.map=fi,xn.mapKeys=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,t(e,r,o),e)}),n},xn.mapValues=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,r,t(e,r,o))}),n},xn.matches=function(e){return Nr(Xn(e,1))},xn.matchesProperty=function(e,t){return xr(e,Xn(t,1))},xn.memoize=_i,xn.merge=Al,xn.mergeWith=_l,xn.method=Yl,xn.methodOf=Xl,xn.mixin=Zl,xn.negate=Ti,xn.nthArg=function(e){return e=ol(e),Br(function(t){return Ir(t,e)})},xn.omit=Tl,xn.omitBy=function(e,t){return Nl(e,Ti(Xo(t)))},xn.once=function(e){return yi(2,e)},xn.orderBy=function(e,t,n,r){return null==e?[]:(Ri(t)||(t=null==t?[]:[t]),Ri(n=r?void 0:n)||(n=null==n?[]:[n]),Lr(e,t,n))},xn.over=Ql,xn.overArgs=Ci,xn.overEvery=es,xn.overSome=ts,xn.partial=Ni,xn.partialRight=xi,xn.partition=mi,xn.pick=Cl,xn.pickBy=Nl,xn.property=ns,xn.propertyOf=function(e){return function(t){return null==e?void 0:dr(e,t)}},xn.pull=Ua,xn.pullAll=za,xn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,Xo(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,void 0,n):e},xn.pullAt=qa,xn.range=rs,xn.rangeRight=os,xn.rearg=wi,xn.reject=function(e,t){return(Ri(e)?it:or)(e,Ti(Xo(t,3)))},xn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],a=e.length;for(t=Xo(t,3);++r<a;){var i=e[r];t(i,r,e)&&(n.push(i),o.push(r))}return Rr(e,o),n},xn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Br(e,t=void 0===t?t:ol(t))},xn.reverse=Wa,xn.sampleSize=function(e,t,n){return t=(n?la(e,t,n):void 0===t)?1:ol(t),(Ri(e)?Hn:jr)(e,t)},xn.set=function(e,t,n){return null==e?e:Hr(e,t,n)},xn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Hr(e,t,n,r)},xn.shuffle=function(e){return(Ri(e)?Un:qr)(e)},xn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&la(e,t,n)?(t=0,n=r):(t=null==t?0:ol(t),n=void 0===n?r:ol(n)),Wr(e,t,n)):[]},xn.sortBy=vi,xn.sortedUniq=function(e){return e&&e.length?$r(e):[]},xn.sortedUniqBy=function(e,t){return e&&e.length?$r(e,Xo(t,2)):[]},xn.split=function(e,t,n){return n&&"number"!=typeof n&&la(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=sl(e))&&("string"==typeof t||null!=t&&!Yi(t))&&!(t=Xr(t))&&Mt(e)?so(qt(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:an(ol(t),0),Br(function(n){var r=n[t],o=so(n,0,t);return r&&ct(o,r),tt(e,this,o)})},xn.tail=function(e){var t=null==e?0:e.length;return t?Wr(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?Wr(e,0,(t=n||void 0===t?1:ol(t))<0?0:t):[]},xn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t,r):[]},xn.takeRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.throttle=function(e,t,r){var o=!0,a=!0;if("function"!=typeof e)throw new he(n);return Wi(r)&&(o="leading"in r?!!r.leading:o,a="trailing"in r?!!r.trailing:a),bi(e,t,{leading:o,maxWait:t,trailing:a})},xn.thru=ri,xn.toArray=nl,xn.toPairs=xl,xn.toPairsIn=wl,xn.toPath=function(e){return Ri(e)?ut(e,Na):Ji(e)?[e]:ho(Ca(sl(e)))},xn.toPlainObject=ll,xn.transform=function(e,t,n){var r=Ri(e),o=r||Fi(e)||Qi(e);if(t=Xo(t,4),null==n){var a=e&&e.constructor;n=o?r?new a:[]:Wi(e)&&Ui(a)?wn(We(e)):{}}return(o?rt:sr)(e,function(e,r,o){return t(n,e,r,o)}),n},xn.unary=function(e){return hi(e,1)},xn.union=Va,xn.unionBy=Ga,xn.unionWith=Ka,xn.uniq=function(e){return e&&e.length?Zr(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Zr(e,Xo(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Jr(e,t)},xn.unzip=$a,xn.unzipWith=Ya,xn.update=function(e,t,n){return null==e?e:Qr(e,t,ao(n))},xn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Qr(e,t,ao(n),r)},xn.values=Il,xn.valuesIn=function(e){return null==e?[]:xt(e,Dl(e))},xn.without=Xa,xn.words=Ul,xn.wrap=function(e,t){return Ni(ao(t),e)},xn.xor=Za,xn.xorBy=Ja,xn.xorWith=Qa,xn.zip=ei,xn.zipObject=function(e,t){return ro(e||[],t||[],qn)},xn.zipObjectDeep=function(e,t){return ro(e||[],t||[],Hr)},xn.zipWith=ti,xn.entries=xl,xn.entriesIn=wl,xn.extend=cl,xn.extendWith=dl,Zl(xn,xn),xn.add=ss,xn.attempt=zl,xn.camelCase=Ll,xn.capitalize=kl,xn.ceil=us,xn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=il(n))==n?n:0),void 0!==t&&(t=(t=il(t))==t?t:0),Yn(il(e),t,n)},xn.clone=function(e){return Xn(e,4)},xn.cloneDeep=function(e){return Xn(e,5)},xn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Zn(e,t,bl(t))},xn.deburr=Ol,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=cs,xn.endsWith=function(e,t,n){e=sl(e),t=Xr(t);var r=e.length,o=n=void 0===n?r:Yn(ol(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},xn.eq=Ii,xn.escape=function(e){return(e=sl(e))&&B.test(e)?e.replace(P,Rt):e},xn.escapeRegExp=function(e){return(e=sl(e))&&V.test(e)?e.replace(W,"\\$&"):e},xn.every=function(e,t,n){var r=Ri(e)?at:nr;return n&&la(e,t,n)&&(t=void 0),r(e,Xo(t,3))},xn.find=ii,xn.findIndex=Oa,xn.findKey=function(e,t){return vt(e,Xo(t,3),sr)},xn.findLast=li,xn.findLastIndex=Ra,xn.findLastKey=function(e,t){return vt(e,Xo(t,3),ur)},xn.floor=ds,xn.forEach=si,xn.forEachRight=ui,xn.forIn=function(e,t){return null==e?e:ir(e,Xo(t,3),Dl)},xn.forInRight=function(e,t){return null==e?e:lr(e,Xo(t,3),Dl)},xn.forOwn=function(e,t){return e&&sr(e,Xo(t,3))},xn.forOwnRight=function(e,t){return e&&ur(e,Xo(t,3))},xn.get=gl,xn.gt=Li,xn.gte=ki,xn.has=function(e,t){return null!=e&&ra(e,t,vr)},xn.hasIn=hl,xn.head=Ma,xn.identity=Kl,xn.includes=function(e,t,n,r){e=Mi(e)?e:Il(e),n=n&&!r?ol(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Zi(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&ht(e,t,n)>-1},xn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),ht(e,t,o)},xn.inRange=function(e,t,n){return t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n){return e>=ln(t,n)&&e<an(t,n)}(e=il(e),t,n)},xn.invoke=Sl,xn.isArguments=Oi,xn.isArray=Ri,xn.isArrayBuffer=Pi,xn.isArrayLike=Mi,xn.isArrayLikeObject=Bi,xn.isBoolean=function(e){return!0===e||!1===e||Vi(e)&&fr(e)==l},xn.isBuffer=Fi,xn.isDate=ji,xn.isElement=function(e){return Vi(e)&&1===e.nodeType&&!$i(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Mi(e)&&(Ri(e)||"string"==typeof e||"function"==typeof e.splice||Fi(e)||Qi(e)||Oi(e)))return!e.length;var t=na(e);if(t==p||t==g)return!e.size;if(da(e))return!_r(e).length;for(var n in e)if(De.call(e,n))return!1;return!0},xn.isEqual=function(e,t){return Sr(e,t)},xn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Sr(e,t,void 0,n):!!r},xn.isError=Hi,xn.isFinite=function(e){return"number"==typeof e&&nn(e)},xn.isFunction=Ui,xn.isInteger=zi,xn.isLength=qi,xn.isMap=Gi,xn.isMatch=function(e,t){return e===t||br(e,t,Jo(t))},xn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,br(e,t,Jo(t),n)},xn.isNaN=function(e){return Ki(e)&&e!=+e},xn.isNative=function(e){if(ca(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=Ki,xn.isObject=Wi,xn.isObjectLike=Vi,xn.isPlainObject=$i,xn.isRegExp=Yi,xn.isSafeInteger=function(e){return zi(e)&&e>=-9007199254740991&&e<=9007199254740991},xn.isSet=Xi,xn.isString=Zi,xn.isSymbol=Ji,xn.isTypedArray=Qi,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Vi(e)&&na(e)==E},xn.isWeakSet=function(e){return Vi(e)&&"[object WeakSet]"==fr(e)},xn.join=function(e,t){return null==e?"":rn.call(e,t)},xn.kebabCase=Rl,xn.last=Ha,xn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ol(n))<0?an(r+o,0):ln(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):gt(e,Et,o,!0)},xn.lowerCase=Pl,xn.lowerFirst=Ml,xn.lt=el,xn.lte=tl,xn.max=function(e){return e&&e.length?rr(e,Kl,mr):void 0},xn.maxBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),mr):void 0},xn.mean=function(e){return St(e,Kl)},xn.meanBy=function(e,t){return St(e,Xo(t,2))},xn.min=function(e){return e&&e.length?rr(e,Kl,Tr):void 0},xn.minBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),Tr):void 0},xn.stubArray=as,xn.stubFalse=is,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=ps,xn.nth=function(e,t){return e&&e.length?Ir(e,ol(t)):void 0},xn.noConflict=function(){return qe._===this&&(qe._=Ne),this},xn.noop=Jl,xn.now=gi,xn.pad=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return ko(Qt(o),n)+e+ko(Jt(o),n)},xn.padEnd=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?e+ko(t-r,n):e},xn.padStart=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?ko(t-r,n)+e:e},xn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(sl(e).replace(G,""),t||0)},xn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&la(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rl(e),void 0===t?(t=e,e=0):t=rl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=cn();return ln(e+o*(t-e+je("1e-"+((o+"").length-1))),t)}return Pr(e,t)},xn.reduce=function(e,t,n){var r=Ri(e)?dt:At,o=arguments.length<3;return r(e,Xo(t,4),n,o,er)},xn.reduceRight=function(e,t,n){var r=Ri(e)?pt:At,o=arguments.length<3;return r(e,Xo(t,4),n,o,tr)},xn.repeat=function(e,t,n){return t=(n?la(e,t,n):void 0===t)?1:ol(t),Mr(sl(e),t)},xn.replace=function(){var e=arguments,t=sl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.result=function(e,t,n){var r=-1,o=(t=io(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var a=null==e?void 0:e[Na(t[r])];void 0===a&&(r=o,a=n),e=Ui(a)?a.call(e):a}return e},xn.round=fs,xn.runInContext=e,xn.sample=function(e){return(Ri(e)?jn:Fr)(e)},xn.size=function(e){if(null==e)return 0;if(Mi(e))return Zi(e)?zt(e):e.length;var t=na(e);return t==p||t==g?e.size:_r(e).length},xn.snakeCase=Bl,xn.some=function(e,t,n){var r=Ri(e)?ft:Vr;return n&&la(e,t,n)&&(t=void 0),r(e,Xo(t,3))},xn.sortedIndex=function(e,t){return Gr(e,t)},xn.sortedIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2))},xn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ii(e[r],t))return r}return-1},xn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},xn.sortedLastIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2),!0)},xn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gr(e,t,!0)-1;if(Ii(e[n],t))return n}return-1},xn.startCase=Fl,xn.startsWith=function(e,t,n){return e=sl(e),n=null==n?0:Yn(ol(n),0,e.length),t=Xr(t),e.slice(n,n+t.length)==t},xn.subtract=ms,xn.sum=function(e){return e&&e.length?_t(e,Kl):0},xn.sumBy=function(e,t){return e&&e.length?_t(e,Xo(t,2)):0},xn.template=function(e,t,n){var r=xn.templateSettings;n&&la(e,t,n)&&(t=void 0),e=sl(e),t=dl({},t,r,Ho);var o,a,i=dl({},t.imports,r.imports,Ho),l=bl(i),s=xt(i,l),u=0,c=t.interpolate||se,d="__p += '",p=ve((t.escape||se).source+"|"+c.source+"|"+(c===H?ee:se).source+"|"+(t.evaluate||se).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pe+"]")+"\n";e.replace(p,function(t,n,r,i,l,s){return r||(r=i),d+=e.slice(u,s).replace(ue,Pt),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),l&&(a=!0,d+="';\n"+l+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t}),d+="';\n";var m=De.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(L,""):d).replace(k,"$1").replace(O,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=zl(function(){return pe(l,f+"return "+d).apply(void 0,s)});if(v.source=d,Hi(v))throw v;return v},xn.times=function(e,t){if((e=ol(e))<1||e>9007199254740991)return[];var n=4294967295,r=ln(e,4294967295);e-=4294967295;for(var o=Tt(r,t=Xo(t));++n<e;)t(n);return o},xn.toFinite=rl,xn.toInteger=ol,xn.toLength=al,xn.toLower=function(e){return sl(e).toLowerCase()},xn.toNumber=il,xn.toSafeInteger=function(e){return e?Yn(ol(e),-9007199254740991,9007199254740991):0===e?e:0},xn.toString=sl,xn.toUpper=function(e){return sl(e).toUpperCase()},xn.trim=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return Ct(e);if(!e||!(t=Xr(t)))return e;var r=qt(e),o=qt(t);return so(r,It(r,o),Lt(r,o)+1).join("")},xn.trimEnd=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.slice(0,Wt(e)+1);if(!e||!(t=Xr(t)))return e;var r=qt(e);return so(r,0,Lt(r,qt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xr(t)))return e;var r=qt(e);return so(r,It(r,qt(t))).join("")},xn.truncate=function(e,t){var n=30,r="...";if(Wi(t)){var o="separator"in t?t.separator:o;n="length"in t?ol(t.length):n,r="omission"in t?Xr(t.omission):r}var a=(e=sl(e)).length;if(Mt(e)){var i=qt(e);a=i.length}if(n>=a)return e;var l=n-zt(r);if(l<1)return r;var s=i?so(i,0,l).join(""):e.slice(0,l);if(void 0===o)return s+r;if(i&&(l+=s.length-l),Yi(o)){if(e.slice(l).search(o)){var u,c=s;for(o.global||(o=ve(o.source,sl(te.exec(o))+"g")),o.lastIndex=0;u=o.exec(c);)var d=u.index;s=s.slice(0,void 0===d?l:d)}}else if(e.indexOf(Xr(o),l)!=l){var p=s.lastIndexOf(o);p>-1&&(s=s.slice(0,p))}return s+r},xn.unescape=function(e){return(e=sl(e))&&M.test(e)?e.replace(R,Vt):e},xn.uniqueId=function(e){var t=++Ae;return sl(e)+t},xn.upperCase=jl,xn.upperFirst=Hl,xn.each=si,xn.eachRight=ui,xn.first=Ma,Zl(xn,(ls={},sr(xn,function(e,t){De.call(xn.prototype,t)||(ls[t]=e)}),ls),{chain:!1}),xn.VERSION="4.17.21",rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){xn[e].placeholder=xn}),rt(["drop","take"],function(e,t){kn.prototype[e]=function(n){n=void 0===n?1:an(ol(n),0);var r=this.__filtered__&&!t?new kn(this):this.clone();return r.__filtered__?r.__takeCount__=ln(n,r.__takeCount__):r.__views__.push({size:ln(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},kn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;kn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");kn.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");kn.prototype[e]=function(){return this.__filtered__?new kn(this):this[n](1)}}),kn.prototype.compact=function(){return this.filter(Kl)},kn.prototype.find=function(e){return this.filter(e).head()},kn.prototype.findLast=function(e){return this.reverse().find(e)},kn.prototype.invokeMap=Br(function(e,t){return"function"==typeof e?new kn(this):this.map(function(n){return yr(n,e,t)})}),kn.prototype.reject=function(e){return this.filter(Ti(Xo(e)))},kn.prototype.slice=function(e,t){e=ol(e);var n=this;return n.__filtered__&&(e>0||t<0)?new kn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ol(t))<0?n.dropRight(-t):n.take(t-e)),n)},kn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},kn.prototype.toArray=function(){return this.take(4294967295)},sr(kn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=xn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(xn.prototype[t]=function(){var t=this.__wrapped__,i=r?[1]:arguments,l=t instanceof kn,s=i[0],u=l||Ri(t),c=function(e){var t=o.apply(xn,ct([e],i));return r&&d?t[0]:t};u&&n&&"function"==typeof s&&1!=s.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=l&&!p;if(!a&&u){t=m?t:new kn(this);var v=e.apply(t,i);return v.__actions__.push({func:ri,args:[c],thisArg:void 0}),new Ln(v,d)}return f&&m?e.apply(this,i):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ri(o)?o:[],e)}return this[n](function(n){return t.apply(Ri(n)?n:[],e)})}}),sr(kn.prototype,function(e,t){var n=xn[t];if(n){var r=n.name+"";De.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[xo(void 0,2).name]=[{name:"wrapper",func:void 0}],kn.prototype.clone=function(){var e=new kn(this.__wrapped__);return e.__actions__=ho(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ho(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ho(this.__views__),e},kn.prototype.reverse=function(){if(this.__filtered__){var e=new kn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},kn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ri(e),r=t<0,o=n?e.length:0,a=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var a=n[r],i=a.size;switch(a.type){case"drop":e+=i;break;case"dropRight":t-=i;break;case"take":t=ln(t,e+i);break;case"takeRight":e=an(e,t-i)}}return{start:e,end:t}}(0,o,this.__views__),i=a.start,l=a.end,s=l-i,u=r?l:i-1,c=this.__iteratees__,d=c.length,p=0,f=ln(s,this.__takeCount__);if(!n||!r&&o==s&&f==s)return to(e,this.__actions__);var m=[];e:for(;s--&&p<f;){for(var v=-1,g=e[u+=t];++v<d;){var h=c[v],y=h.type,E=(0,h.iteratee)(g);if(2==y)g=E;else if(!E){if(1==y)continue e;break e}}m[p++]=g}return m},xn.prototype.at=oi,xn.prototype.chain=function(){return ni(this)},xn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},xn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof In;){var r=wa(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof kn){var t=e;return this.__actions__.length&&(t=new kn(this)),(t=t.reverse()).__actions__.push({func:ri,args:[Wa],thisArg:void 0}),new Ln(t,this.__chain__)}return this.thru(Wa)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,Dt&&(xn.prototype[Dt]=function(){return this}),xn}();Ve?((Ve.exports=Gt)._=Gt,We._=Gt):qe._=Gt}).call(T)});const x=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],w=e=>{var a;let{searchParams:i,onFilterChange:s,defaultSearchParams:u,statusMap:p,moduleCode:f}=e,m=d(e,x);const{t:v}=o.useTranslation(),g=l.useQueryClient(),[h,y]=(Digit.ULBService.getCurrentTenantId(),Digit.UserService.getUser(),n.useState(()=>({services:(null==i?void 0:i.services)||["ADV"]})));console.log("_searchParams",h);const E=n.useMemo(()=>[{code:"ASSIGNED_TO_ME",name:v("ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:v("ASSIGNED_TO_ALL")}],[v]),S=E[1],[b,D]=n.useState(S),[A,T]=n.useState((null==i||null===(a=i.filters)||void 0===a?void 0:a.wfFilters)||{assignee:[{code:""}]});v("ADS_NEW_BOOKING_APPLICATION"),console.log("statusMap",p);const C=()=>{y(c({},u,{services:[]})),s(c({},u))};return console.log("hhh"),r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading",style:{alignItems:"center"}},r.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},r.createElement("span",null,r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.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"}))),r.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},v("ES_COMMON_FILTER_BY"),":")),r.createElement("div",{className:"clearAll",onClick:C},v("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&r.createElement("span",{className:"clear-search",onClick:C,style:{border:"1px solid #e0e0e0",padding:"6px"}},r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&r.createElement("span",{onClick:m.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:e=>{D(e),T({uuid:e}),s(c({},h,{uuid:e}))},selectedOption:b,t:v,optionsKey:"name",options:E}),r.createElement("div",null,r.createElement(_,{searchParams:h,businessServices:["ADV"],statusMap:p||g.getQueryData("INBOX_STATUS_MAP_"+f),moduleCode:f,onAssignmentChange:(e,t)=>{console.log("status is 222",t),console.log("e",e),(e=>{let t=e.delete,n=c({},h,e);t&&t.forEach(e=>delete n[e]),delete e.delete,y(c({},n))})(e.target.checked?{applicationStatus:[...h.applicationStatus||[],t]}:{applicationStatus:null==h?void 0:h.applicationStatus.filter(e=>e.state!==t.state)})}})),r.createElement("div",null,r.createElement(t.SubmitBar,{onSubmit:()=>{s(c({},h,{wfFilters:A}))},label:v("ES_COMMON_APPLY")}))))))},I=e=>r.createElement("span",{className:"cell-text"},e),L=e=>r.createElement("span",{className:"sla-cell"},e),k=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];C(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:T,function(e,t){var n=[],r=Object.getPrototypeOf,o=n.slice,a=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},i=n.push,l=n.indexOf,s={},u=s.toString,c=s.hasOwnProperty,d=c.toString,p=d.call(Object),f={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},g=e.document,h={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var r,o,a=(n=n||g).createElement("script");if(a.text=e,t)for(r in h)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,o);n.head.appendChild(a).parentNode.removeChild(a)}function E(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[u.call(e)]||"object":typeof e}var S=function(e,t){return new S.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=E(e);return!m(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:i,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,r,o,a,i=arguments[0]||{},l=1,s=arguments.length,u=!1;for("boolean"==typeof i&&(u=i,i=arguments[l]||{},l++),"object"==typeof i||m(i)||(i={}),l===s&&(i=this,l--);l<s;l++)if(null!=(e=arguments[l]))for(t in e)r=e[t],"__proto__"!==t&&i!==r&&(u&&r&&(S.isPlainObject(r)||(o=Array.isArray(r)))?(n=i[t],a=o&&!Array.isArray(n)?[]:o||S.isPlainObject(n)?n:{},o=!1,i[t]=S.extend(u,a,r)):void 0!==r&&(i[t]=r));return i},S.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=r(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){y(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?S.merge(n,"string"==typeof e?[e]:e):i.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:l.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;r<n;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r=[],o=0,a=e.length,i=!n;o<a;o++)!t(e[o],o)!==i&&r.push(e[o]);return r},map:function(e,t,n){var r,o,i=0,l=[];if(b(e))for(r=e.length;i<r;i++)null!=(o=t(e[i],i,n))&&l.push(o);else for(i in e)null!=(o=t(e[i],i,n))&&l.push(o);return a(l)},guid:1,support:f}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var D=function(e){var t,n,r,o,a,i,l,s,u,c,d,p,f,m,v,g,h,y,E,S="sizzle"+1*new Date,b=e.document,D=0,A=0,_=se(),T=se(),C=se(),N=se(),x=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],L=I.pop,k=I.push,O=I.push,R=I.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\["+B+"*("+F+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+B+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",U=new RegExp(B+"+","g"),z=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),q=new RegExp("^"+B+"*,"+B+"*"),W=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),V=new RegExp(B+"|>"),G=new RegExp(H),K=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){p()},ie=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(I=R.call(b.childNodes),b.childNodes)}catch(e){O={apply:I.length?function(e,t){k.apply(e,R.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,o){var a,l,u,c,d,m,h,y=t&&t.ownerDocument,b=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return r;if(!o&&(p(t),t=t||f,v)){if(11!==b&&(d=Q.exec(e)))if(a=d[1]){if(9===b){if(!(u=t.getElementById(a)))return r;if(u.id===a)return r.push(u),r}else if(y&&(u=y.getElementById(a))&&E(t,u)&&u.id===a)return r.push(u),r}else{if(d[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&!N[e+" "]&&(!g||!g.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(h=e,y=t,1===b&&(V.test(e)||W.test(e))){for((y=ee.test(e)&&he(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,oe):t.setAttribute("id",c=S)),l=(m=i(e)).length;l--;)m[l]=(c?"#"+c:":scope")+" "+Ee(m[l]);h=m.join(",")}try{return O.apply(r,y.querySelectorAll(h)),r}catch(t){N(e,!0)}finally{c===S&&t.removeAttribute("id")}}}return s(e.replace(z,"$1"),t,r,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function ue(e){return e[S]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ve(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue(function(t){return t=+t,ue(function(n,r){for(var o,a=e([],n.length,t),i=a.length;i--;)n[o=a[i]]&&(n[o]=!(r[o]=n[o]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},a=le.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!Y.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=le.setDocument=function(e){var t,o,i=e?e.ownerDocument||e:b;return i!=f&&9===i.nodeType&&i.documentElement?(m=(f=i).documentElement,v=!a(f),b!=f&&(o=f.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ae,!1):o.attachEvent&&o.attachEvent("onunload",ae)),n.scope=ce(function(e){return m.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ce(function(e){return m.appendChild(e).id=S,!f.getElementsByName||!f.getElementsByName(S).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n,r,o,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(o=t.getElementsByName(e),r=0;a=o[r++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[o++];)1===n.nodeType&&r.push(n);return r}return a},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&v)return t.getElementsByClassName(e)},h=[],g=[],(n.qsa=J.test(f.querySelectorAll))&&(ce(function(e){var t;m.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+B+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+S+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=J.test(y=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),h.push("!=",H)}),g=g.length&&new RegExp(g.join("|")),h=h.length&&new RegExp(h.join("|")),t=J.test(m.compareDocumentPosition),E=t||J.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},x=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==b&&E(b,e)?-1:t==f||t.ownerDocument==b&&E(b,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,o=e.parentNode,a=t.parentNode,i=[e],l=[t];if(!o||!a)return e==f?-1:t==f?1:o?-1:a?1:c?P(c,e)-P(c,t):0;if(o===a)return pe(e,t);for(n=e;n=n.parentNode;)i.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;i[r]===l[r];)r++;return r?pe(i[r],l[r]):i[r]==b?-1:l[r]==b?1:0},f):f},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&v&&!N[t+" "]&&(!h||!h.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){N(t,!0)}return le(t,f,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=f&&p(e),E(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=f&&p(e);var o=r.attrHandle[t.toLowerCase()],a=o&&w.call(r.attrHandle,t.toLowerCase())?o(e,t,!v):void 0;return void 0!==a?a:n.attributes||!v?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},le.escape=function(e){return(e+"").replace(re,oe)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],o=0,a=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(x),d){for(;t=e[a++];)t===e[a]&&(o=r.push(a));for(;o--;)e.splice(r[o],1)}return c=null,e},o=le.getText=function(e){var t,n="",r=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ue,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=i(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=_[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&_(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=le.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var a="nth"!==e.slice(0,3),i="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var u,c,d,p,f,m,v=a!==i?"nextSibling":"previousSibling",g=t.parentNode,h=l&&t.nodeName.toLowerCase(),y=!s&&!l,E=!1;if(g){if(a){for(;v;){for(p=t;p=p[v];)if(l?p.nodeName.toLowerCase()===h:1===p.nodeType)return!1;m=v="only"===e&&!m&&"nextSibling"}return!0}if(m=[i?g.firstChild:g.lastChild],i&&y){for(E=(f=(u=(c=(d=(p=g)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===D&&u[1])&&u[2],p=f&&g.childNodes[f];p=++f&&p&&p[v]||(E=f=0)||m.pop();)if(1===p.nodeType&&++E&&p===t){c[e]=[D,f,E];break}}else if(y&&(E=f=(u=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===D&&u[1]),!1===E)for(;(p=++f&&p&&p[v]||(E=f=0)||m.pop())&&((l?p.nodeName.toLowerCase()!==h:1!==p.nodeType)||!++E||(y&&((c=(d=p[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[D,E]),p!==t)););return(E-=o)===r||E%r==0&&E/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return o[S]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,n){for(var r,a=o(e,t),i=a.length;i--;)e[r=P(e,a[i])]=!(n[r]=a[i])}):function(e){return o(e,0,n)}):o}},pseudos:{not:ue(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[S]?ue(function(e,t,n,o){for(var a,i=r(e,null,o,[]),l=e.length;l--;)(a=i[l])&&(e[l]=!(t[l]=a))}):function(e,o,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}}),has:ue(function(e){return function(t){return le(e,t).length>0}}),contains:ue(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}}),lang:ue(function(e){return K.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ve(!1),disabled:ve(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge(function(){return[0]}),last:ge(function(e,t){return[t-1]}),eq:ge(function(e,t,n){return[n<0?n+t:n]}),even:ge(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ge(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ge(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ge(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=me(t);function ye(){}function Ee(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Se(e,t,n){var r=t.dir,o=t.next,a=o||r,i=n&&"parentNode"===a,l=A++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o);return!1}:function(t,n,s){var u,c,d,p=[D,l];if(s){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=(d=t[S]||(t[S]={}))[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[a])&&u[0]===D&&u[1]===l)return p[2]=u[2];if(c[a]=p,p[2]=e(t,n,s))return!0}return!1}}function be(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function De(e,t,n,r,o){for(var a,i=[],l=0,s=e.length,u=null!=t;l<s;l++)(a=e[l])&&(n&&!n(a,r,o)||(i.push(a),u&&t.push(l)));return i}function Ae(e,t,n,r,o,a){return r&&!r[S]&&(r=Ae(r)),o&&!o[S]&&(o=Ae(o,a)),ue(function(a,i,l,s){var u,c,d,p=[],f=[],m=i.length,v=a||function(e,t,n){for(var r=0,o=t.length;r<o;r++)le(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),g=!e||!a&&t?v:De(v,p,e,l,s),h=n?o||(a?e:m||r)?[]:i:g;if(n&&n(g,h,l,s),r)for(u=De(h,f),r(u,[],l,s),c=u.length;c--;)(d=u[c])&&(h[f[c]]=!(g[f[c]]=d));if(a){if(o||e){if(o){for(u=[],c=h.length;c--;)(d=h[c])&&u.push(g[c]=d);o(null,h=[],u,s)}for(c=h.length;c--;)(d=h[c])&&(u=o?P(a,d):p[c])>-1&&(a[u]=!(i[u]=d))}}else h=De(h===i?h.splice(m,h.length):h),o?o(null,i,h,s):O.apply(i,h)})}function _e(e){for(var t,n,o,a=e.length,i=r.relative[e[0].type],l=i||r.relative[" "],s=i?1:0,c=Se(function(e){return e===t},l,!0),d=Se(function(e){return P(t,e)>-1},l,!0),p=[function(e,n,r){var o=!i&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,o}];s<a;s++)if(n=r.relative[e[s].type])p=[Se(be(p),n)];else{if((n=r.filter[e[s].type].apply(null,e[s].matches))[S]){for(o=++s;o<a&&!r.relative[e[o].type];o++);return Ae(s>1&&be(p),s>1&&Ee(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(z,"$1"),n,s<o&&_e(e.slice(s,o)),o<a&&_e(e=e.slice(o)),o<a&&Ee(e))}p.push(n)}return be(p)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,i=le.tokenize=function(e,t){var n,o,a,i,l,s,u,c=T[e+" "];if(c)return t?0:c.slice(0);for(l=e,s=[],u=r.preFilter;l;){for(i in n&&!(o=q.exec(l))||(o&&(l=l.slice(o[0].length)||l),s.push(a=[])),n=!1,(o=W.exec(l))&&(n=o.shift(),a.push({value:n,type:o[0].replace(z," ")}),l=l.slice(n.length)),r.filter)!(o=$[i].exec(l))||u[i]&&!(o=u[i](o))||(n=o.shift(),a.push({value:n,type:i,matches:o}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):T(e,s).slice(0)},l=le.compile=function(e,t){var n,o=[],a=[],l=C[e+" "];if(!l){for(t||(t=i(e)),n=t.length;n--;)(l=_e(t[n]))[S]?o.push(l):a.push(l);(l=C(e,function(e,t){var n=t.length>0,o=e.length>0,a=function(a,i,l,s,c){var d,m,g,h=0,y="0",E=a&&[],S=[],b=u,A=a||o&&r.find.TAG("*",c),_=D+=null==b?1:Math.random()||.1,T=A.length;for(c&&(u=i==f||i||c);y!==T&&null!=(d=A[y]);y++){if(o&&d){for(m=0,i||d.ownerDocument==f||(p(d),l=!v);g=e[m++];)if(g(d,i||f,l)){s.push(d);break}c&&(D=_)}n&&((d=!g&&d)&&h--,a&&E.push(d))}if(h+=y,n&&y!==h){for(m=0;g=t[m++];)g(E,S,i,l);if(a){if(h>0)for(;y--;)E[y]||S[y]||(S[y]=L.call(s));S=De(S)}O.apply(s,S),c&&!a&&S.length>0&&h+t.length>1&&le.uniqueSort(s)}return c&&(D=_,u=b),E};return n?ue(a):a}(a,o))).selector=e}return l},s=le.select=function(e,t,n,o){var a,s,u,c,d,p="function"==typeof e&&e,f=!o&&i(e=p.selector||e);if(n=n||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(u=s[0]).type&&9===t.nodeType&&v&&r.relative[s[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(a=$.needsContext.test(e)?0:s.length;a--&&!r.relative[c=(u=s[a]).type];)if((d=r.find[c])&&(o=d(u.matches[0].replace(te,ne),ee.test(s[0].type)&&he(t.parentNode)||t))){if(s.splice(a,1),!(e=o.length&&Ee(s)))return O.apply(n,o),n;break}}return(p||l(e,f))(o,t,!v,n,!t||ee.test(e)&&he(t.parentNode)||t),n},n.sortStable=S.split("").sort(x).join("")===S,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),le}(e);S.find=D,S.expr=D.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=D.uniqueSort,S.text=D.getText,S.isXMLDoc=D.isXML,S.contains=D.contains,S.escapeSelector=D.escape;var A=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&S(e).is(n))break;r.push(e)}return r},_=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=S.expr.match.needsContext;function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function x(e,t,n){return m(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return l.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(o[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,o[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(x(this,e||[],!1))},not:function(e){return this.pushStack(x(this,e||[],!0))},is:function(e){return!!x(this,"string"==typeof e&&T.test(e)?S(e):e||[],!1).length}});var w,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||w,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(S.merge(this,S.parseHTML(r[1],(t=t instanceof S?t[0]:t)&&t.nodeType?t.ownerDocument||t:g,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=g.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(g);var L=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,o=this.length,a=[],i="string"!=typeof e&&S(e);if(!T.test(e))for(;r<o;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(i?i.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?S.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?l.call(S(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return _((e.parentNode||{}).firstChild,e)},children:function(e){return _(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var o=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=S.filter(r,o)),this.length>1&&(k[e]||S.uniqueSort(o),L.test(e)&&o.reverse()),this.pushStack(o)}});var R=/[^\x20\t\r\n\f]+/g;function P(e){return e}function M(e){throw e}function B(e,t,n,r){var o;try{e&&m(o=e.promise)?o.call(e).done(t).fail(n):e&&m(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,r,o,a=[],i=[],l=-1,s=function(){for(o=o||e.once,r=t=!0;i.length;l=-1)for(n=i.shift();++l<a.length;)!1===a[l].apply(n[0],n[1])&&e.stopOnFalse&&(l=a.length,n=!1);e.memory||(n=!1),t=!1,o&&(a=n?[]:"")},u={add:function(){return a&&(n&&!t&&(l=a.length-1,i.push(n)),function t(n){S.each(n,function(n,r){m(r)?e.unique&&u.has(r)||a.push(r):r&&r.length&&"string"!==E(r)&&t(r)})}(arguments),n&&!t&&s()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,a,n))>-1;)a.splice(n,1),n<=l&&l--}),this},has:function(e){return e?S.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return o=i=[],a=n="",this},disabled:function(){return!a},lock:function(){return o=i=[],n||t||(a=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],i.push(n),t||s()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(t){S.each(n,function(n,r){var o=m(e[r[4]])&&e[r[4]];a[r[1]](function(){var e=o&&o.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,r,o){var a=0;function i(t,n,r,o){return function(){var l=this,s=arguments,u=function(){var e,u;if(!(t<a)){if((e=r.apply(l,s))===n.promise())throw new TypeError("Thenable self-resolution");m(u=e&&("object"==typeof e||"function"==typeof e)&&e.then)?o?u.call(e,i(a,n,P,o),i(a,n,M,o)):(a++,u.call(e,i(a,n,P,o),i(a,n,M,o),i(a,n,P,n.notifyWith))):(r!==P&&(l=void 0,s=[e]),(o||n.resolveWith)(l,s))}},c=o?u:function(){try{u()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,c.stackTrace),t+1>=a&&(r!==M&&(l=void 0,s=[e]),n.rejectWith(l,s))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),e.setTimeout(c))}}return S.Deferred(function(e){n[0][3].add(i(0,e,m(o)?o:P,e.notifyWith)),n[1][3].add(i(0,e,m(t)?t:P)),n[2][3].add(i(0,e,m(r)?r:M))}).promise()},promise:function(e){return null!=e?S.extend(e,o):o}},a={};return S.each(n,function(e,t){var i=t[2],l=t[5];o[t[1]]=i.add,l&&i.add(function(){r=l},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),i.add(t[3].fire),a[t[0]]=function(){return a[t[0]+"With"](this===a?void 0:this,arguments),this},a[t[0]+"With"]=i.fireWith}),o.promise(a),t&&t.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),a=o.call(arguments),i=S.Deferred(),l=function(e){return function(n){r[e]=this,a[e]=arguments.length>1?o.call(arguments):n,--t||i.resolveWith(r,a)}};if(t<=1&&(B(e,i.done(l(n)).resolve,i.reject,!t),"pending"===i.state()||m(a[n]&&a[n].then)))return i.then();for(;n--;)B(a[n],l(n),i.reject);return i.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var j=S.Deferred();function H(){g.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return j.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||j.resolveWith(g,[S]))}}),S.ready.then=j.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(S.ready):(g.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var U=function(e,t,n,r,o,a,i){var l=0,s=e.length,u=null==n;if("object"===E(n))for(l in o=!0,n)U(e,t,l,n[l],!0,a,i);else if(void 0!==r&&(o=!0,m(r)||(i=!0),u&&(i?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(S(e),n)})),t))for(;l<s;l++)t(e[l],n,i?r:r.call(e[l],l,t(e[l],n)));return o?e:u?t.call(e):s?t(e[0],n):a},z=/^-ms-/,q=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(q,W)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=S.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[V(t)]=n;else for(r in t)o[V(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var $=new K,Y=new K,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}Y.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Y.hasData(e)||$.hasData(e)},data:function(e,t,n){return Y.access(e,t,n)},removeData:function(e,t){Y.remove(e,t)},_data:function(e,t,n){return $.access(e,t,n)},_removeData:function(e,t){$.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,o,a=this[0],i=a&&a.attributes;if(void 0===e){if(this.length&&(o=Y.get(a),1===a.nodeType&&!$.get(a,"hasDataAttrs"))){for(n=i.length;n--;)i[n]&&0===(r=i[n].name).indexOf("data-")&&(r=V(r.slice(5)),J(a,r,o[r]));$.set(a,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){Y.set(this,e)}):U(this,function(t){var n;if(a&&void 0===t)return void 0!==(n=Y.get(a,e))||void 0!==(n=J(a,e))?n:void 0;this.each(function(){Y.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return r=$.get(e,t=(t||"fx")+"queue"),n&&(!r||Array.isArray(n)?r=$.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){var n=S.queue(e,t=t||"fx"),r=n.length,o=n.shift(),a=S._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete a.stop,o.call(e,function(){S.dequeue(e,t)},a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return $.get(e,n)||$.access(e,n,{empty:S.Callbacks("once memory").add(function(){$.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=S.Deferred(),a=this,i=this.length,l=function(){--r||o.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";i--;)(n=$.get(a[i],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(l));return l(),o.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=g.documentElement,re=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};ne.getRootNode&&(re=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&re(e)&&"none"===S.css(e,"display")};function ie(e,t,n,r){var o,a,i=20,l=r?function(){return r.cur()}:function(){return S.css(e,t,"")},s=l(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+s)&&ee.exec(S.css(e,t));if(c&&c[3]!==u){for(u=u||c[3],c=+(s/=2)||1;i--;)S.style(e,t,c+u),(1-a)*(1-(a=l()/s||.5))<=0&&(i=0),c/=a;S.style(e,t,(c*=2)+u),n=n||[]}return n&&(c=+c||+s||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=o)),o}var le={};function se(e){var t,n=e.ownerDocument,r=e.nodeName,o=le[r];return o||(t=n.body.appendChild(n.createElement(r)),o=S.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),le[r]=o,o)}function ue(e,t){for(var n,r,o=[],a=0,i=e.length;a<i;a++)(r=e[a]).style&&(n=r.style.display,t?("none"===n&&(o[a]=$.get(r,"display")||null,o[a]||(r.style.display="")),""===r.style.display&&ae(r)&&(o[a]=se(r))):"none"!==n&&(o[a]="none",$.set(r,"display",n)));for(a=0;a<i;a++)null!=o[a]&&(e[a].style.display=o[a]);return e}S.fn.extend({show:function(){return ue(this,!0)},hide:function(){return ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,fe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;ce=g.createDocumentFragment().appendChild(g.createElement("div")),(de=g.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),f.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",f.option=!!ce.lastChild;var ve={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ge(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?S.merge([e],n):n}function he(e,t){for(var n=0,r=e.length;n<r;n++)$.set(e[n],"globalEval",!t||$.get(t[n],"globalEval"))}ve.tbody=ve.tfoot=ve.colgroup=ve.caption=ve.thead,ve.th=ve.td,f.option||(ve.optgroup=ve.option=[1,"<select multiple='multiple'>","</select>"]);var ye=/<|&#?\w+;/;function Ee(e,t,n,r,o){for(var a,i,l,s,u,c,d=t.createDocumentFragment(),p=[],f=0,m=e.length;f<m;f++)if((a=e[f])||0===a)if("object"===E(a))S.merge(p,a.nodeType?[a]:a);else if(ye.test(a)){for(i=i||d.appendChild(t.createElement("div")),l=(fe.exec(a)||["",""])[1].toLowerCase(),i.innerHTML=(s=ve[l]||ve._default)[1]+S.htmlPrefilter(a)+s[2],c=s[0];c--;)i=i.lastChild;S.merge(p,i.childNodes),(i=d.firstChild).textContent=""}else p.push(t.createTextNode(a));for(d.textContent="",f=0;a=p[f++];)if(r&&S.inArray(a,r)>-1)o&&o.push(a);else if(u=re(a),i=ge(d.appendChild(a),"script"),u&&he(i),n)for(c=0;a=i[c++];)me.test(a.type||"")&&n.push(a);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function De(){return!1}function Ae(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function _e(e,t,n,r,o,a){var i,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)_e(e,l,n,r,t[l],a);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=De;else if(!o)return e;return 1===a&&(i=o,(o=function(e){return S().off(e),i.apply(this,arguments)}).guid=i.guid||(i.guid=S.guid++)),e.each(function(){S.event.add(this,t,o,r,n)})}function Te(e,t,n){n?($.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,a,i=$.get(this,t);if(1&e.isTrigger&&this[t]){if(i.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(i=o.call(arguments),$.set(this,t,i),r=n(this,t),this[t](),i!==(a=$.get(this,t))||r?$.set(this,t,!1):a={},i!==a)return e.stopImmediatePropagation(),e.preventDefault(),a&&a.value}else i.length&&($.set(this,t,{value:S.event.trigger(S.extend(i[0],S.Event.prototype),i.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===$.get(e,t)&&S.event.add(e,t,be)}S.event={global:{},add:function(e,t,n,r,o){var a,i,l,s,u,c,d,p,f,m,v,g=$.get(e);if(G(e))for(n.handler&&(n=(a=n).handler,o=a.selector),o&&S.find.matchesSelector(ne,o),n.guid||(n.guid=S.guid++),(s=g.events)||(s=g.events=Object.create(null)),(i=g.handle)||(i=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(R)||[""]).length;u--;)f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},d=S.event.special[f=(o?d.delegateType:d.bindType)||f]||{},c=S.extend({type:f,origType:v,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&S.expr.match.needsContext.test(o),namespace:m.join(".")},a),(p=s[f])||((p=s[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,m,i)||e.addEventListener&&e.addEventListener(f,i)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[f]=!0)},remove:function(e,t,n,r,o){var a,i,l,s,u,c,d,p,f,m,v,g=$.hasData(e)&&$.get(e);if(g&&(s=g.events)){for(u=(t=(t||"").match(R)||[""]).length;u--;)if(f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},p=s[f=(r?d.delegateType:d.bindType)||f]||[],l=l[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=a=p.length;a--;)c=p[a],!o&&v!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(a,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));i&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,g.handle)||S.removeEvent(e,f,g.handle),delete s[f])}else for(f in s)S.event.remove(e,f+t[u],n,r,!0);S.isEmptyObject(s)&&$.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,a,i,l=new Array(arguments.length),s=S.event.fix(e),u=($.get(this,"events")||Object.create(null))[s.type]||[],c=S.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(i=S.event.handlers.call(this,s,u),t=0;(o=i[t++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(a=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==a.namespace&&!s.rnamespace.test(a.namespace)||(s.handleObj=a,s.data=a.data,void 0!==(r=((S.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,l))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,o,a,i,l=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(a=[],i={},n=0;n<s;n++)void 0===i[o=(r=t[n]).selector+" "]&&(i[o]=r.needsContext?S(o,this).index(u)>-1:S.find(o,this,null,[u]).length),i[o]&&a.push(r);a.length&&l.push({elem:u,handlers:a})}return u=this,s<t.length&&l.push({elem:u,handlers:t.slice(s)}),l},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Te(t,"click",be),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Te(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&C(t,"input")&&$.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:De,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:De,isPropagationStopped:De,isImmediatePropagationStopped:De,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Te(this,e,Ae),!1},trigger:function(){return Te(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,a=e.handleObj;return o&&(o===r||S.contains(r,o))||(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return _e(this,e,t,n,r)},one:function(e,t,n,r){return _e(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=De),this.each(function(){S.event.remove(this,e,n,t)})}});var Ce=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,xe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function we(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function ke(e,t){var n,r,o,a,i,l;if(1===t.nodeType){if($.hasData(e)&&(l=$.get(e).events))for(o in $.remove(t,"handle events"),l)for(n=0,r=l[o].length;n<r;n++)S.event.add(t,o,l[o][n]);Y.hasData(e)&&(a=Y.access(e),i=S.extend({},a),Y.set(t,i))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a(t);var o,i,l,s,u,c,d=0,p=e.length,v=p-1,g=t[0],h=m(g);if(h||p>1&&"string"==typeof g&&!f.checkClone&&Ne.test(g))return e.each(function(o){var a=e.eq(o);h&&(t[0]=g.call(this,o,a.html())),Re(a,t,n,r)});if(p&&(i=(o=Ee(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=(l=S.map(ge(o,"script"),Ie)).length;d<p;d++)u=o,d!==v&&(u=S.clone(u,!0,!0),s&&S.merge(l,ge(u,"script"))),n.call(e[d],u,d);if(s)for(c=l[l.length-1].ownerDocument,S.map(l,Le),d=0;d<s;d++)me.test((u=l[d]).type||"")&&!$.access(u,"globalEval")&&S.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):y(u.textContent.replace(xe,""),u,c))}return e}function Pe(e,t,n){for(var r,o=t?S.filter(t,e):e,a=0;null!=(r=o[a]);a++)n||1!==r.nodeType||S.cleanData(ge(r)),r.parentNode&&(n&&re(r)&&he(ge(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,o,a,i,l=e.cloneNode(!0),s=re(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(i=ge(l),r=0,o=(a=ge(e)).length;r<o;r++)Oe(a[r],i[r]);if(t)if(n)for(a=a||ge(e),i=i||ge(l),r=0,o=a.length;r<o;r++)ke(a[r],i[r]);else ke(e,l);return(i=ge(l,"script")).length>0&&he(i,!s&&ge(e,"script")),l},cleanData:function(e){for(var t,n,r,o=S.event.special,a=0;void 0!==(n=e[a]);a++)if(G(n)){if(t=n[$.expando]){if(t.events)for(r in t.events)o[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[$.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return U(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||we(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=we(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ge(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return U(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ce.test(e)&&!ve[(fe.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ge(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(ge(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,r=[],o=S(e),a=o.length-1,l=0;l<=a;l++)n=l===a?this:this.clone(!0),S(o[l])[t](n),i.apply(r,n.get());return this.pushStack(r)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Be=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=function(e,t,n){var r,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in r=n.call(e),t)e.style[o]=a[o];return r},je=new RegExp(te.join("|"),"i");function He(e,t,n){var r,o,a,i,l=e.style;return(n=n||Be(e))&&(""!==(i=n.getPropertyValue(t)||n[t])||re(e)||(i=S.style(e,t)),!f.pixelBoxStyles()&&Me.test(i)&&je.test(t)&&(r=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=i,i=n.width,l.width=r,l.minWidth=o,l.maxWidth=a)),void 0!==i?i+"":i}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,s=12===n(t.marginLeft),c.style.right="60%",i=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=12===n(c.offsetWidth/3),ne.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,o,a,i,l,s,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(f,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),i},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),a},reliableTrDimensions:function(){var t,n,r,o;return null==l&&(t=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",ne.appendChild(t).appendChild(n).appendChild(r),o=e.getComputedStyle(n),l=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),l}}))}();var ze=["Webkit","Moz","ms"],qe=g.createElement("div").style,We={};function Ve(e){return S.cssProps[e]||We[e]||(e in qe?e:We[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=ze.length;n--;)if((e=ze[n]+t)in qe)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,$e={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var r=ee.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,o,a){var i="width"===t?1:0,l=0,s=0;if(n===(r?"border":"content"))return 0;for(;i<4;i+=2)"margin"===n&&(s+=S.css(e,n+te[i],!0,o)),r?("content"===n&&(s-=S.css(e,"padding"+te[i],!0,o)),"margin"!==n&&(s-=S.css(e,"border"+te[i]+"Width",!0,o))):(s+=S.css(e,"padding"+te[i],!0,o),"padding"!==n?s+=S.css(e,"border"+te[i]+"Width",!0,o):l+=S.css(e,"border"+te[i]+"Width",!0,o));return!r&&a>=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-s-l-.5))||0),s}function Je(e,t,n){var r=Be(e),o=(!f.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),a=o,i=He(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(i)){if(!n)return i;i="auto"}return(!f.boxSizingReliable()&&o||!f.reliableTrDimensions()&&C(e,"tr")||"auto"===i||!parseFloat(i)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===S.css(e,"boxSizing",!1,r),(a=l in e)&&(i=e[l])),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}function Qe(e,t,n,r,o){return new Qe.prototype.init(e,t,n,r,o)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,i,l=V(t),s=Ke.test(t),u=e.style;if(s||(t=Ve(l)),i=S.cssHooks[t]||S.cssHooks[l],void 0===n)return i&&"get"in i&&void 0!==(o=i.get(e,!1,r))?o:u[t];"string"==(a=typeof n)&&(o=ee.exec(n))&&o[1]&&(n=ie(e,t,o),a="number"),null!=n&&n==n&&("number"!==a||s||(n+=o&&o[3]||(S.cssNumber[l]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),i&&"set"in i&&void 0===(n=i.set(e,n,r))||(s?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var o,a,i,l=V(t);return Ke.test(t)||(t=Ve(l)),(i=S.cssHooks[t]||S.cssHooks[l])&&"get"in i&&(o=i.get(e,!0,n)),void 0===o&&(o=He(e,t,r)),"normal"===o&&t in Ye&&(o=Ye[t]),""===n||n?(a=parseFloat(o),!0===n||isFinite(a)?a||0:o):o}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,r):Fe(e,$e,function(){return Je(e,t,r)})},set:function(e,n,r){var o,a=Be(e),i=!f.scrollboxSize()&&"absolute"===a.position,l=(i||r)&&"border-box"===S.css(e,"boxSizing",!1,a),s=r?Ze(e,t,r,l,a):0;return l&&i&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-Ze(e,t,"border",!1,a)-.5)),s&&(o=ee.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),Xe(0,n,s)}}}),S.cssHooks.marginLeft=Ue(f.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,o={},a="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+te[r]+t]=a[r]||a[r-2]||a[0];return o}},"margin"!==e&&(S.cssHooks[e+t].set=Xe)}),S.fn.extend({css:function(e,t){return U(this,function(e,t,n){var r,o,a={},i=0;if(Array.isArray(t)){for(r=Be(e),o=t.length;i<o;i++)a[t[i]]=S.css(e,t[i],!1,r);return a}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,r,o,a){this.elem=e,this.prop=n,this.easing=o||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(S.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Qe.prototype.init,S.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;function ot(){tt&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(ot):e.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function it(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=te[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function lt(e,t,n){for(var r,o=(st.tweeners[t]||[]).concat(st.tweeners["*"]),a=0,i=o.length;a<i;a++)if(r=o[a].call(n,t,e))return r}function st(e,t,n){var r,o,a=0,i=st.prefilters.length,l=S.Deferred().always(function(){delete s.elem}),s=function(){if(o)return!1;for(var t=et||at(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),a=0,i=u.tweens.length;a<i;a++)u.tweens[a].run(r);return l.notifyWith(e,[u,r,n]),r<1&&i?n:(i||l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u]),!1)},u=l.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||at(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)u.tweens[n].run(1);return t?(l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u,t])):l.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,o,a,i;for(n in e)if(o=t[r=V(n)],a=e[n],Array.isArray(a)&&(o=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(i=S.cssHooks[r])&&"expand"in i)for(n in a=i.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=o);else t[r]=o}(c,u.opts.specialEasing);a<i;a++)if(r=st.prefilters[a].call(u,e,c,u.opts))return m(r.stop)&&(S._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,lt,u),m(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),S.fx.timer(S.extend(s,{elem:e,anim:u,queue:u.opts.queue})),u}S.Animation=S.extend(st,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ie(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,o=e.length;r<o;r++)(st.tweeners[n=e[r]]=st.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var r,o,a,i,l,s,u,c,d="width"in t||"height"in t,p=this,f={},m=e.style,v=e.nodeType&&ae(e),g=$.get(e,"fxshow");for(r in n.queue||(null==(i=S._queueHooks(e,"fx")).unqueued&&(i.unqueued=0,l=i.empty.fire,i.empty.fire=function(){i.unqueued||l()}),i.unqueued++,p.always(function(){p.always(function(){i.unqueued--,S.queue(e,"fx").length||i.empty.fire()})})),t)if(nt.test(o=t[r])){if(delete t[r],a=a||"toggle"===o,o===(v?"hide":"show")){if("show"!==o||!g||void 0===g[r])continue;v=!0}f[r]=g&&g[r]||S.style(e,r)}if((s=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(r in d&&1===e.nodeType&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],null==(u=g&&g.display)&&(u=$.get(e,"display")),"none"===(c=S.css(e,"display"))&&(u?c=u:(ue([e],!0),u=e.style.display||u,c=S.css(e,"display"),ue([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===S.css(e,"float")&&(s||(p.done(function(){m.display=u}),null==u&&(u="none"===(c=m.display)?"":c)),m.display="inline-block")),n.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),s=!1,f)s||(g?"hidden"in g&&(v=g.hidden):g=$.access(e,"fxshow",{display:u}),a&&(g.hidden=!v),v&&ue([e],!0),p.done(function(){for(r in v||ue([e]),$.remove(e,"fxshow"),f)S.style(e,r,f[r])})),s=lt(v?g[r]:0,r,p),r in g||(g[r]=s.start,v&&(s.end=s.start,s.start=0))}],prefilter:function(e,t){t?st.prefilters.unshift(e):st.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration=r.duration in S.fx.speeds?S.fx.speeds[r.duration]:S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=S.isEmptyObject(e),a=S.speed(t,n,r),i=function(){var t=st(this,S.extend({},e),a);(o||$.get(this,"finish"))&&t.stop(!0)};return i.finish=i,o||!1===a.queue?this.each(i):this.queue(a.queue,i)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",a=S.timers,i=$.get(this);if(o)i[o]&&i[o].stop&&r(i[o]);else for(o in i)i[o]&&i[o].stop&&rt.test(o)&&r(i[o]);for(o=a.length;o--;)a[o].elem!==this||null!=e&&a[o].queue!==e||(a[o].anim.stop(n),t=!1,a.splice(o,1));!t&&n||S.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=$.get(this),r=n[e+"queue"],o=n[e+"queueHooks"],a=S.timers,i=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<i;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(it(t,!0),e,r,o)}}),S.each({slideDown:it("show"),slideUp:it("hide"),slideToggle:it("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),et=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){tt||(tt=!0,ot())},S.fx.stop=function(){tt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,r){var o=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(o)}})},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var ut,ct=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return U(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,o,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?S.prop(e,t,n):(1===a&&S.isXMLDoc(e)||(o=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(R);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||S.find.attr;ct[t]=function(e,t,r){var o,a,i=t.toLowerCase();return r||(a=ct[i],ct[i]=o,o=null!=n(e,t,r)?i:null,ct[i]=a),o}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function ft(e){return(e.match(R)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return U(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,o,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&S.isXMLDoc(e)||(o=S.propHooks[t=S.propFix[t]||t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(S.propHooks.selected={get:function(e){return null},set:function(e){}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,r,o,a,i,l,s=0;if(m(e))return this.each(function(t){S(this).addClass(e.call(this,t,mt(this)))});if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(i=0;a=t[i++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,o,a,i,l,s=0;if(m(e))return this.each(function(t){S(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(i=0;a=t[i++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,o,a,i;if(r)for(o=0,a=S(this),i=vt(e);t=i[o++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&$.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":$.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+ft(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var gt=/\r/g;S.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=m(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,S(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=S.map(o,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=S.valHooks[o.type]||S.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(gt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ft(S.text(e))}},select:{get:function(e){var t,n,r,o=e.options,a=e.selectedIndex,i="select-one"===e.type,l=i?null:[],s=i?a+1:o.length;for(r=a<0?s:i?a:0;r<s;r++)if(((n=o[r]).selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=S(n).val(),i)return t;l.push(t)}return l},set:function(e,t){for(var n,r,o=e.options,a=S.makeArray(t),i=o.length;i--;)((r=o[i]).selected=S.inArray(S.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},f.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),f.focusin="onfocusin"in e;var ht=/^(?:focusinfocus|focusoutblur)$/,yt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,r,o){var a,i,l,s,u,d,p,f,h=[r||g],y=c.call(t,"type")?t.type:t,E=c.call(t,"namespace")?t.namespace.split("."):[];if(i=f=l=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!ht.test(y+S.event.triggered)&&(y.indexOf(".")>-1&&(E=y.split("."),y=E.shift(),E.sort()),u=y.indexOf(":")<0&&"on"+y,(t=t[S.expando]?t:new S.Event(y,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=E.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:S.makeArray(n,[t]),p=S.event.special[y]||{},o||!p.trigger||!1!==p.trigger.apply(r,n))){if(!o&&!p.noBubble&&!v(r)){for(ht.test((s=p.delegateType||y)+y)||(i=i.parentNode);i;i=i.parentNode)h.push(i),l=i;l===(r.ownerDocument||g)&&h.push(l.defaultView||l.parentWindow||e)}for(a=0;(i=h[a++])&&!t.isPropagationStopped();)f=i,t.type=a>1?s:p.bindType||y,(d=($.get(i,"events")||Object.create(null))[t.type]&&$.get(i,"handle"))&&d.apply(i,n),(d=u&&i[u])&&d.apply&&G(i)&&(t.result=d.apply(i,n),!1===t.result&&t.preventDefault());return t.type=y,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),n)||!G(r)||u&&m(r[y])&&!v(r)&&((l=r[u])&&(r[u]=null),S.event.triggered=y,t.isPropagationStopped()&&f.addEventListener(y,yt),r[y](),t.isPropagationStopped()&&f.removeEventListener(y,yt),S.event.triggered=void 0,l&&(r[u]=l)),t.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),f.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=$.access(r,t);o||r.addEventListener(e,n,!0),$.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=$.access(r,t)-1;o?$.access(r,t,o):(r.removeEventListener(e,n,!0),$.remove(r,t))}}});var Et=e.location,St={guid:Date.now()},bt=/\?/;S.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var Dt=/\[\]$/,At=/\r?\n/g,_t=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;function Ct(e,t,n,r){var o;if(Array.isArray(t))S.each(t,function(t,o){n||Dt.test(e)?r(e,o):Ct(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==E(t))r(e,t);else for(o in t)Ct(e+"["+o+"]",t[o],n,r)}S.param=function(e,t){var n,r=[],o=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){o(this.name,this.value)});else for(n in e)Ct(n,e[n],t,o);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Tt.test(this.nodeName)&&!_t.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Nt=/%20/g,xt=/#.*$/,wt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,kt=/^\/\//,Ot={},Rt={},Pt="*/".concat("*"),Mt=g.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,a=t.toLowerCase().match(R)||[];if(m(n))for(;r=a[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var o={},a=e===Rt;function i(l){var s;return o[l]=!0,S.each(e[l]||[],function(e,l){var u=l(t,n,r);return"string"!=typeof u||a||o[u]?a?!(s=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),s}return i(t.dataTypes[0])||!o["*"]&&i("*")}function jt(e,t){var n,r,o=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=Et.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?jt(jt(e,S.ajaxSettings),t):jt(S.ajaxSettings,e)},ajaxPrefilter:Bt(Ot),ajaxTransport:Bt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var r,o,a,i,l,s,u,c,d,p,f=S.ajaxSetup({},n=n||{}),m=f.context||f,v=f.context&&(m.nodeType||m.jquery)?S(m):S.event,h=S.Deferred(),y=S.Callbacks("once memory"),E=f.statusCode||{},b={},D={},A="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(u){if(!i)for(i={};t=It.exec(a);)i[t[1].toLowerCase()+" "]=(i[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=i[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?a:null},setRequestHeader:function(e,t){return null==u&&(e=D[e.toLowerCase()]=D[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)_.always(e[_.status]);else for(t in e)E[t]=[E[t],e[t]];return this},abort:function(e){var t=e||A;return r&&r.abort(t),T(0,t),this}};if(h.promise(_),f.url=((t||f.url||Et.href)+"").replace(kt,Et.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(R)||[""],null==f.crossDomain){s=g.createElement("a");try{s.href=f.url,s.href=s.href,f.crossDomain=Mt.protocol+"//"+Mt.host!=s.protocol+"//"+s.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Ft(Ot,f,n,_),u)return _;for(d in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Lt.test(f.type),o=f.url.replace(xt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Nt,"+")):(p=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(bt.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(wt,"$1"),p=(bt.test(o)?"&":"?")+"_="+St.guid+++p),f.url=o+p),f.ifModified&&(S.lastModified[o]&&_.setRequestHeader("If-Modified-Since",S.lastModified[o]),S.etag[o]&&_.setRequestHeader("If-None-Match",S.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&_.setRequestHeader("Content-Type",f.contentType),_.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Pt+"; q=0.01":""):f.accepts["*"]),f.headers)_.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(m,_,f)||u))return _.abort();if(A="abort",y.add(f.complete),_.done(f.success),_.fail(f.error),r=Ft(Rt,f,n,_)){if(_.readyState=1,c&&v.trigger("ajaxSend",[_,f]),u)return _;f.async&&f.timeout>0&&(l=e.setTimeout(function(){_.abort("timeout")},f.timeout));try{u=!1,r.send(b,T)}catch(e){if(u)throw e;T(-1,e)}}else T(-1,"No Transport");function T(t,n,i,s){var d,p,g,b,D,A=n;u||(u=!0,l&&e.clearTimeout(l),r=void 0,a=s||"",_.readyState=t>0?4:0,d=t>=200&&t<300||304===t,i&&(b=function(e,t,n){for(var r,o,a,i,l=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){s.unshift(o);break}if(s[0]in n)a=s[0];else{for(o in n){if(!s[0]||e.converters[o+" "+s[0]]){a=o;break}i||(i=o)}a=a||i}if(a)return a!==s[0]&&s.unshift(a),n[a]}(f,_,i)),!d&&S.inArray("script",f.dataTypes)>-1&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(e,t,n,r){var o,a,i,l,s,u={},c=e.dataTypes.slice();if(c[1])for(i in e.converters)u[i.toLowerCase()]=e.converters[i];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=a,a=c.shift())if("*"===a)a=s;else if("*"!==s&&s!==a){if(!(i=u[s+" "+a]||u["* "+a]))for(o in u)if((l=o.split(" "))[1]===a&&(i=u[s+" "+l[0]]||u["* "+l[0]])){!0===i?i=u[o]:!0!==u[o]&&(a=l[0],c.unshift(l[1]));break}if(!0!==i)if(i&&e.throws)t=i(t);else try{t=i(t)}catch(e){return{state:"parsererror",error:i?e:"No conversion from "+s+" to "+a}}}return{state:"success",data:t}}(f,b,_,d),d?(f.ifModified&&((D=_.getResponseHeader("Last-Modified"))&&(S.lastModified[o]=D),(D=_.getResponseHeader("etag"))&&(S.etag[o]=D)),204===t||"HEAD"===f.type?A="nocontent":304===t?A="notmodified":(A=b.state,p=b.data,d=!(g=b.error))):(g=A,!t&&A||(A="error",t<0&&(t=0))),_.status=t,_.statusText=(n||A)+"",d?h.resolveWith(m,[p,A,_]):h.rejectWith(m,[_,A,g]),_.statusCode(E),E=void 0,c&&v.trigger(d?"ajaxSuccess":"ajaxError",[_,f,d?p:g]),y.fireWith(m,[_,A]),c&&(v.trigger("ajaxComplete",[_,f]),--S.active||S.event.trigger("ajaxStop")))}return _},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,r,o){return m(n)&&(o=o||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:o,data:n,success:r},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Ut=S.ajaxSettings.xhr();f.cors=!!Ut&&"withCredentials"in Ut,f.ajax=Ut=!!Ut,S.ajaxTransport(function(t){var n,r;if(f.cors||Ut&&!t.crossDomain)return{send:function(o,a){var i,l=t.xhr();if(l.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)l[i]=t.xhrFields[i];for(i in t.mimeType&&l.overrideMimeType&&l.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)l.setRequestHeader(i,o[i]);n=function(e){return function(){n&&(n=r=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?a(0,"error"):a(l.status,l.statusText):a(Ht[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=n(),r=l.onerror=l.ontimeout=n("error"),void 0!==l.onabort?l.onabort=r:l.onreadystatechange=function(){4===l.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{l.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,qt=[],Wt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(t,n,r){var o,a,i,l=!1!==t.jsonp&&(Wt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wt.test(t.data)&&"data");if(l||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,l?t[l]=t[l].replace(Wt,"$1"+o):!1!==t.jsonp&&(t.url+=(bt.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return i||S.error(o+" was not called"),i[0]},t.dataTypes[0]="json",a=e[o],e[o]=function(){i=arguments},r.always(function(){void 0===a?S(e).removeProp(o):e[o]=a,t[o]&&(t.jsonpCallback=n.jsonpCallback,qt.push(o)),i&&m(a)&&a(i[0]),i=a=void 0}),"script"}),f.createHTMLDocument=((zt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===zt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),a=!n&&[],(o=N.exec(e))?[t.createElement(o[1])]:(o=Ee([e],t,a),a&&a.length&&S(a).remove(),S.merge([],o.childNodes)));var r,o,a},S.fn.load=function(e,t,n){var r,o,a,i=this,l=e.indexOf(" ");return l>-1&&(r=ft(e.slice(l)),e=e.slice(0,l)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),i.length>0&&S.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){a=arguments,i.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){i.each(function(){n.apply(this,a||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var r,o,a,i,l,s,u=S.css(e,"position"),c=S(e),d={};"static"===u&&(e.style.position="relative"),l=c.offset(),a=S.css(e,"top"),s=S.css(e,"left"),("absolute"===u||"fixed"===u)&&(a+s).indexOf("auto")>-1?(i=(r=c.position()).top,o=r.left):(i=parseFloat(a)||0,o=parseFloat(s)||0),m(t)&&(t=t.call(e,n,S.extend({},l))),null!=t.top&&(d.top=t.top-l.top+i),null!=t.left&&(d.left=t.left-l.left+o),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?{top:(t=r.getBoundingClientRect()).top+(n=r.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),o.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-S.css(r,"marginTop",!0),left:t.left-o.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ne})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return U(this,function(e,r,o){var a;if(v(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===o)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:o,n?o:a.pageYOffset):e[r]=o},e,r,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=Ue(f.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){S.fn[r]=function(o,a){var i=arguments.length&&(n||"boolean"!=typeof o),l=n||(!0===o||!0===a?"margin":"border");return U(this,function(t,n,o){var a;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===o?S.css(t,n,l):S.style(t,n,o,l)},t,i?o:void 0,i)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,a;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=o.call(arguments,2),(a=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||S.guid++,a},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=C,S.isFunction=m,S.isWindow=v,S.camelCase=V,S.type=E,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var Gt=e.jQuery,Kt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Kt),t&&e.jQuery===S&&(e.jQuery=Gt),S},void 0===t&&(e.jQuery=e.$=S),S})});const O=e=>{let{className:t,onClick:n}=e;return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#1359C8",className:t,width:"24px",height:"24px",onClick:n},r.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))},R="__googleMapsScriptId";var P;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(P||(P={}));class M{constructor(e){let{apiKey:t,channel:n,client:r,id:o=R,libraries:a=[],language:i,region:l,version:s,mapIds:u,nonce:c,retries:d=3,url:p="https://maps.googleapis.com/maps/api/js"}=e;if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=s,this.apiKey=t,this.channel=n,this.client=r,this.id=o||R,this.libraries=a,this.language=i,this.region=l,this.mapIds=u,this.nonce=c,this.retries=d,this.url=p,M.instance){if(!function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return!1;for(o=r;0!=o--;){var i=a[o];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}(this.options,M.instance.options))throw new Error("Loader must not be called again with different options. "+JSON.stringify(this.options)+" !== "+JSON.stringify(M.instance.options));return M.instance}M.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get status(){return this.errors.length?P.FAILURE:this.done?P.SUCCESS:this.loading?P.LOADING:P.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),this.libraries.length>0&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="®ion="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(n=>{n?t(n.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in "+e+" ms."),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}const B="undefined"!=typeof window&&window.google?window.google:null,F=e=>{let t={};console.log("setCode=======",e);const o=e=>{var t;let n=null;return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("postal_code");n=t?e.long_name:null}),n},a=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],i=function(e,t,n){void 0===n&&(n=!1),(new B.maps.Geocoder).geocode({location:e},function(r,a){if("OK"===a&&r[0]){let a=o(r[0]);const i=document.getElementById("pac-input");i.value=(e=>{var t;let n="";return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("sublocality_level_2")||e.types.includes("sublocality_level_1");t&&(n=t?e.long_name:null)}),n})(r[0]),t&&(n?t(a,{longitude:e.lng,latitude:e.lat},i.value):t(a,{longitude:e.lng,latitude:e.lat}))}})},l=function(e,t,n){if(!e)return;const{latLng:r}=e,o={lat:r.lat(),lng:r.lng()};console.log("Lat & Long",o),t("000000",{longitude:o.lng,latitude:o.lat})},s=function(e,n,r){void 0===r&&(r=!1);const s=new window.google.maps.Map(document.getElementById("map"),{center:n,zoom:15,mapTypeId:"roadmap",styles:a}),u=document.getElementById("pac-input");var c;u&&u.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}),(c=n).lat&&c.lng&&(t={north:c.lat+.1,south:c.lat-.1,east:c.lng+.1,west:c.lng-.1});const d=new window.google.maps.places.Autocomplete(u,{bounds:t,componentRestrictions:{country:"in"},fields:["address_components","geometry","icon","name"],origin:n,strictBounds:!1,types:["address"]});s.addListener("bounds_changed",()=>{d.setBounds(s.getBounds())});let p=[new window.google.maps.Marker({map:s,title:"a",position:n,draggable:!0,clickable:!0})];r?i(n,e,!0):i(n,e),p[0].addListener("dragend",t=>l(t,e)),console.log("In initAutoComplete, searbox: ",d),d.addListener("place_changed",()=>{const t=d.getPlace();if(console.log("Place: ",t),!t)return;let n=o(t);if(console.log("Pincode: ",n),n){const{geometry:o}=t,a={latitude:o.location.lat(),longitude:o.location.lng()};r?e(n,a,t.name):e(n,a)}p.forEach(e=>{e.setMap(null)}),p=[];const a=new window.google.maps.LatLngBounds;t.geometry&&(p.push(new window.google.maps.Marker({map:s,title:t.name,position:t.geometry.location,draggable:!0,clickable:!0})),p[0].addListener("dragend",t=>l(t,e)),t.geometry.viewport?a.union(t.geometry.viewport):a.extend(t.geometry.location),s.fitBounds(a))})};return n.useEffect(()=>{!function(){try{const t=t=>{s(e.onChange,{lat:t.coords.latitude,lng:t.coords.longitude},e.isPlaceRequired)},n=t=>{let n={};var r;n=null!=e&&e.isPTDefault&&(null==e||null===(r=e.PTdefaultcoord)||void 0===r?void 0:r.defaultConfig)||{lat:31.6160638,lng:74.8978579},s(e.onChange,n,e.isPlaceRequired)};(e=>{var t;const n=null===(t=window.globalConfigs)||void 0===t?void 0:t.getConfig("GMAPS_API_KEY");console.log("GMAPS_API_KEY: ",n),new M({apiKey:n,version:"weekly",libraries:["places"]}).load().then(()=>{e&&e()}).catch(e=>{})})(()=>{var r,o,a;null!==(r=e.position)&&void 0!==r&&r.latitude&&null!==(o=e.position)&&void 0!==o&&o.longitude?t({coords:e.position}):null!==(a=navigator)&&void 0!==a&&a.geolocation?navigator.geolocation.getCurrentPosition(t,n):n()}),Promise.resolve()}catch(e){return Promise.reject(e)}}()},[]),r.createElement("div",{className:"map-wrap"},r.createElement("div",{className:"map-search-bar-wrap"},r.createElement(O,{className:"map-search-bar-icon"}),r.createElement("input",{id:"pac-input",className:"map-search-bar",type:"text",placeholder:"Search Address",style:{backgroundPosition:"left",color:"#222",caretColor:"#222"},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}})),r.createElement("div",{id:"map",className:"map"}))};var j="function"==typeof Symbol&&Symbol.for,H=j?Symbol.for("react.element"):60103,U=j?Symbol.for("react.portal"):60106,z=j?Symbol.for("react.fragment"):60107,q=j?Symbol.for("react.strict_mode"):60108,W=j?Symbol.for("react.profiler"):60114,V=j?Symbol.for("react.provider"):60109,G=j?Symbol.for("react.context"):60110,K=j?Symbol.for("react.async_mode"):60111,$=j?Symbol.for("react.concurrent_mode"):60111,Y=j?Symbol.for("react.forward_ref"):60112,X=j?Symbol.for("react.suspense"):60113,Z=j?Symbol.for("react.suspense_list"):60120,J=j?Symbol.for("react.memo"):60115,Q=j?Symbol.for("react.lazy"):60116,ee=j?Symbol.for("react.block"):60121,te=j?Symbol.for("react.fundamental"):60117,ne=j?Symbol.for("react.responder"):60118,re=j?Symbol.for("react.scope"):60119;function oe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case H:switch(e=e.type){case K:case $:case z:case W:case q:case X:return e;default:switch(e=e&&e.$$typeof){case G:case Y:case Q:case J:case V:return e;default:return t}}case U:return t}}}function ae(e){return oe(e)===$}var ie={AsyncMode:K,ConcurrentMode:$,ContextConsumer:G,ContextProvider:V,Element:H,ForwardRef:Y,Fragment:z,Lazy:Q,Memo:J,Portal:U,Profiler:W,StrictMode:q,Suspense:X,isAsyncMode:function(e){return ae(e)||oe(e)===K},isConcurrentMode:ae,isContextConsumer:function(e){return oe(e)===G},isContextProvider:function(e){return oe(e)===V},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===H},isForwardRef:function(e){return oe(e)===Y},isFragment:function(e){return oe(e)===z},isLazy:function(e){return oe(e)===Q},isMemo:function(e){return oe(e)===J},isPortal:function(e){return oe(e)===U},isProfiler:function(e){return oe(e)===W},isStrictMode:function(e){return oe(e)===q},isSuspense:function(e){return oe(e)===X},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===z||e===$||e===W||e===q||e===X||e===Z||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===J||e.$$typeof===V||e.$$typeof===G||e.$$typeof===Y||e.$$typeof===te||e.$$typeof===ne||e.$$typeof===re||e.$$typeof===ee)},typeOf:oe},le=C(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case u:case c:case o:case i:case a:case p:return f;default:var g=f&&f.$$typeof;switch(g){case s:case d:case v:case m:case l:return g;default:return t}}case r:return t}}}var b=c,D=s,A=l,_=n,T=d,C=o,N=v,x=m,w=r,I=i,L=a,k=p,O=!1;function R(e){return S(e)===c}t.AsyncMode=u,t.ConcurrentMode=b,t.ContextConsumer=D,t.ContextProvider=A,t.Element=_,t.ForwardRef=T,t.Fragment=C,t.Lazy=N,t.Memo=x,t.Portal=w,t.Profiler=I,t.StrictMode=L,t.Suspense=k,t.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||S(e)===u},t.isConcurrentMode=R,t.isContextConsumer=function(e){return S(e)===s},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===d},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===v},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===r},t.isProfiler=function(e){return S(e)===i},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===i||e===a||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===s||e.$$typeof===d||e.$$typeof===h||e.$$typeof===y||e.$$typeof===E||e.$$typeof===g)},t.typeOf=S}()}),se=C(function(e){e.exports="production"===process.env.NODE_ENV?ie:le}),ue=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;function pe(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var fe=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=pe(e),a=1;a<arguments.length;a++){for(var i in n=Object(arguments[a]))ce.call(n,i)&&(o[i]=n[i]);if(ue){r=ue(n);for(var l=0;l<r.length;l++)de.call(n,r[l])&&(o[r[l]]=n[r[l]])}}return o},me="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ve=Function.call.bind(Object.prototype.hasOwnProperty),ge=function(){};if("production"!==process.env.NODE_ENV){var he=me,ye={},Ee=ve;ge=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Se(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(Ee(e,a)){var i;try{if("function"!=typeof e[a]){var l=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}i=e[a](t,a,r,n,null,he)}catch(e){i=e}if(!i||i instanceof Error||ge((r||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in ye)){ye[i.message]=!0;var s=o?o():"";ge("Failed "+n+" type: "+i.message+(null!=s?s:""))}}}Se.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ye={})};var be=Se,De=function(){};function Ae(){return null}function _e(){}function Te(){}"production"!==process.env.NODE_ENV&&(De=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Te.resetWarningCache=_e;var Ce=C(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:i(Ae),arrayOf:function(e){return i(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new a("Invalid "+o+" `"+i+"` of type `"+c(l)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<l.length;s++){var u=e(l,s,r,o,i+"["+s+"]",me);if(u instanceof Error)return u}return null})},element:i(function(t,n,r,o,i){var l=t[n];return e(l)?null:new a("Invalid "+o+" `"+i+"` of type `"+c(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,r,o){var i=e[t];return se.isValidElementType(i)?null:new a("Invalid "+r+" `"+o+"` of type `"+c(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,r,o,i){var l;return t[n]instanceof e?null:new a("Invalid "+o+" `"+i+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,r,o){return u(e[t])?null:new a("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],s=c(l);if("object"!==s)return new a("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(ve(l,u)){var d=e(l,u,r,o,i+"."+u,me);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&De(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Ae;function t(t,n,r,i,l){for(var s=t[n],u=0;u<e.length;u++)if(o(s,e[u]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new a("Invalid "+i+" `"+l+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+c+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&De("Invalid argument supplied to oneOfType, expected an instance of array."),Ae;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return De("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),Ae}return i(function(t,n,r,o,i){for(var l=[],s=0;s<e.length;s++){var u=(0,e[s])(t,n,r,o,i,me);if(null==u)return null;u.data&&ve(u.data,"expectedType")&&l.push(u.data.expectedType)}return new a("Invalid "+o+" `"+i+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,r,o,i){var l=t[n],u=c(l);if("object"!==u)return new a("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var p in e){var f=e[p];if("function"!=typeof f)return s(r,o,i,p,d(f));var m=f(l,p,r,o,i+"."+p,me);if(m)return m}return null})},exact:function(e){return i(function(t,n,r,o,i){var l=t[n],u=c(l);if("object"!==u)return new a("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var p=fe({},t[n],e);for(var f in p){var m=e[f];if(ve(e,f)&&"function"!=typeof m)return s(r,o,i,f,d(m));if(!m)return new a("Invalid "+o+" `"+i+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=m(l,f,r,o,i+"."+f,me);if(v)return v}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,r,o,i,l,s){if(o=o||"<<anonymous>>",l=l||r,s!==me){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}return null==n[r]?t?new a(null===n[r]?"The "+i+" `"+l+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+i+" `"+l+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,i,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return i(function(t,n,r,o,i,l){var s=t[n];return c(s)!==e?new a("Invalid "+o+" `"+i+"` of type `"+d(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,r,o){return new a((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,a=r.call(t);if(r!==t.entries){for(;!(o=a.next()).done;)if(!u(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!u(i[1]))return!1}return!0;default:return!1}}function c(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=c(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,r.checkPropTypes=be,r.resetWarningCache=be.resetWarningCache,r.PropTypes=r,r}(se.isElement):function(){function e(e,t,n,r,o,a){if(a!==me){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Te,resetWarningCache:_e};return n.PropTypes=n,n}()});const Ne=["onClick","style","children","className","ReactRef"],xe=e=>{var t;let{onClick:n,style:o,children:i,className:l,ReactRef:s}=e,u=d(e,Ne);const{pathname:p}=a.useLocation(),f=Digit.Hooks.fsm.useRouteSubscription(p),m=null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info;return r.createElement("div",c({className:("employee"===f||"EMPLOYEE"===(null==m?void 0:m.type)?"employeeCard":"card")+" "+(l||""),onClick:n,style:o},u,{ref:s}),i)},we=e=>r.createElement("div",{className:"card-header",style:e.styles?c({},e.styles,{marginBottom:"30px"}):{marginBottom:"30px"}},e.children,e.divider&&r.createElement("hr",{style:{border:"1px solid #DFE0E2",marginTop:"10px"}}));we.propTypes={styles:Ce.object,divider:Ce.bool,children:Ce.node.isRequired},we.defaultProps={styles:{},divider:!1};const Ie=e=>r.createElement("p",{className:"card-text "+(e.disable&&"disabled")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),Le=e=>r.createElement("h2",{className:"card-label-error "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),ke=e=>{let{header:t,cardText:o,nextText:a,t:i,forcedError:l,onSave:s,onChange:u,position:c,onSelect:d,disabled:p,cardBodyStyle:f={},isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:g,handleRemove:h,Webview:y=!1,isPopUp:E=!1}=e;const S=n.useRef(!0);n.useEffect(()=>()=>{S.current=!1},[]);const[b,D]=n.useState(Boolean(p||!1));n.useEffect(()=>{S.current&&D(Boolean(p||!1))},[p]);const[A,_]=n.useState({latitude:0,longitude:0}),[T,C]=n.useState(),[N,x]=n.useState(),w=e=>{S.current&&C(e)},I=e=>{S.current&&_(e)};return r.createElement(xe,{style:{position:"relative"}},r.createElement("div",{style:{display:"flex"}},r.createElement("svg",{style:{marginTop:y?"16px":"8px"},width:"24",height:"24",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M14.9999 9.66666C12.0533 9.66666 9.66658 12.0533 9.66658 15C9.66658 17.9467 12.0533 20.3333 14.9999 20.3333C17.9466 20.3333 20.3333 17.9467 20.3333 15C20.3333 12.0533 17.9466 9.66666 14.9999 9.66666ZM26.9199 13.6667C26.3066 8.10666 21.8933 3.69333 16.3333 3.07999V0.333328H13.6666V3.07999C8.10658 3.69333 3.69325 8.10666 3.07992 13.6667H0.333252V16.3333H3.07992C3.69325 21.8933 8.10658 26.3067 13.6666 26.92V29.6667H16.3333V26.92C21.8933 26.3067 26.3066 21.8933 26.9199 16.3333H29.6666V13.6667H26.9199ZM14.9999 24.3333C9.83992 24.3333 5.66658 20.16 5.66658 15C5.66658 9.83999 9.83992 5.66666 14.9999 5.66666C20.1599 5.66666 24.3333 9.83999 24.3333 15C24.3333 20.16 20.1599 24.3333 14.9999 24.3333Z",fill:"#505A5F"})),r.createElement(we,null,t)),r.createElement("div",{style:f},E&&r.createElement("button",{type:"button",onClick:()=>h&&h(),style:{position:"absolute",left:12,top:12,padding:"8px 10px",background:"#fff",color:"#0b74de",border:"none",borderRadius:6,cursor:"pointer",fontWeight:700,fontSize:13,lineHeight:"16px",zIndex:9999,appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"},"aria-label":"Close",title:"Close"},r.createElement("span",{style:{color:"red",display:"inline-block"}},"Close")),r.createElement(Ie,null,o),r.createElement(F,{onChange:g?(e,t,n)=>{w(e),I(t),(e=>{S.current&&x(e)})(n),S.current&&D(!e)}:(e,t)=>{w(e),I(t),S.current&&D(!e)},position:c,isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:g}),l&&r.createElement(Le,null,i(l))),r.createElement("div",{style:{padding:"12px"}},(()=>{const e=null!=a?a:i?i("ADS_PIN_LOCATION_LABEL"):null,t="string"==typeof e&&e.trim()?e:i&&i("ADS_PIN_LOCATION_LABEL")||"Pick";return r.createElement("button",{type:"button",onClick:e=>{e&&e.preventDefault(),e&&e.stopPropagation(),(()=>{const e={geoLocation:A};if("function"!=typeof d)if("function"!=typeof s)"function"!=typeof u?console.warn("LocationSearchCard: no submit callback provided by parent."):N&&Object.keys(N).length?u(T,A,N):u(T,A);else try{s(A,T,N)}catch(t){try{s(e)}catch(e){console.warn("LocationSearchCard: onSave call failed",e)}}else d("address",e)})()},disabled:b,"aria-disabled":b,style:{display:"inline-block",width:"100%",padding:"10px 12px",background:b?"#ddd":"#0b74de",color:b?"#666":"#fff",border:"none",borderRadius:6,cursor:b?"not-allowed":"pointer",textAlign:"center",fontWeight:700,fontSize:14,lineHeight:"20px",WebkitTextFillColor:b?"#666":"#fff",appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"}},t||"Pick"," ")})()))};ke.propTypes={header:Ce.string,cardText:Ce.string,nextText:Ce.string,t:Ce.func,skipAndContinueText:Ce.string,skip:Ce.func,onSave:Ce.func,onChange:Ce.func,position:Ce.any,onSelect:Ce.func,isPTDefault:Ce.any,PTdefaultcoord:Ce.any,isPlaceRequired:Ce.any,handleRemove:Ce.func,Webview:Ce.bool,isPopUp:Ce.bool},ke.defaultProps={header:"",cardText:"",nextText:"",skipAndContinueText:"",onSelect:null,skip:()=>{},onSave:null,onChange:()=>{},position:void 0,isPTDefault:!1,PTdefaultcoord:{},isPlaceRequired:!1,handleRemove:()=>{},Webview:!1,isPopUp:!1};const Oe=e=>{let{t:n,currentPage:o,columns:a,data:i,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:f,pageSizeLimit:m,sortParams:v,totalRecords:g}=e;return r.createElement(t.Table,{t:n,data:i,currentPage:o,columns:a,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:m,disableSort:s,isPaginationRequired:f,onPageSizeChange:p,onSort:u,sortParams:v,totalRecords:g})},Re=e=>{let{onSubmit:a,setExistingDataSet:i,Searchdata:l}=e;const{t:s}=o.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,p]=n.useState(null),[f,m]=n.useState(!1),v=Digit.UserService.getUser().info,g=Digit.Hooks.ads.useADSSlotSearch(),h={advertisementSlotSearchCriteria:l.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};n.useEffect(()=>{f&&(a(),m(!1))},[f,a]);let y,E=window.location.href.split("/").pop();isNaN(parseInt(E))||(y=E);let S=isNaN(parseInt(E))?{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:u,mobileNumber:null==v?void 0:v.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:y,tenantId:u};n.useEffect(()=>{p(S)},[E]);const{isLoading:b,data:D}=Digit.Hooks.ads.useADSSearch({filters:d});if(b)return r.createElement(t.Loader,null);const A=(null==D?void 0:D.bookingApplication)||[],_={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},T={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("div",null,A.length>0&&A.map((e,n)=>{var o;return r.createElement("div",{key:n},r.createElement(t.Card,{style:c({},_,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=T.backgroundColor,e.currentTarget.style.boxShadow=T.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{!function(e){try{Promise.resolve(g.mutateAsync(h)).then(function(t){var n,r,o,a,l,s,u,c,d,p,f;const v=null==t?void 0:t.advertisementSlotAvailabiltityDetails[0].timerValue,g={documents:{documents:null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>({documentDetailId:null==e?void 0:e.documentDetailId,documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.fileStoreId}))},address:{pincode:null==e||null===(r=e.address)||void 0===r?void 0:r.pincode,houseNo:null==e||null===(o=e.address)||void 0===o?void 0:o.houseNo,streetName:null==e||null===(a=e.address)||void 0===a?void 0:a.streetName,landmark:null==e||null===(l=e.address)||void 0===l?void 0:l.landmark,addressline1:null==e||null===(s=e.address)||void 0===s?void 0:s.addressLine1,addressline2:null==e||null===(u=e.address)||void 0===u?void 0:u.addressLine2},applicant:{applicantName:null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.applicantMobileNo,alternateNumber:null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.applicantAlternateMobileNo,emailId:null==e||null===(f=e.applicantDetail)||void 0===f?void 0:f.applicantEmailId},timervalue:{timervalue:v||0},draftId:(null==t?void 0:t.draftId)||""};i(g),m(!0)})}catch(e){return Promise.reject(e)}}(e)}},r.createElement(t.KeyNote,{keyValue:s("ADS_BOOKING_NO"),note:null==e?void 0:e.bookingNo}),r.createElement(t.KeyNote,{keyValue:s("ADS_APPLICANT_NAME"),note:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName}),r.createElement(t.KeyNote,{keyValue:s("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:s(""+(null==e?void 0:e.bookingStatus))})))}),0===A.length&&!b&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},s("ADS_NO_APPLICATION_FOUND_MSG"))))},Pe=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),Me=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(Pe,null)),Be=e=>{let{t:o,closeModal:a,onSubmit:i,setExistingDataSet:l,Searchdata:s}=e;const[u,c]=n.useState(!1),[d,p]=n.useState(!1),f=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),m=e=>u&&r.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),v=Digit.Hooks.ads.useADSSlotSearch(),g={advertisementSlotSearchCriteria:s.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:f,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{d&&(i(),p(!1))},[d,i]),r.createElement(r.Fragment,null,r.createElement(t.Modal,{headerBarMain:r.createElement(m,{t:o}),headerBarEnd:r.createElement(Me,{onClick:a}),actionCancelLabel:u&&o("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},u&&r.createElement(Re,{onSubmit:i,setExistingDataSet:l,Searchdata:s}),r.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&r.createElement(t.SubmitBar,{label:o("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!u&&r.createElement(t.SubmitBar,{label:o("FILL_NEW_DETAILS"),onSubmit:function(){try{return Promise.resolve(v.mutateAsync(g)).then(function(e){l({timervalue:{timervalue:(null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue)||10},draftId:(null==e?void 0:e.draftId)||""}),p(!0)})}catch(e){return Promise.reject(e)}}})))))},Fe=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),je=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(Fe,null)),He=e=>{let{onClose:n,cartDetails:i,setCartDetails:l}=e;const{t:s}=o.useTranslation(),u=(a.useLocation(),[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},s("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:s("ADD_TYPE"),accessor:"addType"},{Header:s("FACE_AREA"),accessor:"faceArea"},{Header:s("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,s(t?"Yes":"No"))}},{Header:s("BOOKING_DATE"),accessor:"bookingDate"},{Header:s("UNIT_PRICE"),accessor:"price"},{Header:s("ADS_STATUS"),accessor:"status",Cell:e=>{let{value:t}=e;return r.createElement("div",{className:"sla-cell-success"},t)}},{Header:s("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{const t=i.filter((t,n)=>n!==e);l(t)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}]);return r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(je,{onClick:n}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Oe,{t:s,data:i,columns:u,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:i.length}),r.createElement("div",{style:{position:"sticky",bottom:0,backgroundColor:"#fff",padding:"15px 20px",fontSize:"18px",fontWeight:"bold",boxShadow:"0 -2px 5px rgba(0,0,0,0.1)",zIndex:10}},"Total Price: ",i.reduce((e,t)=>e+Number(t.price),0)))},Ue=e=>{let{styles:t,className:n}=e;return r.createElement("svg",{width:"24",height:"24",className:n,style:c({},t),viewBox:"0 0 24 24",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M7 10H4V17H7V10Z"}),r.createElement("path",{d:"M13.5 10H10.5V17H13.5V10Z"}),r.createElement("path",{d:"M22 19H2V22H22V19Z"}),r.createElement("path",{d:"M20 10H17V17H20V10Z"}),r.createElement("path",{d:"M12 1L2 6V8H22V6L12 1Z"}))},ze=e=>{let{headComment:t,otherComment:n}=e;return r.createElement("div",{className:"checkpoint-comments-wrap"},r.createElement("h4",null,t),r.createElement("p",null,n))},qe=e=>{var n,a,i;let{data:l,OpenImage:s}=e;const{t:u}=o.useTranslation();return r.createElement("div",null,l.date&&r.createElement("p",null,l.date),r.createElement("p",null,l.name),l.mobileNumber&&r.createElement(t.TelePhone,{mobile:l.mobileNumber}),l.source&&r.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+l.source.toUpperCase())),l.comment&&r.createElement(ze,{otherComment:null==l?void 0:l.otherComment,headComment:null==l?void 0:l.comment}),null!=l&&l.wfComment?r.createElement("div",null,null==l||null===(n=l.wfComment)||void 0===n?void 0:n.map(e=>r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("WF_COMMON_COMMENTS")),r.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==l||null===(a=l.thumbnailsToShow)||void 0===a||null===(i=a.thumbs)||void 0===i?void 0:i.length)>0?r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),r.createElement(t.DisplayPhotos,{srcs:null==l?void 0:l.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==l?void 0:l.thumbnailsToShow)}})):null)};"undefined"!=typeof window&&void 0===window.process&&(window.process={env:{}});const We=e=>{var o,a;let{t:i,onSelect:l,formData:s={},handleRemove:u,onSave:c}=e;const[d,p]=n.useState((null==s||null===(o=s.address)||void 0===o?void 0:o.pincode)||""),[f,m]=n.useState((null==s||null===(a=s.address)||void 0===a?void 0:a.geoLocation)||{}),v=Digit.Hooks.obps.useTenants(),[g,h]=n.useState(null),[y,E]=n.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return r.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0",zIndex:9999},onClick:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onMouseDown:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onKeyDown:e=>{!e||"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation())}},r.createElement("div",{style:{position:"relative",marginTop:"60px"}},r.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},r.createElement(t.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:i?i("ADS_GIS_LABEL"):"Pick location",nextText:i&&i("ADS_PIN_LOCATION_LABEL")||"Pick location",skip:()=>{if("function"==typeof l)try{return l()}catch(e){return void console.warn("GIS: onSelect threw",e)}if("function"==typeof c)try{return c(f||{},d||"",y||"")}catch(e){try{return c({geoLocation:f||{},pincode:d||"",placeName:y||""})}catch(e){console.warn("GIS: onSave also failed",e)}}console.warn("GIS: neither onSelect nor onSave provided for skip")},t:i,position:f,onSave:()=>{if("function"==typeof c)try{c(f,d,y)}catch(e){try{c({geoLocation:f,pincode:d,placeName:y})}catch(e){console.warn("GIS: onSave call failed",e)}}else console.warn("GIS: onSave not provided")},onChange:(e,t,n)=>{((e,t,n)=>{h(null),(null==v?void 0:v.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==e)}))?(p(e),m(t),E(n)):(h("BPA_COMMON_PINCODE_NOT_SERVICABLE"),p(""),m({}),E(""))})(e,t,n)},disabled:!1,forcedError:g?i(g):null,isPlaceRequired:!0,handleRemove:u,Webview:S,isPopUp:!0}))))},Ve=e=>{var n,a,i,l,s,u,c,d;const{t:p}=o.useTranslation(),f=null==e||null===(n=e.application)||void 0===n||null===(a=n.workflow)||void 0===a?void 0:a.businessService,{isLoading:m,data:v}=Digit.Hooks.useWorkflowDetails({tenantId:null===(i=e.application)||void 0===i?void 0:i.tenantId,id:e.id||(null===(l=e.application)||void 0===l?void 0:l.applicationNumber)||(null===(s=e.application)||void 0===s?void 0:s.bookingNo),moduleCode:"advandhoarding-services"});function g(e,t,n){var r;window.open(null==n||null===(r=n.fullImage)||void 0===r?void 0:r[0],"_blank")}const h=t=>{if("OPEN"===t.state){var n,o;const a={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(o=e.application)||void 0===o?void 0:o.channel)||""};return r.createElement(qe,{data:a})}if(t.state){var a,i,l,s,u;const e={date:null==t||null===(a=t.auditDetails)||void 0===a?void 0:a.lastModified,name:null==t||null===(i=t.assignes)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.name,mobileNumber:null==t||null===(s=t.assignes)||void 0===s||null===(u=s[0])||void 0===u?void 0:u.mobileNumber,comment:p(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return r.createElement(qe,{data:e,OpenImage:g})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:p(null==t?void 0:t.comment)};return r.createElement(qe,{data:n})}};return m?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,(null==v||null===(u=v.timeline)||void 0===u?void 0:u.length)>0&&r.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=v&&v.timeline&&1===(null==v||null===(c=v.timeline)||void 0===c?void 0:c.length)?r.createElement(t.CheckPoint,{isCompleted:!0,label:p((null==v||null===(d=v.timeline[0])||void 0===d?void 0:d.state)&&"WF_"+f+"_"+v.timeline[0].state||"NA"),customChild:h(null==v?void 0:v.timeline[0])}):r.createElement(t.ConnectingCheckPoints,null,(null==v?void 0:v.timeline)&&(null==v?void 0:v.timeline.map((e,n)=>{var o;let a="";if(window.location.href.includes("/obps/")){var i,l;const t=null==v||null===(i=v.timeline)||void 0===i||null===(l=i[n-1])||void 0===l?void 0:l.state;a=t&&(t.includes("BACK_FROM")||t.includes("SEND_TO_CITIZEN"))?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===n?"":"_DONE"}return r.createElement(r.Fragment,{key:n},r.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:p("ES_ADS_COMMON_STATUS_"+(null==v||null===(o=v.processInstances[n].state)||void 0===o?void 0:o.state)+a),customChild:h(e)}))}))))};let Ge=[];const Ke=e=>{let{currentStep:n=1,flow:a=""}=e;const{t:i}=o.useTranslation(),l=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":Ge=[];break;default:Ge=["ADS_APPLICANT_DETAILS","ADS_ADDRESS_DETAILS","ADS_UPLOAD_DOCUMENTS","ADS_SUMMARY"]}})(a),r.createElement("div",{className:"timeline-container",style:l?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},Ge.map((e,o,a)=>r.createElement("div",{className:"timeline-checkpoint",key:o},r.createElement("div",{className:"timeline-content"},r.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?r.createElement(t.TickMark,null):o+1),r.createElement("span",{className:"secondary-color"},i(e))),o<a.length-1&&r.createElement("span",{className:"line "+(o<n-1&&"active")}))))},$e=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),Ye=e=>{let{onClick:t}=e;return r.createElement("div",{className:"icon-bg-secondary",onClick:t},r.createElement($e,null))},Xe=()=>{var e,a,i,l,s,u,d,p,f,m,v,g,h,y,E;const[S,b]=n.useState(!1),[D,A]=n.useState(!1),{t:_}=o.useTranslation(),[T,C]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),N=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[x,w]=n.useState(!1),[I,L]=n.useState(!1),k=[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},_("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:_("ADD_TYPE"),accessor:"addType"},{Header:_("FACE_AREA"),accessor:"faceArea"},{Header:_("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,_(t?"Yes":"No"))}},{Header:_("BOOKING_DATE"),accessor:"bookingDate"},{Header:_("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{var t;const n=c({},T);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),C(n)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}];let O={tenantId:N,cartDetails:null==T||null===(e=T.adslist)||void 0===e?void 0:e.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}))},R=Digit.Hooks.ads.useADSDemandEstimation();!1===x&&(R.mutate(O),w(!0));const P=()=>{A(e=>!e)},M=()=>{L(!I)},B=()=>{b(e=>!e)},F=(null===(a=R.data)||void 0===a?void 0:a.demands[0])&&(null===(i=R.data)||void 0===i||null===(l=i.demands[0])||void 0===l?void 0:l.additionalDetails);return r.createElement("div",null,r.createElement(t.CardSubHeader,{style:{color:"#a82227"}},"Cart Details"),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement("div",null,r.createElement("div",{onClick:P,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},r.createElement("div",{class:"container",style:{width:"1px"}}," ",r.createElement("div",{style:{width:"20px",position:"relative"}},r.createElement("div",{style:{position:"absolute",top:"-4px",right:"-93px",color:"#008000",padding:"5px",borderRadius:"30px",width:"30px",height:"30px",textAlign:"center"}},r.createElement("div",null," ",null==T||null===(s=T.adslist)||void 0===s?void 0:s.cartDetails.length)))),"View Cart"),r.createElement("div",{onClick:B,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},"Terms and Conditions")),r.createElement("div",{onClick:M,style:{cursor:"pointer",fontSize:"20px",color:"#a82227"}},"Total Booking Amount: ",r.createElement("strong",null,F," INR"))),S&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Terms and Conditions"),headerBarEnd:r.createElement(Ye,{onClick:B}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"80%",overflowY:"auto"},actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},popupModuleMianStyles:{padding:"10px"},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:S,onClose:B}),D&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(Ye,{onClick:P}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Oe,{t:_,data:null==T||null===(u=T.adslist)||void 0===u?void 0:u.cartDetails,columns:k,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:null==T||null===(d=T.adslist)||void 0===d?void 0:d.cartDetails.length})),I&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:r.createElement(Ye,{onClick:M}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"60%",overflowY:"auto"},children:r.createElement("div",null,r.createElement(t.CardLabelDesc,{style:{marginBottom:"15px"}},"Estimate Price Details"),r.createElement("ul",null,(null===(p=R.data)||void 0===p||null===(f=p.demands[0])||void 0===f?void 0:f.demandDetails)&&(null===(m=R.data)||void 0===m||null===(v=m.demands[0])||void 0===v?void 0:v.demandDetails.map((e,n)=>r.createElement("li",{key:n,style:{display:"flex",justifyContent:"space-between"}},r.createElement(t.CardText,null,_(""+e.taxHeadMasterCode)),r.createElement(t.CardText,null,"Rs ",e.taxAmount))))),r.createElement("hr",null),r.createElement("div",{style:{fontWeight:"bold",marginTop:"10px",display:"flex",justifyContent:"space-between"}},r.createElement(t.CardLabelDesc,null,"Total"),r.createElement(t.CardLabelDesc,null,"Rs ",(null===(g=R.data)||void 0===g||null===(h=g.demands[0])||void 0===h?void 0:h.demandDetails)&&(j=null===(y=R.data)||void 0===y||null===(E=y.demands[0])||void 0===E?void 0:E.demandDetails,j.reduce((e,t)=>e+t.taxAmount,0))))),actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:I,onClose:M}));var j};function Ze(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Je=e=>{let{t:o,SlotSearchData:a,draftId:i=""}=e;const[l,s]=n.useState(0),[u,c]=n.useState(null),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState(!1),m=Digit.Hooks.ads.useADSSlotSearch(),v={advertisementSlotSearchCriteria:a.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,draftId:i,isTimerRequired:!0}))};return n.useEffect(()=>{0!==l||p||(function(){try{const e=Ze(function(){return Promise.resolve(m.mutateAsync(v)).then(function(e){var t;const n=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),r=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;n?c({error:!0,label:o("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):s(r||0)})},function(){c({error:!0,label:o("CS_SOMETHING_WENT_WRONG")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),f(!0))},[o,l,p]),n.useEffect(()=>{if(l>0){const e=setInterval(()=>{s(t=>t<=0?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}},[l]),n.useEffect(()=>{if(u){const e=setTimeout(()=>{c(null)},2e3);return()=>clearTimeout(e)}},[u]),r.createElement("div",null,r.createElement("span",{className:"astericColor"},(e=>{const t=e%60;return Math.floor(e/60)+":"+(t<10?"0":"")+t})(l)),u&&r.createElement(t.Toast,{error:u.error,warning:u.warning,label:o(u.label),onClose:()=>{c(null)}}))},Qe=e=>{var o;let a,{t:i,value:l={},onChange:s=(()=>{}),onBlur:u=(()=>{})}=e;a="CITIZEN"===(null===(o=JSON.parse(window.localStorage.getItem("user-info")))||void 0===o?void 0:o.type)?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentPermanentCity();const[d,p]=n.useState((null==l?void 0:l.addressId)||""),[f,m]=n.useState((null==l?void 0:l.doorNo)||""),[v,g]=n.useState((null==l?void 0:l.houseNo)||""),[h,y]=n.useState((null==l?void 0:l.houseName)||""),[E,S]=n.useState((null==l?void 0:l.streetName)||""),[b,D]=n.useState((null==l?void 0:l.addressline1)||""),[A,_]=n.useState((null==l?void 0:l.addressline2)||""),[T,C]=n.useState((null==l?void 0:l.landmark)||""),[N,x]=n.useState((null==l?void 0:l.pincode)||""),[w,I]=n.useState((null==l?void 0:l.city)||""),[L,k]=n.useState((null==l?void 0:l.locality)||""),[O,R]=n.useState({});n.useEffect(()=>{p((null==l?void 0:l.addressId)||""),m((null==l?void 0:l.doorNo)||""),g((null==l?void 0:l.houseNo)||""),y((null==l?void 0:l.houseName)||""),S((null==l?void 0:l.streetName)||""),D((null==l?void 0:l.addressline1)||""),_((null==l?void 0:l.addressline2)||""),C((null==l?void 0:l.landmark)||""),x((null==l?void 0:l.pincode)||""),I((null==l?void 0:l.city)||""),k((null==l?void 0:l.locality)||"")},[l]),n.useEffect(()=>{null!=l&&l.city&&I(l.city)},[l]);const P=n.useRef(s);n.useEffect(()=>{P.current=s},[s]);const M=n.useRef(u);n.useEffect(()=>{M.current=u},[u]);const B=function(e){var t,n,r,o,a;void 0===e&&(e={});const i=null!=(t=null!=(n=e.city)?n:w)?t:(null==l?void 0:l.city)||"",s=null!=(r=null!=(o=e.locality)?o:L)?r:(null==l?void 0:l.locality)||"",u=c({addressId:d,doorNo:f,houseNo:v,houseName:h,streetName:E,addressline1:b,addressline2:A,landmark:T,pincode:N,city:i,cityCode:"object"==typeof i?i.code||i.city&&i.city.code||"":i||"",locality:s,localityCode:"object"==typeof s?s.code||s:s||""},e);null===(a=P.current)||void 0===a||a.call(P,u)},F=(e,t)=>{const n=["doorNo","addressId","addressline2"],r=(null==t?void 0:t.trim())||"";n.includes(e)||t&&""!==r?"city"===e||"locality"===e?!/^[a-zA-Z\s]{2,}$/.test(r)||r.length<2?R(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 letters and can only contain letters and spaces"})):R(t=>c({},t,{[e]:""})):n.includes(e)?R(t=>c({},t,{[e]:""})):R(r.length<2?t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 characters"}):t=>c({},t,{[e]:""})):R(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" is required"}))};return r.createElement("div",null,r.createElement(t.CardLabel,null,i?i("ADS_ADDRESS_ID"):"Address ID"),r.createElement(t.TextInput,{value:d,onChange:e=>{const t=e.target.value.trim();p(t),B({addressId:t}),F("addressId",t)},onBlur:()=>M.current&&M.current()}),O.addressId&&r.createElement("div",{style:{color:"red"}},O.addressId),r.createElement(t.CardLabel,null,i?i("ADS_DOOR_NO"):"Door No"),r.createElement(t.TextInput,{value:f,onChange:e=>{const t=e.target.value.trim();m(t),B({doorNo:t}),F("doorNo",t)},onBlur:()=>M.current&&M.current()}),O.doorNo&&r.createElement("div",{style:{color:"red"}},O.doorNo),r.createElement(t.CardLabel,null,i?i("ADS_HOUSE_NO"):"House No"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:v,onChange:e=>{const t=e.target.value.trim();g(t),B({houseNo:t}),F("houseNo",t)},onBlur:()=>M.current&&M.current()}),O.houseNo&&r.createElement("div",{style:{color:"red"}},O.houseNo),r.createElement(t.CardLabel,null,i?i("ADS_HOUSE_NAME"):"House Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:h,onChange:e=>{const t=e.target.value.trim();y(t),B({houseName:t}),F("houseName",t)},onBlur:()=>M.current&&M.current()}),O.houseName&&r.createElement("div",{style:{color:"red"}},O.houseName),r.createElement(t.CardLabel,null,i?i("ADS_STREET_NAME"):"Street Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:E,onChange:e=>{const t=e.target.value.trim();S(t),B({streetName:t}),F("streetName",t)},onBlur:()=>M.current&&M.current()}),O.streetName&&r.createElement("div",{style:{color:"red"}},O.streetName),r.createElement(t.CardLabel,null,i?i("ADS_ADDRESS_LINE1"):"Address Line 1"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:b,onChange:e=>{const t=e.target.value.trim();D(t),B({addressline1:t}),F("addressline1",t)},onBlur:()=>M.current&&M.current()}),O.addressline1&&r.createElement("div",{style:{color:"red"}},O.addressline1),r.createElement(t.CardLabel,null,i?i("ADS_ADDRESS_LINE2"):"Address Line 2"),r.createElement(t.TextInput,{value:A,onChange:e=>{const t=e.target.value.trim();_(t),B({addressline2:t}),F("addressline2",t)},onBlur:()=>M.current&&M.current()}),O.addressline2&&r.createElement("div",{style:{color:"red"}},O.addressline2),r.createElement(t.CardLabel,null,i?i("ADS_LANDMARK"):"Landmark"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextArea,{value:T,onChange:e=>{const t=e.target.value.trim();C(t),B({landmark:t}),F("landmark",t)},onBlur:()=>M.current&&M.current(),style:{width:"50%"}}),O.landmark&&r.createElement("div",{style:{color:"red"}},O.landmark),r.createElement(t.CardLabel,null,i?i("ADS_CITY"):"City"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:w,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"").trim();I(t),B({city:t}),F("city",t)},onBlur:()=>M.current&&M.current()}),O.city&&r.createElement("div",{style:{color:"red"}},O.city),r.createElement(t.CardLabel,null,i?i("ADS_LOCALITY"):"Locality"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:L,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"").trim();k(t),B({locality:t}),F("locality",t)},onBlur:()=>M.current&&M.current()}),O.locality&&r.createElement("div",{style:{color:"red"}},O.locality),r.createElement(t.CardLabel,null,i?i("ADS_ADDRESS_PINCODE"):"Pincode"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:N,onChange:e=>{const t=String(e.target.value||"").replace(/\D/g,"").slice(0,6);x(t),B({pincode:t}),R(t?e=>c({},e,{pincode:""}):e=>c({},e,{pincode:"Pincode is required"}))},maxLength:6}),O.pincode&&r.createElement("div",{style:{color:"red"}},O.pincode))};function et(e){var o;let{t:a,document:i,setDocuments:l,setError:s,documents:u,action:d,formData:p,id:f}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],v=Digit.UserService.getUser().info,[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(m?c({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:"ADS_"+(null==m?void 0:m.documentType.replaceAll(".","_"))}):(null==i||null===(o=i.dropdownData)||void 0===o?void 0:o.length)>0?null==i?void 0:i.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[D,A]=n.useState(!1),{dropdownData:_}=i;var T=_;const[C,N]=n.useState(!1),x=()=>r.createElement("div",{className:"loading-spinner"});return n.useEffect(()=>{null!=g&&g.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==S?void 0:S.length)||null===S?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==g?void 0:g.code,fileStoreId:S,documentUid:S}]})},[S,g]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==i?void 0:i.code))[0],r=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(h(r),b(null==n?void 0:n.fileStoreId)):N(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)s(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Ze(function(){return b(null),A(!0),Promise.resolve(Digit.UploadServices.Filestorage("ADS",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(a("CS_FILE_UPLOAD_ERROR"))})},function(){s(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(A(!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]),n.useEffect(()=>{C&&b(null)},[C]),r.createElement("div",{style:{marginBottom:"24px"}},null!=i&&i.hasDropdown?r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},a("ADS_"+(null==i?void 0:i.code.replaceAll(".","_")))," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"EMPLOYEE"===v.type?"50%":"100%"},placeholder:"Select "+a("ADS_"+(null==i?void 0:i.code.replaceAll(".","_"))),option:T.map(e=>{var t;return c({},e,{i18nKey:"ADS_"+(null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_"))})}),select:e=>h(e),optionKey:"i18nKey",t:a})):null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{b(null)},id:f,message:D?r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(x,null),r.createElement("span",null,"Uploading...")):S?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function tt(e){let{value:n={},Code:a,index:i,showFileName:l=!1}=e;o.useTranslation();const{isLoading:s,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},a,i),d=e=>{let{width:t=20,height:n=20,style:o}=e;return r.createElement("svg",{style:o,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},r.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))},p=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===a).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===a).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")}));return s?r.createElement(t.Loader,null):r.createElement("div",null,r.createElement(r.Fragment,null,r.createElement("div",null,p.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let r=e[t]||"",o=(null==r?void 0:r.split(","))||[],a="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(a=e)}),a}(u.pdfFiles,e.fileStoreId);return r.createElement("a",{target:"_",href:n,style:{minWidth:"160px"},key:t},r.createElement(d,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}))}))))}const nt=e=>{let{jumpTo:n}=e;const{t:i}=o.useTranslation(),l=a.useHistory();return r.createElement(t.LinkButton,{label:i("CS_COMMON_EDIT"),className:"check-page-link-button",onClick:function(){l.push(n)}})},rt=()=>{const{t:e}=o.useTranslation(),{data:a,isFetching:i,isSuccess:l}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"ADS",filters:{limit:10,offset:0,services:["ads"]},config:{select:e=>({tSotalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptAccess()}});n.useEffect(()=>{!i&&l&&u(a)},[i]);const[s,u]=n.useState("-");if(!Digit.Utils.adsAccess())return null;const c=[{label:e("ADS_BOOK"),link:"/digit-ui/employee/ads/bookad/searchads"},{label:e("ADS_SEARCH_BOOKINGS"),link:"/digit-ui/employee/ads/my-applications"}],d=Digit.UserService.hasAccess(["ADS_CEMP"])||!1,p={Icon:r.createElement(Ue,null),moduleName:e("ADS_ADVERTISEMENT_MODULE"),links:c.filter(e=>!(null!=e&&e.role)||d)};return r.createElement(t.EmployeeModuleCard,p)},ot=e=>{let{value:o,onChange:a,onBlur:i,t:l}=e;const[s,u]=n.useState(!1),[c,d]=n.useState("");return n.useEffect(()=>{d(o?"string"==typeof o?o:o.formattedAddress||(o.latitude&&o.longitude?o.latitude+", "+o.longitude:""):"")},[o]),r.createElement(n.Fragment,null,r.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},r.createElement(t.TextInput,{value:c,onChange:()=>{},onBlur:i,disabled:!0,placeholder:l?l("See location on map"):"See location on map"}),r.createElement("div",null,r.createElement("button",{type:"button",onClick:()=>u(!0),style:{padding:"8px 10px",background:"#0b74de",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:700,fontSize:13,lineHeight:"18px",textAlign:"center",appearance:"none",WebkitAppearance:"none",backgroundImage:"none"}},r.createElement("span",{style:{display:"inline-block",color:"#fff",textTransform:"none"}},l&&(l("VIEW_LOCATION_ON_MAP")||"View location on map")||"View location on map")))),s&&r.createElement(We,{t:l,formData:{address:{pincode:(null==o?void 0:o.pincode)||"",geoLocation:o||{}}},handleRemove:()=>u(!1),onSave:(e,t,n)=>((e,t,n)=>{const r=((e,t,n)=>{var r,o,a,i,l,s;return{formattedAddress:n||(null==e?void 0:e.formattedAddress)||(null==e?void 0:e.place_name)||"",latitude:null!=(r=null!=(o=null!=(a=null==e?void 0:e.latitude)?a:null==e?void 0:e.lat)?o:null==e?void 0:e.y)?r:null,longitude:null!=(i=null!=(l=null!=(s=null==e?void 0:e.longitude)?s:null==e?void 0:e.lng)?l:null==e?void 0:e.x)?i:null,placeId:(null==e?void 0:e.placeId)||(null==e?void 0:e.id)||null,raw:e||{},pincode:t||null}})(e,t,n);d(r.formattedAddress),a&&a(r),u(!1)})(e,t,n)}))},at=e=>{let{t:n,currentPage:o,columns:a,data:i,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:f,sortParams:m,totalRecords:v}=e;return r.createElement(t.Table,{t:n,data:i,currentPage:o,columns:a,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:s,onPageSizeChange:p,onSort:u,sortParams:m,totalRecords:v})},it=e=>{const{t:i}=o.useTranslation(),l=[{text:i("ES_TITLE_NEW_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad",roles:[]},{text:i("ADS_MY_APPLICATION"),link:"/digit-ui/employee/ads/my-applications",roles:[]}],[s,u]=n.useState([]);return Digit.UserService.getUser(),n.useEffect(()=>{u(l)},[]),r.createElement(t.Card,{className:"employeeCard filter inboxLinks"},r.createElement("div",{className:"complaint-links-container"},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.PropertyHouse,null))," ",r.createElement("span",{className:"text"},i("ADS_SERVICE"))),r.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:o,hyperlink:l=!1,roles:s=[]}=e;return r.createElement("span",{className:"link",key:t},l?r.createElement("a",{href:n},o):r.createElement(a.Link,{to:n},i(o)))}))))},lt=["pattern","name","maxLength","minLength","errorMessages"],st={date:t.DatePicker,mobileNumber:t.MobileNumber,Locality:e=>r.createElement(t.Localities,{tenantId:Digit.ULBService.getCurrentTenantId(),selectLocality:e.onChange,keepNull:!1,boundaryType:"revenue",selected:e.value,disableLoader:!0,sortFn:(e,t)=>e.i18nkey<t.i18nkey?-1:1})},ut=e=>{var a;let{onSearch:l,type:s,onClose:u,searchFields:p,searchParams:f,isInboxPage:m,clearSearch:v}=e;const{t:g}=o.useTranslation(),{handleSubmit:h,reset:y,watch:E,control:S,setError:b,clearErrors:D,formState:A,setValue:_}=i.useForm({defaultValues:m?f:c({locality:null,city:null},f)}),T=E(),C=innerWidth<=640;function N(){const e=p.reduce((e,t)=>c({},e,{[null==t?void 0:t.name]:""}),{});if(y(e),m){const e=c({},f);e.delete=[],p.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),l(c({},e))}else v()}n.useEffect(()=>{p.forEach(e=>{let{pattern:t,name:n,maxLength:r,minLength:o,errorMessages:a}=e;d(e,lt);const i=T[n],l=A.errors[n];t&&(new RegExp(t).test(i)||l?new RegExp(t).test(i)&&"pattern"===(null==l?void 0:l.type)&&D([n]):b(n,{type:"pattern",message:g(null==a?void 0:a.pattern)||g("PATTERN_"+n.toUpperCase()+"_FAILED")})),o&&((null==i?void 0:i.length)<o&&!l?b(n,{type:"minLength",message:g((null==a?void 0:a.minLength)||"MINLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==i?void 0:i.length)>=o&&"minLength"===(null==l?void 0:l.type)&&D([n])),r&&((null==i?void 0:i.length)>r&&!l?b(n,{type:"maxLength",message:g((null==a?void 0:a.maxLength)||"MAXLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==i?void 0:i.length)<=r&&"maxLength"===(null==l?void 0:l.type)&&D([n]))})},[T,A,b,D]);const x=e=>r.createElement(t.LinkLabel,{style:c({display:"inline"},e?{margin:0}:{}),onClick:N},g("ES_COMMON_CLEAR_SEARCH"));return r.createElement("form",{onSubmit:h(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],p.forEach(t=>{e[t.name]||e.delete.push(t.name)}),l(e),"mobile"===s&&u()})},r.createElement(r.Fragment,null,r.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:m?"24px":"revert"}},r.createElement("div",{className:"search-complaint-container"},("mobile"===s||C)&&r.createElement("div",{className:"complaint-header"},r.createElement("h2",null,g("ES_COMMON_SEARCH_BY")),r.createElement("span",{onClick:u},r.createElement(t.CloseSvg,null))),r.createElement("div",{className:"complaint-input-container for-pt "+(m?"":"for-search"),style:{width:"100%",display:"grid"}},null==p||null===(a=p.filter(e=>!0))||void 0===a?void 0:a.map((e,n)=>{var o,a,l;return r.createElement("div",{key:e.name,className:"input-fields"},r.createElement("span",{className:"mobile-input"},r.createElement(t.Label,null,g(e.label)+" "+(e.isMendatory?"*":"")),r.createElement(i.Controller,e.type?{render:t=>r.createElement(null==st?void 0:st[e.type],{formValue:T,setValue:_,onChange:t.onChange,value:t.value}),name:e.name,control:S,defaultValue:""}:{render:e=>r.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:S,defaultValue:""})),null!=A&&null!==(o=A.dirtyFields)&&void 0!==o&&o[e.name]?r.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==A||null===(a=A.errors)||void 0===a||null===(l=a[e.name])||void 0===l?void 0:l.message):null)}),m&&r.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},r.createElement("div",null,x())),"desktop"===s&&!C&&r.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},r.createElement(t.SubmitBar,{className:"submit-bar-search",label:g("ES_COMMON_SEARCH"),disabled:!!Object.keys(A.errors).length||(()=>{var e;let t=!0;return Object.keys(T).forEach(e=>{!["locality","city"].includes(e)&&T[e]&&(t=!1)}),null==p||!p.find(e=>"locality"===e.name)||null!=T&&null!==(e=T.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!m&&r.createElement("div",null,x()))))),("mobile"===s||C)&&r.createElement(t.ActionBar,{className:"clear-search-container"},r.createElement("button",{className:"clear-search",style:{flex:1}},x(C)),r.createElement(t.SubmitBar,{disabled:!!Object.keys(A.errors).length,label:g("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},ct=["tableConfig","filterComponent"],dt=e=>{let{tableConfig:a,filterComponent:i}=e,l=d(e,ct);const{data:s,useNewInboxAPI:u}=l,{t:c}=o.useTranslation(),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(i)}),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(l.EmptyResultInboxComp)});console.log("props :>> ",l);const[g,h]=n.useState(!1),y=r.useMemo(()=>l.isSearch?a.searchColumns(l):a.inboxColumns(l)||[],[]);let E;return console.log("data is :>> ",s),l.isLoading?E=r.createElement(t.Loader,null):g?E=null:!s||0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?E=m&&r.createElement(m,{data:s})||(0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?r.createElement(t.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):r.createElement(t.Loader,null)):(null==s?void 0:s.length)>0&&(E=r.createElement(at,{t:c,data:s,columns:y,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:l.onPageSizeChange,currentPage:l.currentPage,onNextPage:l.onNextPage,onPrevPage:l.onPrevPage,pageSizeLimit:l.pageSizeLimit,onSort:l.onSort,disableSort:l.disableSort,sortParams:l.sortParams,totalRecords:l.totalRecords})),r.createElement("div",{className:"inbox-container"},!l.isSearch&&r.createElement("div",{className:"filters-container"},r.createElement(it,{parentRoute:l.parentRoute,businessService:l.moduleCode}),r.createElement("div",null,r.createElement(p,{defaultSearchParams:l.defaultSearchParams,onFilterChange:l.onFilterChange,searchParams:l.searchParams,type:"desktop",useNewInboxAPI:u,statusMap:u?null==s?void 0:s[0].statusMap:null,moduleCode:l.moduleCode}))),r.createElement("div",{style:{flex:1}},r.createElement(ut,{defaultSearchParams:l.defaultSearchParams,onSearch:e=>{l.onSearch(e),h(!1)},type:"desktop",searchFields:l.searchFields,isInboxPage:!(null!=l&&l.isSearch),searchParams:l.searchParams,clearSearch:()=>h(!0)}),r.createElement("div",{className:"result",style:{marginLeft:null!=l&&l.isSearch?"":"24px",flex:1}},E)))},pt=e=>{const{t:a}=o.useTranslation(),[i,l]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:a("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:a("ES_INBOX_DATE_LATEST_LAST")}});function s(){}return r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading"},r.createElement("div",{className:"filter-label"},a("SORT_BY"),":"),r.createElement("div",{className:"clearAll",onClick:s},a("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&r.createElement("span",{className:"clear-search",onClick:s},a("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&r.createElement("span",{onClick:e.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:i,optionsKey:"name",options:[{code:"DESC",name:a("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:a("ES_INBOX_DATE_LATEST_LAST")}]})))))},ft=e=>{let{t:o,data:a,onFilterChange:i,onSearch:l,onSort:s,serviceRequestIdKey:u,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:f,searchFields:m,sortParams:v,linkPrefix:g,filterComponent:h}=e;const[y,E]=n.useState(p?"SEARCH":""),[S,b]=n.useState(!!p),[D,A]=n.useState(v),[_]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(h)});n.useEffect(()=>{y&&b(!0)},[y]);const T=()=>{b(!1),E(""),A(v)};if(d)return r.createElement(t.Loader,null);let C;return a&&0!==(null==a?void 0:a.length)?a&&(null==a?void 0:a.length)>0&&(C=r.createElement(t.DetailsCard,{data:a,serviceRequestIdKey:u,linkPrefix:g||"/digit-ui/employee/ptr/"})):C=r.createElement(t.Card,{style:{marginTop:20}},o("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))),r.createElement(r.Fragment,null,r.createElement("div",{className:"searchBox"},l&&r.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{E("SEARCH"),b(!0)}}),!p&&i&&r.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{E("FILTER"),b(!0)}}),r.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{E("SORT"),b(!0)}})),C,S&&r.createElement(t.PopUp,null,"FILTER"===y&&r.createElement("div",{className:"popup-module"},r.createElement(_,{onFilterChange:e=>{i(e),b(!1)},Close:T,type:"mobile",searchParams:f})),"SORT"===y&&r.createElement("div",{className:"popup-module"},r.createElement(pt,{type:"mobile",sortParams:v,onClose:T,onSort:s})),"SEARCH"===y&&r.createElement("div",{className:"popup-module"},r.createElement(ut,{type:"mobile",onClose:T,onSearch:l,isFstpOperator:c,searchParams:f,searchFields:m}))))},mt=e=>{let{linkPrefix:i,classNameForMobileView:l=""}=e;const{t:s}=o.useTranslation(),u=[{text:s("ES_TITLE_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad"},{text:s("ES_TITILE_SEARCH_APPLICATION"),link:i+"/my-applications"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),r.createElement(t.Card,{className:"employeeCard filter"},r.createElement("div",{className:"complaint-links-container "+l},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.ShippingTruck,null))," ",r.createElement("span",{className:"text"},s("ES_TITLE_ADD_BOOKING"))),r.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:o}=e;return r.createElement("span",{className:"link",key:t},r.createElement(a.Link,{to:n},o))}))))},vt=e=>{let{data:t,isLoading:n,isSearch:a,searchFields:i,onFilterChange:l,onSearch:s,onSort:u,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:f,tableConfig:m,filterComponent:v}=e;const{t:g}=o.useTranslation();return r.createElement("div",{style:{padding:0}},r.createElement("div",{className:"inbox-container"},r.createElement("div",{className:"filters-container"},!a&&r.createElement(mt,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),r.createElement(ft,{t:g,data:null==t?void 0:t.map(e=>{const t={};return(a?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:l,isLoading:n,isSearch:a,onSearch:s,onSort:u,searchParams:d,searchFields:i,linkPrefix:f,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:v}))))},gt=["isFetching","isLoading","searchResponseKey","data","searchFields"],ht=e=>{var a,i,l,s,u;let{useNewInboxAPI:p,parentRoute:f,moduleCode:m="ADV",initialStates:v={},filterComponent:g,isInbox:h,rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:D,middlewaresWf:A,middlewareSearch:_,EmptyResultInboxComp:T}=e;const C=Digit.ULBService.getCurrentTenantId();console.log("here");const{t:N}=o.useTranslation(),[x,w]=n.useState(()=>h?{}:{enabled:!1}),[I,L]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("ADSInboxTableConfig")}),[k,O]=n.useState(v.pageOffset||0),[R,P]=n.useState(v.pageSize||10),[M,B]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[F,j]=n.useState(v.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),U=H?{limit:100,offset:0,sortBy:null==M||null===(a=M[0])||void 0===a?void 0:a.id,sortOrder:null!=M&&null!==(i=M[0])&&void 0!==i&&i.desc?"DESC":"ASC"}:{limit:R,offset:k,sortBy:null==M||null===(l=M[0])||void 0===l?void 0:l.id,sortOrder:null!=M&&null!==(s=M[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const z=p?Digit.Hooks.useNewInboxGeneral({tenantId:C,ModuleCode:m,filters:c({},F,U,{sortParams:M},F.wfFilters||{})}):Digit.Hooks.useInboxGeneral({tenantId:C,businessService:m,isInbox:h,filters:c({},F,U,{sortParams:M},F.wfFilters||{}),rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:c({},x,D),middlewaresWf:A,middlewareSearch:_}),{isLoading:q,data:W,searchFields:V}=z,G=d(z,gt);n.useEffect(()=>{O(0)},[F]);const K=e=>{let t=e.delete,n=c({},F,e);t&&t.forEach(e=>delete n[e]),delete e.delete,j(c({},n)),w({enabled:!0})},$=n.useCallback(e=>{0!==e.length&&B(e)},[]);var Y;if(null!==(null==G||null===(u=G.data)||void 0===u?void 0:u.length))return H?r.createElement(vt,{data:W,isLoading:q,isSearch:!h,searchFields:V,onFilterChange:K,onSearch:K,onSort:$,parentRoute:f,searchParams:F,sortParams:M,linkPrefix:f+"/application-details/",tableConfig:null!=G&&G.tableConfig?null==G?void 0:G.tableConfig:I(N).ADS,filterComponent:g,EmptyResultInboxComp:T,useNewInboxAPI:p}):r.createElement("div",null,h&&r.createElement(t.Header,null,N("ES_COMMON_INBOX")),r.createElement(dt,{moduleCode:m,data:W,tableConfig:I(N).ADS,isLoading:q,defaultSearchParams:v.searchParams,isSearch:!h,onFilterChange:K,searchFields:V,onSearch:K,onSort:$,onNextPage:()=>{O(e=>e+R)},onPrevPage:()=>{O(e=>e-R)},currentPage:Math.floor(k/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{P(Number(e.target.value))},parentRoute:f,searchParams:F,sortParams:M,totalRecords:Number(null==W||null===(Y=W[0])||void 0===Y?void 0:Y.totalCount),filterComponent:g,EmptyResultInboxComp:T,useNewInboxAPI:p}))},yt=e=>{var n,i,l,s,u,d,p,f,m,v,g,h;let{path:y,userType:S}=e;o.useTranslation();const b=a.useLocation();sessionStorage.removeItem("revalidateddone"),window.Digit.Utils.browser.isMobile();const D=null===(n=Digit)||void 0===n||null===(i=n.ComponentRegistryService)||void 0===i?void 0:i.getComponent("NewADSStepperForm"),A=(null===(l=Digit)||void 0===l||null===(s=l.ComponentRegistryService)||void 0===s||s.getComponent("NewSiteMasterStepperForm"),null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewSiteInspectionStepperForm")),_=(null===(p=Digit)||void 0===p||null===(f=p.ComponentRegistryService)||void 0===f||f.getComponent("ApplicationOverview"),null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("ADSResponseCitizen")),T=null===(g=Digit)||void 0===g||null===(h=g.ComponentRegistryService)||void 0===h?void 0:h.getComponent("ApplicationDetails"),C=window.location.href.includes("ads/response"),N=window.location.href.includes("searchad")||window.location.href.includes("modify-application")||window.location.href.includes("ads/application-details"),x={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ADV"],applicationStatus:[],locality:[]}};return r.createElement(a.Switch,null,r.createElement(t.AppContainer,null,r.createElement(r.Fragment,null,r.createElement("div",{className:"ground-container"},C?null:r.createElement("div",{style:N?{marginLeft:"12px",display:"flex",alignItems:"center"}:{marginLeft:"-4px",display:"flex",alignItems:"center"}},r.createElement(t.BackButton,{location:b})),r.createElement(t.PrivateRoute,{path:y+"/bookad",component:e=>r.createElement(D,c({},e,{userType:S}))}),r.createElement(t.PrivateRoute,{path:y+"/my-applications",component:e=>r.createElement(E,c({},e,{userType:"employee",parentRoute:y}))}),r.createElement(t.PrivateRoute,{path:y+"/applicationsearch/application-details/:id",component:()=>r.createElement(T,{parentRoute:y})}),r.createElement(t.PrivateRoute,{path:y+"/adsservice/:response/:bookingNo",component:_}),r.createElement(t.PrivateRoute,{path:y+"/site-inspection-details",component:A}),r.createElement(t.PrivateRoute,{path:y+"/inbox",component:()=>r.createElement(ht,{useNewInboxAPI:!0,parentRoute:y,businessService:"ADV",filterComponent:"ADS_INBOX_FILTER",initialStates:x,isInbox:!0})}),r.createElement(t.PrivateRoute,{path:y+"/searchold",component:()=>r.createElement(ht,{parentRoute:y,businessService:"ads",middlewareSearch:searchMW,initialStates:x,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})})))))},Et=e=>{var i;let{application:l,tenantId:s,buttonLabel:u}=e;console.log("application :>> ",l);const{t:c}=o.useTranslation(),d=a.useHistory(),[p,f]=n.useState(null);return Digit.Hooks.ads.useADSSlotSearch(),null==l||l.cartDetails.map(e=>({bookingId:null==l?void 0:l.bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:s,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0})),n.useEffect(()=>{if(p){const e=setTimeout(()=>{f(null)},2e3);return()=>clearTimeout(e)}},[p]),console.log("56565application :>> ",l),r.createElement(t.Card,null,r.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_NO"),note:null==l?void 0:l.bookingNo}),r.createElement(t.KeyNote,{keyValue:c("ADS_APPLICANT_NAME"),note:null==l||null===(i=l.applicantDetail)||void 0===i?void 0:i.applicantName}),r.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_START_DATE"),note:(e=>{var t,n;if(!e||0===e.length)return c("CS_NA");const r=null===(t=e[0])||void 0===t?void 0:t.bookingDate,o=null===(n=e[e.length-1])||void 0===n?void 0:n.bookingDate;return r===o?r:r&&o?r+" - "+o:c("CS_NA")})(null==l?void 0:l.cartDetails)}),r.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==l?void 0:l.bookingStatus))}),r.createElement("div",null,r.createElement(a.Link,{to:"/digit-ui/citizen/ads/application/"+(null==l?void 0:l.bookingNo)+"/"+(null==l?void 0:l.tenantId)},r.createElement(t.SubmitBar,{label:u})),("BOOKING_CREATED"===l.bookingStatus||"/mybookingsPAYMENT_FAILED"===l.bookingStatus||"PENDING_FOR_PAYMENT"===l.bookingStatus)&&r.createElement(t.SubmitBar,{label:c("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{d.push("/digit-ui/citizen/payment/collect/adv-services/"+(null==l?void 0:l.bookingNo)+"/"+s+"?tenantId="+s)},style:{margin:"20px"}})),p&&r.createElement(t.Toast,{error:p.error,warning:p.warning,label:c(p.label),onClose:()=>{f(null)}}))},St=e=>r.createElement("h1",{className:"heading-m"},e.label),bt=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Dt=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(bt,null)),At=e=>{var o,a,i;let{t:l,action:s,tenantId:u,closeModal:d,submitAction:p,applicationData:f,businessService:m,workflowActions:v,showToast:g,closeToast:h,errors:y}=e;const[E,S]=n.useState({}),[b,D]=n.useState({}),[A,_]=n.useState([]),[T,C]=n.useState({}),[N,x]=n.useState(null),[w,I]=n.useState(null),[L,k]=n.useState(null),[O,R]=n.useState([]),[P,M]=n.useState(null),B=new Set(["SUBMIT","INITIATE","PAY"]),F=(null==s?void 0:s.fromStateCode)||(null==s||null===(o=s._rawStateObj)||void 0===o?void 0:o.state)||null,j=(null==s?void 0:s.toStateCode)||null,H=(null==s?void 0:s.status)||(B.has(null==s?void 0:s.action)?j||F||(null==s?void 0:s.nextState):F||j||(null==s?void 0:s.nextState)),{data:U}=Digit.Hooks.useEmployeeSearch(u,{roles:null==s||null===(a=s.assigneeRoles)||void 0===a||null===(i=a.map)||void 0===i?void 0:i.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:z}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'ADV')]"}]}]}});n.useEffect(()=>{var e;z&&z["egf-master"]&&R(null===(e=z["egf-master"])||void 0===e?void 0:e.FinancialYear)},[z]);const{data:q}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function W(e){x(e.target.files[0])}return n.useEffect(()=>{if(U&&q){var e;const t=q["common-masters"].Department;_(null==U||null===(e=U.Employees)||void 0===e?void 0:e.map(e=>{var n,r,o;const a=null==e||null===(n=e.assignments)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.department,i=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===a);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==i?void 0:i.name)}}))}},[U]),n.useEffect(()=>{!function(){try{k(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)k(l("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ze(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):k(l("CS_FILE_UPLOAD_ERROR"))})},function(){k(l("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(()=>{v&&v.length>0&&v.find(e=>e.action===(null==s?void 0:s.action))},[v,s]),n.useEffect(()=>{s&&S((e=>{let{t:n,action:o,approvers:a,selectedApprover:i,setSelectedApprover:l,selectFile:s,uploadedFile:u,setUploadedFile:c}=e,d=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(d=!1),o.isTerminateState&&(d=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:""+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:d?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:d?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:d?r.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:l,selected:i}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:r.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:l,action:s,approvers:A,selectedApprover:T,setSelectedApprover:C,selectFile:W,uploadedFile:w,setUploadedFile:I,businessService:m}))},[s,A,O,P,w]),s&&E.form?r.createElement(t.Modal,{headerBarMain:r.createElement(St,{label:l(E.label.heading)}),headerBarEnd:r.createElement(Dt,{onClick:d}),actionCancelLabel:l(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:l(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},r.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){f=c({},f,{action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,status:H,wfDocuments:w?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:w}]:null}),p({Licenses:[f]})},defaultValues:b,formId:"modal-action"}),g&&r.createElement(t.Toast,{error:"error"===g.key,label:y,onClose:h})):r.createElement(t.Loader,null)};var _t,Tt=Array.isArray,Ct="object"==typeof T&&T&&T.Object===Object&&T,Nt="object"==typeof self&&self&&self.Object===Object&&self,xt=Ct||Nt||Function("return this")(),wt=xt.Symbol,It=Object.prototype,Lt=It.hasOwnProperty,kt=It.toString,Ot=wt?wt.toStringTag:void 0,Rt=Object.prototype.toString,Pt=wt?wt.toStringTag:void 0,Mt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Pt&&Pt in Object(e)?function(e){var t=Lt.call(e,Ot),n=e[Ot];try{e[Ot]=void 0;var r=!0}catch(e){}var o=kt.call(e);return r&&(t?e[Ot]=n:delete e[Ot]),o}(e):function(e){return Rt.call(e)}(e)},Bt=function(e){return null!=e&&"object"==typeof e},Ft=function(e){return"symbol"==typeof e||Bt(e)&&"[object Symbol]"==Mt(e)},jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ht=/^\w*$/,Ut=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},zt=xt["__core-js_shared__"],qt=(_t=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+_t:"",Wt=Function.prototype.toString,Vt=function(e){if(null!=e){try{return Wt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Gt=/^\[object .+?Constructor\]$/,Kt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ut(e)||(t=e,qt&&qt in t))&&(function(e){if(!Ut(e))return!1;var t=Mt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?Kt:Gt).test(Vt(e));var t}(n)?n:void 0},Yt=$t(Object,"create"),Xt=Object.prototype.hasOwnProperty,Zt=Object.prototype.hasOwnProperty;function Jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jt.prototype.clear=function(){this.__data__=Yt?Yt(null):{},this.size=0},Jt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Jt.prototype.get=function(e){var t=this.__data__;if(Yt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Xt.call(t,e)?t[e]:void 0},Jt.prototype.has=function(e){var t=this.__data__;return Yt?void 0!==t[e]:Zt.call(t,e)},Jt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Yt&&void 0===t?"__lodash_hash_undefined__":t,this};var Qt=Jt,en=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(o=t)||r!=r&&o!=o)return n;var r,o;return-1},tn=Array.prototype.splice;function nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nn.prototype.clear=function(){this.__data__=[],this.size=0},nn.prototype.delete=function(e){var t=this.__data__,n=en(t,e);return!(n<0||(n==t.length-1?t.pop():tn.call(t,n,1),--this.size,0))},nn.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?void 0:t[n][1]},nn.prototype.has=function(e){return en(this.__data__,e)>-1},nn.prototype.set=function(e,t){var n=this.__data__,r=en(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var rn=nn,on=$t(xt,"Map"),an=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=function(){this.size=0,this.__data__={hash:new Qt,map:new(on||rn),string:new Qt}},ln.prototype.delete=function(e){var t=an(this,e).delete(e);return this.size-=t?1:0,t},ln.prototype.get=function(e){return an(this,e).get(e)},ln.prototype.has=function(e){return an(this,e).has(e)},ln.prototype.set=function(e,t){var n=an(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var sn=ln;function un(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(un.Cache||sn),n}un.Cache=sn;var cn,dn,pn,fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mn=/\\(\\)?/g,vn=(cn=un(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(fn,function(e,n,r,o){t.push(r?o.replace(mn,"$1"):n||e)}),t},function(e){return 500===dn.size&&dn.clear(),e}),dn=cn.cache,cn),gn=wt?wt.prototype:void 0,hn=gn?gn.toString:void 0,yn=function(e){if("string"==typeof e||Ft(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},En=function(e,t,n){var r=null==e?void 0:function(e,t){for(var n=0,r=(t=function(e,t){return Tt(e)?e:function(e,t){if(Tt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ft(e))||Ht.test(e)||!jt.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:vn(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Tt(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,e)+"";if(Ft(t))return hn?hn.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<r;)e=e[yn(t[n++])];return n&&n==r?e:void 0}(e,t);return void 0===r?n:r};!function(){try{$t(Object,"defineProperty")({},"",{})}catch(e){}}(),pn=function(){return arguments}(),Bt(pn)&&Mt(pn);var Sn=function(){return!1},bn=(C(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?xt.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Sn}),C(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n&&Ct.process,a=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),C(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?xt.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}),$t(xt,"DataView")),Dn=$t(xt,"Promise"),An=$t(xt,"Set"),_n=$t(xt,"WeakMap"),Tn=Vt(bn),Cn=Vt(on),Nn=Vt(Dn),xn=Vt(An),wn=Vt(_n),In=Mt;(bn&&"[object DataView]"!=In(new bn(new ArrayBuffer(1)))||on&&"[object Map]"!=In(new on)||Dn&&"[object Promise]"!=In(Dn.resolve())||An&&"[object Set]"!=In(new An)||_n&&"[object WeakMap]"!=In(new _n))&&(In=function(e){var t=Mt(e),n="[object Object]"==t?e.constructor:void 0,r=n?Vt(n):"";if(r)switch(r){case Tn:return"[object DataView]";case Cn:return"[object Map]";case Nn:return"[object Promise]";case xn:return"[object Set]";case wn:return"[object WeakMap]"}return t});const Ln=e=>{let{children:t,currentStep:n=1,stepsList:a=[]}=e;const{t:i}=o.useTranslation(),l=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},s={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},u={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),a.length);return r.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},r.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return r.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},r.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:r.createElement("div",{className:"step-number",style:u}),r.createElement("div",{className:"step-label",style:s},i(a[t].stepLabel))),r.createElement("div",{className:"step-circle",style:l(t+1)},t+1,t<d-1&&r.createElement("div",{style:c})));var o})),r.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},kn=e=>{let{stepsList:t=[],onSubmit:n,step:a,setStep:i}=e;const l=t.filter(e=>e.isStepEnabled),{t:s}=o.useTranslation();function u(){a<l.length?d():a===l.length&&n()}function c(){a>1&&p()}const d=()=>i(a+1),p=()=>i(a-1);return r.createElement(Ln,{currentStep:a,nextStep:d,prevStep:p,stepsList:l},(()=>{var e,t;const n=l[a-1],{component:o,key:i,texts:d,currStepConfig:p}=n,f=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return r.createElement(r.Fragment,null,r.createElement(f,{config:{key:i,texts:d,component:o,currStepNumber:a,currStepConfig:p},onGoNext:u,onBackClick:c,t:s}))})())},On=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInCitizen:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:"penalty"}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Rn=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Pn=(e,t)=>({type:"UPDATE_ADSNewApplication_FORM",payload:{key:e,value:t}}),Mn=e=>({type:"SET_ADSNewApplication_STEP",payload:e}),Bn=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_TITILE_APPLICANT_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}]),Fn=[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_APPLICANT_DETAILA",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}],jn=e=>{var o,a;let{t:l,goNext:u,currentStepData:c,onGoBack:d,onChange:p=(()=>{})}=e;const f="ads_form_"+("undefined"!=typeof window&&(null===(o=window.location)||void 0===o||null===(a=o.pathname)||void 0===a?void 0:a.includes("/employee"))?"employee":"citizen"),m=s.useDispatch(),{control:v,handleSubmit:g,setValue:h,reset:y,getValues:E,formState:{errors:S}}=i.useForm({mode:"onChange",defaultValues:{firstName:"",lastName:"",emailId:"",mobileNumber:"",SGST:"",selfDeclaration:!1,clientName:"",address:{pincode:"",streetName:"",houseNo:"",landmark:"",addressline1:"",addressline2:"",houseName:"",doorNo:"",addressId:"",city:null,locality:null}}});"undefined"!=typeof window&&(window.__ADS_FORM_DRAFT=window.__ADS_FORM_DRAFT||{}),n.useEffect(()=>{console.log("ADSCitizenDetailsNew: useEffect for currentStepData triggered"),console.log("ADSCitizenDetailsNew: currentStepData:",c),console.log("currentStepData:",c);const e=null==c?void 0:c.ownerDetails;if(!e)return;console.log("ADSCitizenDetailsNew: base.address:",null==e?void 0:e.address);const t=E("address"),n=e.address;JSON.stringify(t)!==JSON.stringify(n)&&(Object.entries(e).forEach(e=>{let[t,n]=e;"address"!==t&&"addressdetails"!==t&&h(t,n)}),n&&h("address",n))},[c,h,E]),n.useEffect(()=>{try{var e;const t=null===(e=window.__ADS_FORM_DRAFT)||void 0===e?void 0:e[f];if(t&&"object"==typeof t)return y(t),void console.info("[ADS] rehydrated form from in-memory draft")}catch(e){console.warn("[ADS] failed to rehydrate from in-memory",e)}},[]);const b=e=>{try{p(e)}catch(e){console.error("Error on address change:",e)}},D=i.useWatch({control:v});return n.useEffect(()=>{const e=setTimeout(()=>{try{JSON.stringify(D).length<307200?window.__ADS_FORM_DRAFT[f]=D:console.warn("[ADS] draft too large, skipping in-memory persist")}catch(e){console.warn("[ADS] failed to persist form to in-memory",e)}},250);return()=>clearTimeout(e)},[D,f]),r.createElement("form",{onSubmit:g(function(e){try{var t,n,r,o,a,i,l,s,d,p,v,g,h,y,E,S,b;try{window.__ADS_FORM_DRAFT&&delete window.__ADS_FORM_DRAFT[f]}catch(e){}const D=(null==c||null===(t=c.pets)||void 0===t?void 0:t.cartDetails)||(null==c?void 0:c.cartDetails)||(null==c||null===(n=c.siteDetails)||void 0===n?void 0:n.cartDetails)||(null==c?void 0:c.siteDetails)||[],A=null!=(r=null!=(o=null==c||null===(a=c.pets)||void 0===a?void 0:a.bookingFromTime)?o:null==c?void 0:c.bookingFromTime)?r:"",_=null!=(i=null!=(l=null==c||null===(s=c.pets)||void 0===s?void 0:s.bookingToTime)?l:null==c?void 0:c.bookingToTime)?i:"",T=null!=(d=null!=(p=null==c||null===(v=c.pets)||void 0===v?void 0:v.cartAddress)?p:null==c?void 0:c.cartAddress)?d:"",C="undefined"!=typeof window&&(null===(g=window.location)||void 0===g||null===(h=g.href)||void 0===h?void 0:h.includes("citizen"))?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),N=Date.now(),x=e.address||{},w={addressLine1:x.addressline1||x.addressLine1||"",city:(null===(y=x.city)||void 0===y?void 0:y.name)||x.city||"",cityCode:x.cityCode||(null===(E=x.city)||void 0===E?void 0:E.code)||"",houseNo:x.houseNo||"",houseName:x.houseName||"",landmark:x.landmark||"",locality:(null===(S=x.locality)||void 0===S?void 0:S.code)||x.locality||"",localityCode:x.localityCode||(null===(b=x.locality)||void 0===b?void 0:b.code)||"",pincode:x.pincode||"",streetName:x.streetName||""},I={tenantId:C,applicationDate:N,bookingStatus:"BOOKING_CREATED",businessService:"ADV",address:w,applicantDetail:{applicantName:((e.firstName||"")+" "+(e.lastName||"")).trim(),applicantEmailId:e.emailId||"",applicantMobileNo:e.mobileNumber||"",selfDeclaration:void 0===e.selfDeclaration||e.selfDeclaration,applicantDetailId:"",SGST:e.SGST||""},additional_details:"sgst, endDate, selfDeclaration",cartDetails:Array.isArray(D)?D:[],bookingFromTime:A,bookingToTime:_,cartAddress:T,documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}},L=Ze(function(){const e={bookingApplication:I};return Promise.resolve(Digit.ADSServices.create(e,C)).then(function(t){var n;const r=null==t||null===(n=t.ResponseInfo)||void 0===n?void 0:n.status;if("string"==typeof r&&"successful"===r.toLowerCase()){const n=Array.isArray(null==t?void 0:t.bookingApplication)?t.bookingApplication[0]:null==t?void 0:t.bookingApplication;console.log("ADSCitizenDetailsNew: onSubmit called"),console.log("ADSCitizenDetailsNew: formData:",I),console.log("ADSCitizenDetailsNew: payload:",e),m(Pn("CreatedResponse",n||t)),u(t)}else console.error("ADS create failed (ADSCitizenDetailsNew) - saving draft",t),m(Pn("CreatedResponse",{draft:!0,bookingApplication:I})),u({draft:!0,bookingApplication:I})})},function(e){console.error("ADS create error (ADSCitizenDetailsNew) - saving draft",e),m(Pn("CreatedResponse",{draft:!0,bookingApplication:I})),u({draft:!0,bookingApplication:I})});return Promise.resolve(L&&L.then?L.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",null,r.createElement(t.CardLabel,null,l("NDC_FIRST_NAME"),r.createElement("span",{style:{color:"red"}},"*")," "),r.createElement(i.Controller,{control:v,name:"firstName",rules:{required:"This field is required",pattern:{value:/^(?=.*[A-Za-z])[A-Za-z\s'-]+$/,message:"Only letters, spaces, apostrophes and hyphens allowed, must include at least one letter"},minLength:{value:2,message:"Minimum 2 characters"},maxLength:{value:100,message:"Maximum 100 characters"}},render:e=>{let{value:n,onChange:o,onBlur:a}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:a,t:l})}}),S.firstName&&r.createElement("p",{style:{color:"red"}},S.firstName.message),r.createElement(t.CardLabel,null,l("NDC_LAST_NAME"),r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:v,name:"lastName",rules:{required:"This field is required",pattern:{value:/^(?=.*[A-Za-z])[A-Za-z\s'-]+$/,message:"Only letters, spaces, apostrophes and hyphens allowed, must include at least one letter"},minLength:{value:2,message:"Minimum 2 characters"},maxLength:{value:100,message:"Maximum 100 characters"}},render:e=>{let{value:n,onChange:o,onBlur:a}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:a,t:l})}}),S.lastName&&r.createElement("p",{style:{color:"red"}},S.lastName.message),r.createElement(t.CardLabel,null,l("NOC_APPLICANT_EMAIL_LABEL"),r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:v,name:"emailId",rules:{required:"This field is required",pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Enter a valid email"}},render:e=>{let{value:n,onChange:o,onBlur:a}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:a,t:l})}}),S.emailId&&r.createElement("p",{style:{color:"red"}},S.emailId.message),r.createElement(t.CardLabel,null,l("NOC_APPLICANT_MOBILE_NO_LABEL"),r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:v,name:"mobileNumber",rules:{required:"This field is required",minLength:{value:10,message:"Enter at least 10 digits"},pattern:{value:/^[6-9]\d{9}$/,message:"Must start with 9, 8, 7, or 6 and be 10 digits long"}},render:e=>{let{value:n,onChange:o,onBlur:a}=e;return r.createElement(t.MobileNumber,{value:n,onChange:o,onBlur:a,t:l})}}),S.mobileNumber&&r.createElement("p",{style:{color:"red"}},S.mobileNumber.message),r.createElement(t.CardLabel,null,l("ADVT_CHALLAN_UNDER_SECTION_122_123_SGST")),r.createElement(i.Controller,{control:v,name:"SGST",rules:{validate:e=>!e.trim()||/^\d{2}[A-Z]{5}\d{4}[A-Z]\dZ[A-Z\d]$/.test(e.trim())||"Enter a valid SGST"},render:e=>{let{value:n,onChange:o,onBlur:a}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:e=>{const t=e.target.value.trim();o(t),a(e)},t:l})}}),S.SGST&&r.createElement("p",{style:{color:"red"}},S.SGST.message),r.createElement(i.Controller,{control:v,name:"address",rules:{validate:e=>{const t=["houseNo","houseName","streetName","addressline1","landmark","city","locality","pincode"].filter(t=>{const n=null==e?void 0:e[t];return"pincode"===t?!(n&&6===String(n).trim().length):"city"===t||"locality"===t?!n:!(n&&String(n).trim())});return!t.length||"Address missing: "+t.join(", ")}},render:e=>{let{value:t,onChange:n,onBlur:o}=e;return r.createElement("div",null,r.createElement(Qe,{t:l,value:t||{},onChange:n,onSelect:function(e,t){return void 0===t&&(t={}),b(t)},onBlur:o}),S.address&&r.createElement("p",{style:{color:"red",marginTop:"6px"}},S.address.message))}}),r.createElement("div",{style:{marginTop:"20px"}},r.createElement(i.Controller,{control:v,name:"selfDeclaration",rules:{required:"This field is required"},render:e=>{let{value:t,onChange:n,onBlur:o}=e;return r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"}},r.createElement("input",{type:"checkbox",id:"selfDeclaration",checked:t||!1,onChange:e=>n(e.target.checked),onBlur:o,style:{width:"18px",height:"18px",cursor:"pointer"}}),r.createElement("label",{htmlFor:"selfDeclaration",style:{fontSize:"14px",lineHeight:"1.5",cursor:"pointer"}},l("BILLAMENDMENT_SELFDECLARATION_LABEL")),r.createElement("span",{style:{color:"red"}},"*"))}}),S.selfDeclaration&&r.createElement("p",{style:{color:"red"}},S.selfDeclaration.message),r.createElement(t.CardLabel,null,"Client Name ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:v,name:"clientName",rules:{required:"This field is required",pattern:{value:/^(?=.*[A-Za-z])[A-Za-z\s'-]+$/,message:"Only letters, spaces, apostrophes and hyphens allowed , atleast include one letter"},minLength:{value:2,message:"Minimum 2 characters"},maxLength:{value:100,message:"Maximum 100 characters"}},render:e=>r.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur,t:l})}),S.clientName&&r.createElement("p",{style:{color:"red"}},S.clientName.message))),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:d}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))},Hn=e=>{let{goNext:o,currentStepData:a,t:l}=e;const u=Digit.ULBService.getStateId(),{data:d}=Digit.Hooks.ads.useADSLocationMDMS(u),{data:p=[],isLoading:f}=Digit.Hooks.ads.useADSAllMDMS(u),[m,v]=n.useState([]),[g,h]=n.useState([]),[y,E]=n.useState(6),[S,b]=n.useState({}),D=s.useDispatch(),[A,_]=n.useState(""),[T,C]=n.useState([]),[N,x]=n.useState({}),[w,I]=n.useState(null),L=e=>e&&Array.isArray(d)&&d.find(t=>String(t.locationCode)===String(e)||String(t.code)===String(e))||null,[k,O]=n.useState(!1),R=n.useRef(null),P=n.useRef(!1),M=e=>e&&e.geo_tag&&e.geo_tag.latitude&&e.geo_tag.longitude?{formattedAddress:e.name||e.label||"",latitude:e.geo_tag.latitude,longitude:e.geo_tag.longitude,lat:e.geo_tag.latitude,lng:e.geo_tag.longitude,placeId:e.locationCode||e.code||"",raw:e}:null,B=e=>{if(!e)return"";const[t,n]=String(e).split("T");if(!t)return"";const[r,o,a]=t.split("-");return o+"/"+a+"/"+r+(n?" "+n:"")};n.useEffect(()=>E(6),[g]);const F=Array.from(new Map(p.filter(e=>e.locationCode).map(e=>[e.locationCode,{code:e.locationCode,label:e.locationCode}])).values()),j=new Date;j.setMinutes(j.getMinutes()-j.getTimezoneOffset());const H=j.toISOString().slice(11,16),[U,z]=(window.location.href.includes("citizen"),n.useState(0)),q=(e,t)=>{if(e)try{localStorage.setItem("ADS:site:"+e,JSON.stringify(c({},t,{savedAt:Date.now()})))}catch(e){console.warn("ADS persistence failed",e)}},W=e=>{if(!e)return null;try{const t=localStorage.getItem("ADS:site:"+e);return t?JSON.parse(t):null}catch(e){return console.warn("ADS load failed",e),null}},V=(e,t)=>{const n=t||S&&(S[e]||S[String(e)])||{},r=n.startDate||"",o=n.startTime||"",a=n.endDate||"",i=n.endTime||"";if(!(r&&o&&a&&i))return x(t=>{if(!t[e])return t;const n=c({},t);return delete n[e],n}),!0;if(r<ve||a<ve)return x(t=>c({},t,{[e]:"Dates must be from "+ve+" or later."})),!1;const l=new Date(r+"T"+o);return new Date(a+"T"+i)<=l?(x(t=>c({},t,{[e]:"End date/time must be after start date/time."})),!1):(x(t=>{if(!t[e])return t;const n=c({},t);return delete n[e],n}),!0)},G=()=>{const e=[];try{for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(!n||!n.startsWith("ADS:site:"))continue;const r=n.slice("ADS:site:".length),o=localStorage.getItem(n);if(o)try{const t=JSON.parse(o);e.push(c({siteId:r},t))}catch(e){console.warn("ADS: parse saved site failed for",n,e)}}}catch(e){console.warn("ADS: loadAllSavedSites failed",e)}return e},K=function(e,t){void 0===t&&(t={});try{(G()||[]).forEach(n=>{if(!n||!n.siteId)return;const r=String(n.siteId),o={mdmsCards:Array.isArray(n.mdmsCards)?n.mdmsCards:n.mdmsCards||[],adsList:Array.isArray(n.adsList)?n.adsList:n.adsList||[],adsScheduleMap:n.adsScheduleMap?c({},n.adsScheduleMap):{},placeNameState:n.placeNameState||"",globalScheduleEnabled:!!e,startDate:n.startDate||"",endDate:n.endDate||"",bookingFromTime:n.bookingFromTime||"",bookingToTime:n.bookingToTime||""};if(e){const{startDate:e="",startTime:n="",endDate:r="",endTime:a=""}=t;(o.mdmsCards||[]).forEach(t=>{var i;const l=null!=(i=t.mdmsId)?i:t.id;l&&(o.adsScheduleMap[l]={startDate:e,startTime:n,endDate:r,endTime:a})})}else{const{startDate:e="",startTime:n="",endDate:r="",endTime:a=""}=t;Object.keys(o.adsScheduleMap||{}).forEach(t=>{const i=o.adsScheduleMap[t]||{};e&&n&&r&&a?i.startDate===e&&i.startTime===n&&i.endDate===r&&i.endTime===a&&delete o.adsScheduleMap[t]:i.startDate||i.startTime||i.endDate||i.endTime||delete o.adsScheduleMap[t]})}try{localStorage.setItem("ADS:site:"+r,JSON.stringify(c({},o,{savedAt:Date.now()})))}catch(e){try{sessionStorage.setItem("ADS:session:"+r,JSON.stringify(c({},o,{savedAt:Date.now()})))}catch(e){console.warn("updateAllSavedSitesForGlobal persist failed for",r,e)}}})}catch(e){console.warn("updateAllSavedSitesForGlobal failed",e)}},$=e=>{try{const t=c({},e||{},{savedAt:Date.now()});localStorage.setItem("ADS:global",JSON.stringify(t))}catch(e){console.warn("saveGlobal failed",e)}},Y=()=>{try{const e=localStorage.getItem("ADS:global");return e?JSON.parse(e):null}catch(e){return null}},X=()=>{const e=oe("startDate")||ve,t=oe("endDate")||e,n=oe("bookingFromTime")||H,r=oe("bookingToTime")||H,o=c({},S||{});(g||[]).forEach(a=>{o[a.id]=c({},o[a.id]||{},{startDate:e,startTime:n,endDate:t,endTime:r})}),b(o)},Z={siteId:"",geoLocation:null,cartAddress:"",size:"",advertisementType:"",startDate:"",endDate:"",bookingFromTime:H,bookingToTime:H,availabilityStatus:"",amount:""},{control:J,handleSubmit:Q,setValue:ee,watch:te,reset:ne,formState:{errors:re},getValues:oe,trigger:ae}=i.useForm({defaultValues:Z}),ie=n.useCallback(e=>{const t=oe("startDate")||"",n=oe("endDate")||t||"",r=oe("bookingFromTime")||H||"",o=oe("bookingToTime")||H||"";if(e)R.current=S||{},b(e=>{const a=c({},e||{});return(g||[]).forEach(e=>{var i;const l=null!=(i=e.mdmsId)?i:e.id;a[l]={startDate:t,startTime:r,endDate:n,endTime:o}}),a}),O(!0),$({globalScheduleEnabled:!0,startDate:t,endDate:n,bookingFromTime:r,bookingToTime:o}),K(!0,{startDate:t,startTime:r,endDate:n,endTime:o});else{O(!1),b(R.current||{}),R.current=null;const e=Y()||{};$(c({},e,{globalScheduleEnabled:!1})),K(!1,{startDate:t,startTime:r,endDate:n,endTime:o})}try{D(Pn("savedUI",{mdmsCards:m,adsList:T,adsScheduleMap:e?(()=>{const e=c({},S||{});return(g||[]).forEach(a=>{var i;const l=null!=(i=a.mdmsId)?i:a.id;e[l]={startDate:t,startTime:r,endDate:n,endTime:o}}),e})():R.current||S||{},placeNameState:A,globalScheduleEnabled:!!e,startDate:t,endDate:n,bookingFromTime:r,bookingToTime:o,siteId:oe("siteId"),geolocation:oe("geoLocation")}))}catch(e){console.warn("dispatch update on setGlobalSchedule failed",e)}},[g,S,m,T,A,D,oe]);n.useEffect(()=>{const e=null==a?void 0:a.savedUI;var t;if(e)return Array.isArray(e.mdmsCards)&&v(e.mdmsCards),Array.isArray(e.adsList)&&C(e.adsList),e.adsScheduleMap&&b(e.adsScheduleMap),"string"==typeof e.placeNameState&&_(e.placeNameState||""),void 0!==e.globalScheduleEnabled&&(O(!!e.globalScheduleEnabled),e.startDate&&ee("startDate",e.startDate,{shouldValidate:!1}),e.endDate&&ee("endDate",e.endDate,{shouldValidate:!1}),e.bookingFromTime&&ee("bookingFromTime",e.bookingFromTime,{shouldValidate:!1}),e.bookingToTime&&ee("bookingToTime",e.bookingToTime,{shouldValidate:!1}),e.globalScheduleEnabled&&X()),e.siteId&&(ee("siteId",e.siteId,{shouldValidate:!1,shouldDirty:!0}),h(p.filter(t=>String(t.locationCode)===String(e.siteId)))),void(e.geoLocation&&(ee("geoLocation",e.geoLocation,{shouldValidate:!1,shouldDirty:!0}),_((null===(t=e.geoLocation)||void 0===t?void 0:t.formattedAddress)||"")));const n=Y();if(n&&n.globalScheduleEnabled)return O(!0),n.startDate&&ee("startDate",n.startDate,{shouldValidate:!1}),n.endDate&&ee("endDate",n.endDate,{shouldValidate:!1}),n.bookingFromTime&&ee("bookingFromTime",n.bookingFromTime,{shouldValidate:!1}),n.bookingToTime&&ee("bookingToTime",n.bookingToTime,{shouldValidate:!1}),void X();const r=G();if(r&&r.length){r.sort((e,t)=>(t.savedAt||0)-(e.savedAt||0));const e=r[0];if(e){const t=String(e.siteId||"");ee("siteId",t,{shouldValidate:!1,shouldDirty:!0}),z(e=>e+1),h(p.filter(e=>String(e.locationCode)===t)),v(Array.isArray(e.mdmsCards)?e.mdmsCards:[]),C(Array.isArray(e.adsList)?e.adsList:[]),b(e.adsScheduleMap||{}),_(e.placeNameState||""),e.geoLocation&&ee("geoLocation",e.geoLocation,{shouldValidate:!1,shouldDirty:!0})}}},[]);const le=te("siteId"),se=n.useCallback(()=>{const e=(null==oe?void 0:oe("siteId"))||te&&te("siteId");try{ne(Z)}catch(e){console.warn("form reset failed",e)}try{v([]),C([]),b({}),_(""),O(!1),R.current=null,z(e=>e+1)}catch(e){console.warn("local state clear failed",e)}try{if(e)try{localStorage.removeItem("ADS:site:"+String(e))}catch(e){}try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith("ADS:site:")&&e.push(n)}e.forEach(e=>localStorage.removeItem(e))}catch(e){}try{localStorage.removeItem("ADS:global")}catch(e){}}catch(e){console.warn("persistence clear failed",e)}try{D(Pn("savedUI",{mdmsCards:[],adsList:[],adsScheduleMap:{},placeNameState:"",globalScheduleEnabled:!1,startDate:"",endDate:"",bookingFromTime:"",bookingToTime:"",siteId:"",geoLocation:null}))}catch(e){console.warn("redux notify failed",e)}try{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}catch(e){}},[ne,D,z,oe,te]);n.useEffect(()=>{const e=()=>{P.current=!0;try{for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&String(t).toUpperCase().startsWith("ADS:")&&localStorage.removeItem(t)}}catch(e){console.warn("clear ADS localStorage failed",e)}try{for(let e=sessionStorage.length-1;e>=0;e--){const t=sessionStorage.key(e);t&&String(t).startsWith("ADS:session:")&&sessionStorage.removeItem(t)}sessionStorage.removeItem("ADS:session:last")}catch(e){console.warn("clear ADS sessionStorage failed",e)}try{D({type:"RESET_ADS_NEW_APPLICATION_FORM"})}catch(e){console.warn("dispatch reset failed",e)}try{se()}catch(e){console.warn("globalReset threw",e)}},t=t=>{(!t.ctrlKey&&!t.metaKey||"r"!==t.key&&"R"!==t.key&&"KeyR"!==t.code)&&"F5"!==t.code||(t.preventDefault(),e(),setTimeout(()=>{P.current=!1,window.location.reload()},60))},n=()=>{e()};return window.addEventListener("keydown",t,!0),window.addEventListener("beforeunload",n),()=>{window.removeEventListener("keydown",t,!0),window.removeEventListener("beforeunload",n)}},[D,se]),n.useEffect(()=>{const e=le;if(!e)return;h(p.filter(t=>String(t.locationCode)===String(e)));const t=Y(),n=t&&t.globalScheduleEnabled;n&&(O(!0),t.startDate&&ee("startDate",t.startDate,{shouldValidate:!1}),t.endDate&&ee("endDate",t.endDate,{shouldValidate:!1}),t.bookingFromTime&&ee("bookingFromTime",t.bookingFromTime,{shouldValidate:!1}),t.bookingToTime&&ee("bookingToTime",t.bookingToTime,{shouldValidate:!1}),X());let r=W(String(e));if(!r)try{const t="ADS:session:"+String(e),n="ADS:session:last",o=sessionStorage.getItem(t)||sessionStorage.getItem(n);o&&(r=JSON.parse(o))}catch(e){}if(r){const e=Array.isArray(r.mdmsCards)?r.mdmsCards:[],o=Array.isArray(r.adsList)?r.adsList:[];let a=e;if(n){const n=oe("startDate")||t&&t.startDate||"",r=oe("bookingFromTime")||t&&t.bookingFromTime||"",o=oe("endDate")||t&&t.endDate||"",i=oe("bookingToTime")||t&&t.bookingToTime||"";a=e.map(e=>{var t,a,l,s;return c({},e,{schedules:[{startDatetime:n&&r?n+"T"+r:(null===(t=e.schedules)||void 0===t||null===(a=t[0])||void 0===a?void 0:a.startDatetime)||"",endDatetime:o&&i?o+"T"+i:(null===(l=e.schedules)||void 0===l||null===(s=l[0])||void 0===s?void 0:s.endDatetime)||""}]})});const l=c({},S||{});(a||[]).forEach(e=>{var t;const a=null!=(t=e.mdmsId)?t:e.id;l[a]={startDate:n,startTime:r,endDate:o,endTime:i}}),b(e=>c({},e||{},l||{}))}else r.adsScheduleMap&&b(r.adsScheduleMap||{});v(a),C(o),_(r.placeNameState||""),r.startDate&&ee("startDate",r.startDate,{shouldValidate:!1}),r.endDate&&ee("endDate",r.endDate,{shouldValidate:!1}),r.bookingFromTime&&ee("bookingFromTime",r.bookingFromTime,{shouldValidate:!1}),r.bookingToTime&&ee("bookingToTime",r.bookingToTime,{shouldValidate:!1}),void 0!==r.globalScheduleEnabled&&(n?(t.startDate&&ee("startDate",t.startDate,{shouldValidate:!1}),t.endDate&&ee("endDate",t.endDate,{shouldValidate:!1}),t.bookingFromTime&&ee("bookingFromTime",t.bookingFromTime,{shouldValidate:!1}),t.bookingToTime&&ee("bookingToTime",t.bookingToTime,{shouldValidate:!1}),O(!0),X()):(O(!!r.globalScheduleEnabled),r.globalScheduleEnabled&&X()))}else v([]),C([]),b({}),_("");const o=L(e),a=M(o);a?(ee("geoLocation",a,{shouldValidate:!1,shouldDirty:!0}),_(a.formattedAddress),te("cartAddress")||ee("cartAddress",a.formattedAddress)):(ee("geoLocation",null,{shouldValidate:!1}),_(""))},[le,p]),n.useEffect(()=>{let e=null;return e=setTimeout(()=>{try{const e={mdmsCards:m,adsList:T,adsScheduleMap:S,placeNameState:A,globalScheduleEnabled:!!k,startDate:oe("startDate")||"",endDate:oe("endDate")||"",bookingFromTime:oe("bookingFromTime")||"",bookingToTime:oe("bookingToTime")||"",siteId:oe("siteId")||"",geoLocation:oe("geoLocation")||null};D(Pn("savedUI",e));try{sessionStorage.setItem("ADS:session:"+(oe("siteId")||"last"),JSON.stringify(e))}catch(e){}}catch(e){console.warn("sync savedUI failed",e)}},120),()=>{e&&clearTimeout(e)}},[m,T,S,A,k,D,oe]),n.useEffect(()=>()=>{try{const e={mdmsCards:m,adsList:T,adsScheduleMap:S,placeNameState:A,globalScheduleEnabled:!!k,startDate:oe("startDate")||"",endDate:oe("endDate")||"",bookingFromTime:oe("bookingFromTime")||"",bookingToTime:oe("bookingToTime")||"",siteId:oe("siteId")||"",geoLocation:oe("geoLocation")||null};D(Pn("savedUI",e));try{sessionStorage.setItem("ADS:session:"+(oe("siteId")||"last"),JSON.stringify(e))}catch(e){}}catch(e){}},[]);const ue=te("startDate"),ce=te("endDate"),de=te("bookingFromTime"),pe=te("bookingToTime"),fe=te("siteId");n.useEffect(()=>{P.current||(fe&&q(fe,{mdmsCards:m,adsList:T,adsScheduleMap:S,placeNameState:A,globalScheduleEnabled:!!k,startDate:ue||"",endDate:ce||"",bookingFromTime:de||"",bookingToTime:pe||""}),k&&$({globalScheduleEnabled:!!k,startDate:ue||"",endDate:ce||"",bookingFromTime:de||"",bookingToTime:pe||""}))},[m,T,S,A,fe,k,ue,ce,de,pe]);const me=new Date;me.getTime(),me.setMinutes(me.getMinutes()-me.getTimezoneOffset()),me.setDate(me.getDate()+1);const ve=(()=>{const e=new Date;return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e.setDate(e.getDate()+1),e.toISOString().slice(0,10)})();let ge;if(ue){const e=new Date(ue);e.setDate(e.getDate()),ge=e.toISOString().slice(0,10)}Q(e=>{null!==w&&w>=0?(C(t=>t.map((t,n)=>n===w?e:t)),I(null)):C(t=>[...t,e]),ne(c({},Z,{bookingFromTime:H,bookingToTime:H})),_("")});const he=Q(e=>{if(Object.keys(N).length>0)return void alert("Please fix all schedule errors before proceeding.");const t=m.flatMap(e=>(e.schedules||[]).map(t=>{var n,r;const[o,a=H]=(t.startDatetime||"").split("T"),[i,l=H]=(t.endDatetime||"").split("T");return{addType:e.adType||"",bookingDate:o||"",endDate:i||"",bookingFromTime:a||H,bookingToTime:l||H,advertisementId:(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.name||"",geoLocation:e.geoLocation||M(L(e.locationCode))||"",faceArea:(e.width||"")+"x"+(e.height||""),location:e.locationCode||"",status:"BOOKING_CREATED",availabilityStatus:!1===e.available?"UNAVAILABLE":"AVAILABLE",amount:e.amount||""}})),n=[...T,...t].map(e=>{var t,n,r,o,a,i;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType||e.addType||"",bookingDate:e.bookingDate||e.startDate||"",endDate:e.endDate||e.endDate||"",bookingFromTime:e.bookingFromTime||"",bookingToTime:e.bookingToTime||"",advertisementId:e.advertisementId||e.siteId||(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:e.cartId||e.cartId||e.siteId||(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.cartAddress||e.name||"",geoLocation:e.geoLocation||(null!==(o=e.geoLocation)&&void 0!==o&&o.code?e.geoLocation.code:"")||"",faceArea:e.faceArea||(null!==(a=e.size)&&void 0!==a&&a.code?e.size.code:"")||"",location:e.location||e.locationCode||e.siteId||(null!==(i=e.siteName)&&void 0!==i&&i.code?e.siteName.code:"")||"",status:"BOOKING_CREATED",availabilityStatus:e.availabilityStatus||(!1===e.available?"UNAVAILABLE":"AVAILABLE")||"",rate:e.amount||""}}),r=G();let a=[];const i=te("siteId")||oe("siteId");r.forEach(e=>{e&&e.siteId&&String(e.siteId)!==String(i)&&(a=a.concat((e=>{if(!e)return[];const{mdmsCards:t=[],adsList:n=[]}=e,r=t.flatMap(e=>(e.schedules||[]).map(t=>{var n,r;const[o,a=H]=(t.startDatetime||"").split("T"),[i,l=H]=(t.endDatetime||"").split("T");return{addType:e.adType||"",bookingDate:o||"",endDate:i||"",bookingFromTime:a||H,bookingToTime:l||H,advertisementId:(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.name||"",geoLocation:e.geoLocation||e.geoLocation||"",faceArea:(e.width||"")+"x"+(e.height||""),location:e.locationCode||"",status:"BOOKING_CREATED",availabilityStatus:!1===e.available?"UNAVAILABLE":"AVAILABLE",amount:e.amount||""}}));return[...(n||[]).map(e=>{var t,n,r,o,a,i;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType||e.addType||"",bookingDate:e.bookingDate||e.startDate||"",endDate:e.endDate||e.endDate||"",bookingFromTime:e.bookingFromTime||"",bookingToTime:e.bookingToTime||"",advertisementId:e.advertisementId||e.siteId||(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:e.cartId||e.siteId||(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.cartAddress||e.name||"",geoLocation:e.geoLocation||(null!==(o=e.geoLocation)&&void 0!==o&&o.code?e.geoLocation.code:"")||"",faceArea:e.faceArea||(null!==(a=e.size)&&void 0!==a&&a.code?e.size.code:"")||"",location:e.location||e.locationCode||e.siteId||(null!==(i=e.siteName)&&void 0!==i&&i.code?e.siteName.code:"")||"",status:"BOOKING_CREATED",availabilityStatus:e.availabilityStatus||(!1===e.available?"UNAVAILABLE":"AVAILABLE")||"",rate:e.amount||""}}),...r]})(e)))});const l=new Map,s=e=>{const t=(e.advertisementId||"")+"::"+(e.cartId||"")+"::"+(e.bookingDate||"");return!l.has(t)&&(l.set(t,!0),!0)},u=[];n.forEach(e=>{s(e)&&u.push(e)}),a.forEach(e=>{s(e)&&u.push(e)});const c={cartDetails:u,cartAddress:e.cartAddress,savedUI:{mdmsCards:m,adsList:T,adsScheduleMap:S,placeNameState:A,globalScheduleEnabled:k,startDate:oe("startDate")||"",endDate:oe("endDate")||"",bookingFromTime:oe("bookingFromTime")||"",bookingToTime:oe("bookingToTime")||"",siteId:oe("siteId")||"",geoLocation:oe("geoLocation")||null}};i&&q(i,{mdmsCards:m,adsList:T,adsScheduleMap:S,placeNameState:A,globalScheduleEnabled:!!k,startDate:oe("startDate")||"",endDate:oe("endDate")||"",bookingFromTime:oe("bookingFromTime")||"",bookingToTime:oe("bookingToTime")||"",geoLocation:oe("geoLocation")}),D(Pn("savedUI",c.savedUI)),o(c)});return n.useEffect(()=>{S&&0!==m.length&&v(e=>e.map(e=>{var t,n,r,o,a,i,l,s,u;const d=null!=(t=e.mdmsId)?t:e.id,p=S[d]||S[String(d)];if(!p)return e;const f=p.startDate&&p.startTime?p.startDate+"T"+p.startTime:(null===(n=e.schedules)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.startDatetime)||"",m=p.endDate&&p.endTime?p.endDate+"T"+p.endTime:(null===(o=e.schedules)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.endDatetime)||"",v=(null===(i=e.schedules)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.startDatetime)||"",g=(null===(s=e.schedules)||void 0===s||null===(u=s[0])||void 0===u?void 0:u.endDatetime)||"";return v===f&&g===m?e:c({},e,{schedules:[{startDatetime:f,endDatetime:m}]})}))},[S]),r.createElement(r.Fragment,null,r.createElement("form",{onSubmit:Q(he)},r.createElement("div",null,r.createElement(t.CardLabel,null,"Search By site id ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:J,name:"siteId",rules:{validate:e=>0!==((null==m?void 0:m.length)||0)||0!==((null==T?void 0:T.length)||0)||e&&""!==String(e).trim()?!(e&&String(e).length>100)||"Maximum 100 characters":"This field is required"},render:e=>{if(f)return r.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur});const n=F.map(e=>c({},e,{label:e.label})),o=n.find(t=>String(t.code)===String(e.value))||null;return r.createElement(t.Dropdown,{key:U,className:"form-field",option:n,optionKey:"label",selected:o,select:t=>{if(!t)return;const n=String(t.code||"");e.onChange(n);const r=p.filter(e=>String(e.locationCode)===String(t.code));h(r||[]);const o=W(n),a=Y(),i=a&&a.globalScheduleEnabled;o?(v(Array.isArray(o.mdmsCards)?o.mdmsCards:[]),C(Array.isArray(o.adsList)?o.adsList:[]),b(o.adsScheduleMap||{}),o&&void 0!==o.globalScheduleEnabled&&(i?(a.startDate&&ee("startDate",a.startDate,{shouldValidate:!1}),a.endDate&&ee("endDate",a.endDate,{shouldValidate:!1}),a.bookingFromTime&&ee("bookingFromTime",a.bookingFromTime,{shouldValidate:!1}),a.bookingToTime&&ee("bookingToTime",a.bookingToTime,{shouldValidate:!1}),O(!0),X()):(O(!!o.globalScheduleEnabled),o.startDate&&ee("startDate",o.startDate,{shouldValidate:!1}),o.endDate&&ee("endDate",o.endDate,{shouldValidate:!1}),o.bookingFromTime&&ee("bookingFromTime",o.bookingFromTime,{shouldValidate:!1}),o.bookingToTime&&ee("bookingToTime",o.bookingToTime,{shouldValidate:!1}),o.globalScheduleEnabled&&X()))):(v([]),C([]),b({}));const l=L(t.code),s=M(l);s?(ee("geoLocation",s,{shouldValidate:!0,shouldDirty:!0}),_(s.formattedAddress),te("cartAddress")||ee("cartAddress",s.formattedAddress)):(ee("geoLocation",null,{shouldValidate:!1}),_(""))}})}}),re.siteId&&r.createElement("p",{style:{color:"red"}},re.siteId.message),r.createElement("div",{style:{margin:"12px 0",padding:8,border:"1px solid #eee",borderRadius:6}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8}},r.createElement("label",{style:{fontWeight:600,marginRight:8}},r.createElement("input",{type:"checkbox",checked:k,onChange:e=>ie(e.target.checked)})," ",l?l("USE_SAME_BOOKING_DATETIME_FOR_ALL_ADS"):"Use same booking date/time for all ads"),k&&r.createElement("div",{style:{color:"#666",fontSize:12}},"Global schedule applied — individual times disabled")),r.createElement(t.CardLabel,null,"Global Start Date & Time"),r.createElement(i.Controller,{control:J,name:"startDate",rules:{required:!!k&&"This field is required"},render:e=>{const t=te("bookingFromTime")||H,n=e.value?e.value+"T"+t:"",o=B("");return r.createElement("input",{type:"datetime-local",min:ve+"T00:00",value:n,placeholder:o,onChange:t=>{const n=t.target.value;if(!n)return e.onChange(""),void ee("bookingFromTime","");const[r,o]=n.split("T");e.onChange(r),ee("bookingFromTime",o),k&&X()},onBlur:t=>e.onBlur(t)})}}),re.startDate&&r.createElement("p",{style:{color:"red"}},re.startDate.message),r.createElement(t.CardLabel,null,"Global End Date & Time"),r.createElement(i.Controller,{control:J,name:"endDate",rules:{required:!!k&&"This field is required"},render:e=>{const t=te("bookingToTime")||H,n=te("startDate")||ve,o=e.value?e.value+"T"+t:"",a=B("");return r.createElement("input",{type:"datetime-local",min:n+"T00:00",value:o,placeholder:a,onChange:t=>{const n=t.target.value;if(!n)return e.onChange(""),void ee("bookingToTime","");const[r,o]=n.split("T");e.onChange(r),ee("bookingToTime",o),k&&X()},onBlur:t=>e.onBlur(t)})}}),re.endDate&&r.createElement("p",{style:{color:"red"}},re.endDate.message),r.createElement(i.Controller,{control:J,name:"bookingFromTime",rules:{required:!!k&&"Start time is required"},render:e=>r.createElement("input",{type:"hidden",value:e.value||"",onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})}),r.createElement(i.Controller,{control:J,name:"bookingToTime",rules:{required:!!k&&"End time is required",validate:e=>{if(!k)return!0;const t=oe("startDate")||"",n=oe("endDate")||"",r=oe("bookingFromTime")||"";return((e,t)=>{if(!e||!t)return"Please choose both start and end date/time.";const[n,r=""]=e.split("T"),[o,a=""]=t.split("T");return n<ve||o<ve?"Dates must be "+ve+" (tomorrow) or later.":n===o&&a<=r?"End time must be later than start time when same day.":null})(t&&r?t+"T"+r:"",n&&e?n+"T"+e:"")||!0}},render:e=>r.createElement("input",{type:"hidden",value:e.value||"",onChange:t=>e.onChange(t.target.value),onBlur:t=>{e.onBlur(t),k&&ae("bookingToTime")}})}),re.bookingToTime&&r.createElement("p",{style:{color:"red"}},re.bookingToTime.message)),g.length>0&&r.createElement("div",{style:{margin:"12px 0"}},r.createElement("div",{style:{fontWeight:600,marginBottom:8}},l?l("ADS_IN_SELECTED_LOCATION"):"Advertisements in selected location"),r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:12}},g.slice(0,y).map((e,t)=>{var n,o,a,i,s,u,d,p;return r.createElement("div",{key:t,style:{width:280,border:"1px solid #eee",borderRadius:8,padding:8,boxShadow:"0 1px 3px rgba(0,0,0,0.04)",background:"#fff",display:"flex",flexDirection:"column",gap:8}},r.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},e.imageSrc?r.createElement("img",{src:e.imageSrc,alt:e.name,loading:"lazy",style:{width:"100%",height:140,objectFit:"cover",borderRadius:6}}):r.createElement("div",{style:{width:"100%",height:140,background:"#f5f5f5",borderRadius:6}})),r.createElement("div",{style:{paddingTop:4}},r.createElement("div",{style:{fontSize:14,fontWeight:700,lineHeight:"1.1"}},e.name||"Ad "+e.id),r.createElement("div",{style:{marginTop:6,fontSize:12,color:"#666",display:"grid",gridTemplateColumns:"auto 1fr",gap:"4px 8px"}},r.createElement("div",{style:{fontWeight:600}},"ID:"),r.createElement("div",null,e.id),r.createElement("div",{style:{fontWeight:600}},"Pole No:"),r.createElement("div",null,e.poleNo),r.createElement("div",{style:{fontWeight:600}},"Type:"),r.createElement("div",null,e.adType),r.createElement("div",{style:{fontWeight:600}},"Size:"),r.createElement("div",null,e.width," x ",e.height),r.createElement("div",{style:{fontWeight:600}},"Amount:"),r.createElement("div",null,"₹",e.amount),r.createElement("div",{style:{fontWeight:600}},"Available:"),r.createElement("div",null,String(e.available)))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:6}},r.createElement("div",{style:{fontSize:11,color:"#666"}},"Start"),r.createElement("div",{style:{display:"flex",gap:6}},r.createElement("input",{type:"date",min:ve,value:(null===(n=S[e.id])||void 0===n?void 0:n.startDate)||k&&oe("startDate")||"",onChange:t=>{if(k)return;const n=t.target.value,r=S[e.id]||{},o=r.endDate,a=c({},r||{},{startDate:n,endDate:o&&o<n?n:o});b(t=>c({},t,{[e.id]:a})),V(e.id,a)},disabled:k,style:{flex:1,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}}),r.createElement("input",{type:"time",value:(null===(o=S[e.id])||void 0===o?void 0:o.startTime)||k&&oe("bookingFromTime")||"",onChange:t=>{if(k)return;const n=c({},S[e.id]||{}||{},{startTime:t.target.value});b(t=>c({},t,{[e.id]:n})),V(e.id,n)},disabled:k,style:{width:100,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}})),r.createElement("div",{style:{height:8}}),r.createElement("div",{style:{fontSize:11,color:"#666"}},"End"),r.createElement("div",{style:{display:"flex",gap:6}},r.createElement("input",{type:"date",min:k?oe("startDate")||ve:(null===(a=S[e.id])||void 0===a?void 0:a.startDate)||ve,value:(null===(i=S[e.id])||void 0===i?void 0:i.endDate)||k&&oe("endDate")||"",onChange:t=>{if(k)return;const n=t.target.value,r=S[e.id]||{},o=c({},r||{},{endDate:r.startDate&&n<r.startDate?r.startDate:n});b(t=>c({},t,{[e.id]:o})),V(e.id,o)},disabled:k,style:{flex:1,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}}),r.createElement("input",{type:"time",value:(null===(s=S[e.id])||void 0===s?void 0:s.endTime)||k&&oe("bookingToTime")||"",onChange:t=>{if(k)return;const n=c({},S[e.id]||{}||{},{endTime:t.target.value});b(t=>c({},t,{[e.id]:n})),V(e.id,n)},disabled:k,style:{width:100,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}})),r.createElement("div",{style:{fontSize:11,color:"#666",marginTop:4}},"Hint: pick date & time (min: tomorrow)"),N[e.id]&&r.createElement("div",{style:{color:"red",fontSize:12,marginTop:6}},N[e.id])),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:6}},r.createElement("div",null,m.find(t=>String(t.mdmsId)===String(e.id))?r.createElement("button",{type:"button",onClick:()=>v(t=>t.filter(t=>String(t.mdmsId)!==String(e.id))),style:{padding:"6px 10px",borderRadius:6,border:"1px solid #d0d0d0",background:"#fff",cursor:"pointer"}},l?l("Remove"):"Remove"):r.createElement("button",{type:"button",onClick:()=>{const t=k?{startDate:oe("startDate")||"",startTime:oe("bookingFromTime")||"",endDate:oe("endDate")||"",endTime:oe("bookingToTime")||""}:S[e.id]||{},n=t.startDate&&t.startTime?t.startDate+"T"+t.startTime:"",r=t.endDate&&t.endTime?t.endDate+"T"+t.endTime:"";if(!n||!r)return void alert("Please fill both start and end date & time before adding.");if(void 0!==ve&&(t.startDate<ve||t.endDate<ve))return void alert("Dates must be from "+ve+" or later.");const o=new Date(n);if(new Date(r)<=o)return void alert("End date/time must be after start date/time.");if(N[e.id])return void alert(N[e.id]);const a=L?L(e.locationCode):null,i=a?M(a):e.locationCode,l={mdmsId:e.id,poleNo:e.poleNo,name:e.name,adType:e.adType,width:e.width,height:e.height,amount:e.amount,available:e.available,locationCode:e.locationCode,geoLocation:i,schedules:[{startDatetime:n,endDatetime:r}],addedByUser:!0};v(e=>[...e,l])},disabled:!!N[e.id],style:{padding:"6px 10px",borderRadius:6,border:"none",background:N[e.id]?"#ccc":"#0b74de",color:"#fff",cursor:N[e.id]?"not-allowed":"pointer"}},l?l("Add"):"Add")),r.createElement("div",null,m.find(t=>String(t.mdmsId)===String(e.id))&&r.createElement("span",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"green",fontWeight:700}},r.createElement("span",{style:{fontSize:14}},"✔"),r.createElement("span",null,l?l("Added"):"Added")))),(null===(u=m.find(t=>String(t.mdmsId)===String(e.id)))||void 0===u||null===(d=u.schedules)||void 0===d?void 0:d.length)>0&&r.createElement("div",{style:{marginTop:8,fontSize:12,color:"#333"}},((null===(p=m.find(t=>String(t.mdmsId)===String(e.id)))||void 0===p?void 0:p.schedules)||[]).map((e,t)=>r.createElement("div",{key:t,style:{color:"#666"}},r.createElement("strong",null,0===t?"Schedule":"Schedule "+(t+1)),": ",B(e.startDatetime)," →"," ",B(e.endDatetime)))))})),y<g.length&&r.createElement("div",{style:{marginTop:12,textAlign:"center"}},r.createElement("button",{onClick:()=>E(e=>e+6),type:"button",style:{padding:"8px 12px",borderRadius:6,border:"1px solid #ccc",background:"#fff",cursor:"pointer"}},l?l("Show more"):"Show more"))),r.createElement(t.CardLabel,null,"Geo Location ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:J,name:"geoLocation",rules:{required:"This field is required",validate:e=>e&&(e.latitude||e.lat)&&(e.longitude||e.lng)||"Please pick a location"},render:e=>r.createElement(ot,{value:e.value,onChange:t=>{e.onChange(t),_((null==t?void 0:t.formattedAddress)||"")},onBlur:e.onBlur,t:l})}),re.geoLocation&&r.createElement("p",{style:{color:"red"}},re.geoLocation.message)),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},Un=e=>{let{t:o,goNext:a,currentStepData:l,onGoBack:s}=e;const{control:u,handleSubmit:c,setValue:d,watch:p,formState:{errors:f}}=i.useForm({defaultValues:{penalty:"No",penaltyAmount:"",referenceId:""}}),m=p("penalty");return n.useEffect(()=>{l&&Object.entries(l).forEach(e=>{let[t,n]=e;d(t,null!=n?n:"")})},[l,d]),r.createElement("form",{onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),a(e)})},r.createElement(t.CardLabel,null,o("Penalty")),r.createElement(i.Controller,{name:"penalty",control:u,render:e=>r.createElement("div",{style:{display:"flex",gap:"20px"}},r.createElement("label",null,r.createElement("input",{type:"radio",value:"Yes",checked:"Yes"===e.value,onChange:()=>e.onChange("Yes")})," ","Yes"),r.createElement("label",null,r.createElement("input",{type:"radio",value:"No",checked:"No"===e.value,onChange:()=>e.onChange("No")})," ","No"))}),r.createElement(t.CardLabel,null,o("Penalty Amount")),r.createElement(i.Controller,{name:"penaltyAmount",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.penaltyAmount&&r.createElement("p",{style:{color:"red"}},f.penaltyAmount.message),r.createElement(t.CardLabel,null,o("Reference ID")),r.createElement(i.Controller,{name:"referenceId",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.referenceId&&r.createElement("p",{style:{color:"red"}},f.referenceId.message),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:"white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),s(e)})}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))},zn=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSSiteMaster",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"null"}]}],qn=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"SITE_MASTER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteMasterFormStepOne",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]),Wn=[{i18nKey:"ADS_AVAILABLE",code:"AVAILABLE",name:"Available"},{i18nKey:"ADS_UNAVAILABLE",code:"UNAVAILABLE",name:"Unavailable"}],Vn=e=>{let{goNext:o,currentStepData:a,t:l}=e;const u=Digit.ULBService.getStateId(),{data:d=[]}=Digit.Hooks.ads.useADSAllMDMS(u);console.log("mdmsdata is :>> ",d);const p=new Date;p.setMinutes(p.getMinutes()-p.getTimezoneOffset());const f=p.toISOString().slice(11,16),m=window.location.href.includes("citizen");console.log("isCitizen",m);const v={siteId:"",siteName:"",geoLocation:null,cartAddress:"",size:"",advertisementType:"",availabilityStatus:"",gstApplicable:!1,cowCessApplicable:!1,rate:""},{control:g,handleSubmit:h,setValue:y,watch:E,reset:S,formState:{errors:b}}=i.useForm({defaultValues:v}),D=(new Date).getTime(),A=e=>{var t;const n=N[e];n&&(S(c({},v,n,{bookingFromTime:n.bookingFromTime||f,bookingToTime:n.bookingToTime||f})),I(e),C((null===(t=n.geoLocation)||void 0===t?void 0:t.formattedAddress)||""))},_=s.useDispatch(),[T,C]=n.useState(""),[N,x]=n.useState([]),[w,I]=n.useState(null),L=h(e=>{null!==w&&w>=0?(x(t=>t.map((t,n)=>n===w?e:t)),I(null)):x(t=>[...t,e]),S(c({},v,{bookingFromTime:f,bookingToTime:f})),C("")});return n.useEffect(()=>{console.log("currentStepData",a);const e=(null==a?void 0:a.siteDetails)||a;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;y(t,n)}),e.bookingFromTime||y("bookingFromTime",f),e.bookingToTime||y("bookingToTime",f))},[a,y]),n.useEffect(()=>{var e;const t=E("siteName");!t||!t.geo_tag||E("geoLocation")&&null!==(e=E("geoLocation"))&&void 0!==e&&e.latitude||(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!1}),C(t.name))},[E("siteName")]),r.createElement(r.Fragment,null,N.length>0&&r.createElement("div",{style:{margin:"12px 0",padding:8,border:"1px dashed #ddd",borderRadius:6}},r.createElement("div",{style:{fontWeight:600,marginBottom:8}},l?l("Added Advertisements"):"Added Advertisements"),N.map((e,t)=>{var n,o,a;return r.createElement("div",{key:t,style:{display:"flex",justifyContent:"space-between",gap:8,alignItems:"center",padding:"6px 0",borderBottom:t<N.length-1?"1px solid #eee":"none",cursor:"pointer",background:w===t?"#fafafa":"transparent",paddingRight:12}},r.createElement("div",{onClick:()=>A(t),style:{flex:1}},r.createElement("div",{style:{fontSize:13,fontWeight:500}},(null===(n=e.siteName)||void 0===n?void 0:n.name)||e.siteId||"Ad "+(t+1)),r.createElement("div",{style:{fontSize:12,color:"#666"}},e.cartAddress||(null===(o=e.geoLocation)||void 0===o?void 0:o.formattedAddress)||(null!==(a=e.geoLocation)&&void 0!==a&&a.latitude?e.geoLocation.latitude+", "+e.geoLocation.longitude:""))),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement("button",{type:"button",onClick:()=>A(t),style:{background:"#fff",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Edit"):"Edit"),r.createElement("button",{type:"button",onClick:()=>{return e=t,x(t=>t.filter((t,n)=>n!==e)),void(w===e?(I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),C("")):null!==w&&w>e&&I(e=>null!==e?e-1:null));var e},style:{background:"transparent",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Remove"):"Remove")))})),r.createElement("form",{onSubmit:h(function(e){try{var t,n,r,i,l,s,u,d,p,g,h;const y=m?"pb.amritsar":"pb.testing",E=(null==a||null===(t=a.ownerDetails)||void 0===t?void 0:t.address)||{},b=[...N,e],A={addressLine1:E.addressline1||E.addressLine1||"",city:(null===(n=E.city)||void 0===n?void 0:n.name)||E.city||"",cityCode:E.cityCode||(null===(r=E.city)||void 0===r?void 0:r.code)||"",houseNo:E.houseNo||"",landmark:E.landmark||"",locality:(null===(i=E.locality)||void 0===i?void 0:i.code)||E.locality||"",localityCode:E.localityCode||(null===(l=E.locality)||void 0===l?void 0:l.code)||"",pincode:E.pincode||"",streetName:E.streetName||""},T={tenantId:y,applicationDate:D,bookingStatus:"BOOKING_CREATED",address:A,applicantDetail:{applicantName:((null==a||null===(s=a.ownerDetails)||void 0===s?void 0:s.firstName)||"")+" "+((null==a||null===(u=a.ownerDetails)||void 0===u?void 0:u.lastName)||""),applicantEmailId:(null==a||null===(d=a.ownerDetails)||void 0===d?void 0:d.emailId)||"",applicantMobileNo:(null==a||null===(p=a.ownerDetails)||void 0===p?void 0:p.mobileNumber)||"",selfDeclaration:(null==a||null===(g=a.ownerDetails)||void 0===g?void 0:g.selfDeclaration)||!0,applicantDetailId:"",SGST:(null==a||null===(h=a.ownerDetails)||void 0===h?void 0:h.SGST)||""}||{},additional_details:"geolocation , siteName, SGST, selfDeclaration , endDate ,",cartDetails:b.map(e=>{var t,n,r,o,a;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType,bookingDate:e.startDate,endDate:e.endDate,bookingFromTime:e.bookingFromTime,bookingToTime:e.bookingToTime,advertisementId:e.siteId||"",cartId:e.siteId||"",cartAddress:e.cartAddress||"",geoLocation:(null===(n=e.geoLocation)||void 0===n?void 0:n.code)||e.geoLocation,faceArea:(null===(r=e.size)||void 0===r?void 0:r.code)||e.size,location:(null===(o=e.siteName)||void 0===o?void 0:o.code)||e.siteName||"",status:"BOOKING_CREATED",availabilityStatus:(null===(a=e.availabilityStatus)||void 0===a?void 0:a.code)||e.availabilityStatus||"",rate:e.rate||""}}),documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}};console.log("formData",T),_(Pn("applicantDetail",T.applicantDetail)),_(Pn("cartDetails",T.cartDetails)),_(Pn("cartAddress",e.cartAddress)),_(Pn("siteDetails",e)),_(Pn("siteId",e.siteId)),_(Pn("siteName",e.siteName)),_(Pn("bookingFromTime",e.bookingFromTime)),_(Pn("bookingToTime",e.bookingToTime));const C={draft:!0,bookingApplication:T};console.log("ADS Create payload:",{bookingApplication:T});const w=Ze(function(){const e={bookingApplication:T};return console.log("Sending payload:",JSON.stringify(e,null,2)),Promise.resolve(Digit.ADSServices.create(e,y)).then(function(e){var t;console.log("Received response:",JSON.stringify(e,null,2));const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){console.log("ADS create successfull");const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;_(Pn("CreatedResponse",t||e)),x([]),I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),o(e)}else console.error("ADS create failed:",e),_(Pn("CreatedResponse",{draft:!0,bookingApplication:T})),o(c({},C,{draft:!0}))})},function(e){console.error("ADS create error:",e),_(Pn("CreatedResponse",{draft:!0,bookingApplication:T})),o(c({},C,{draft:!0}))});return Promise.resolve(w&&w.then?w.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",null,r.createElement(t.CardLabel,null,"Enter site id ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"siteId",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteId&&r.createElement("p",{style:{color:"red"}},b.siteId.message),r.createElement(t.CardLabel,null,"Site Name ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"siteName",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{className:"form-field",select:t=>{e.onChange(t),t&&t.geo_tag&&t.geo_tag.latitude&&t.geo_tag.longitude&&(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!0,shouldDirty:!0}),C(t.name),E("cartAddress")||y("cartAddress",t.name))},onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteName&&r.createElement("p",{style:{color:"red"}},b.siteName.message),r.createElement(t.CardLabel,null,"Geo Location ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"geoLocation",rules:{required:"This field is required",validate:e=>e&&(e.latitude||e.lat)&&(e.longitude||e.lng)||"Please pick a location"},render:e=>r.createElement(ot,{value:e.value,onChange:t=>{e.onChange(t),C((null==t?void 0:t.formattedAddress)||"")},onBlur:e.onBlur,t:l})}),b.geoLocation&&r.createElement("p",{style:{color:"red"}},b.geoLocation.message),r.createElement(t.CardLabel,null,"Address ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"cartAddress",rules:{required:"This field is required",pattern:{value:/^(?=.*[a-zA-Z]).*$/,message:"Enter valid address , atleast one letter must be present"},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>r.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.cartAddress&&r.createElement("p",{style:{color:"red"}},b.cartAddress.message),r.createElement(t.CardLabel,null,"Size ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"height",rules:{required:"Height is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"height"})}}),b.height&&r.createElement("p",{style:{color:"red"}},b.height.message),r.createElement(i.Controller,{control:g,name:"width",rules:{required:"Width is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"width"})}}),b.width&&r.createElement("p",{style:{color:"red"}},b.width.message),r.createElement(t.CardLabel,null,"Advertisement Type ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"advertisementType",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:d,optionKey:"adType"})}),b.advertisementType&&r.createElement("p",{style:{color:"red"}},b.advertisementType.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Rate / Price of the site (₹) ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"rate",rules:{pattern:{value:/^(?!.*[eE])[0-9]+(\.[0-9]{1,2})?$/,message:"Enter a valid amount"},maxLength:{value:12,message:"Maximum 12 characters"},required:"This field is required"},render:e=>r.createElement(t.TextInput,{type:"number",step:"0.01",min:"0",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t)})}),b.rate&&r.createElement("p",{style:{color:"red"}},b.rate.message),r.createElement(t.CardLabel,null,"Availability Status ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"availabilityStatus",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Wn,optionKey:"i18nKey"})}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.availabilityStatus.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"GST Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"gstApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"gstApplicable"}),r.createElement("label",{htmlFor:"gstApplicable",style:{marginLeft:8}},"Yes"))}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.gstApplicable.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Cow Cess Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(i.Controller,{control:g,name:"cowCessApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"cowCessApplicable"}),r.createElement("label",{htmlFor:"cowCessApplicable",style:{marginLeft:8}},"Yes"))}),b.cowCessApplicable&&r.createElement("p",{style:{color:"red"}},b.cowCessApplicable.message)),r.createElement("div",{style:{margin:"12px 0"}},r.createElement("button",{type:"button",onClick:L,style:{background:"#f1f1f1",border:"1px solid #ccc",padding:"8px 12px",borderRadius:4,cursor:"pointer"}},null!==w?l?l("Save Site"):"Save Site":l?l("Add Site"):"Add Site")),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},Gn=[{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:1,body:[{route:"documents",component:"ADSSiteInspection",withoutLabel:!0,key:"documents",type:"component",nextStep:"null"}]}],Kn=(window.location.href.includes("employee"),[{head:"ES_TITILE_DOCUMENT_DETAILS",stepLabel:"ES_TITILE_SITE_INSPECTION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteInspectionStepperFormOne",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]);function $n(e){var o;let{t:a,document:i,setDocuments:l,setError:s,documents:u,action:d,formData:p,handleSubmit:f,id:m}=e;const v=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?c({},v,{active:!0===(null==i?void 0:i.active),code:null==v?void 0:v.documentType}):1===(null==i||null===(o=i.dropdownData)||void 0===o?void 0:o.length)?null==i?void 0:i.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[D,A]=n.useState(()=>(null==v?void 0:v.fileName)||null),{dropdownData:_}=i;var T=_;const[C,N]=n.useState(!1);C&&A(null);const[x,w]=n.useState(!1),I=["image/jpeg","image/png","application/pdf"],L=[".jpeg",".jpg",".png",".pdf"];return n.useEffect(()=>{null!=g&&g.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==S?void 0:S.length)||null===S?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S))||[],{documentType:null==g?void 0:g.code,fileStoreId:S,documentDetailId:S,fileName:D||(null==v?void 0:v.fileName)||null,mimeType:(null==y?void 0:y.type)||null,size:(null==y?void 0:y.size)||null}]})},[S,D,g]),n.useEffect(()=>{(null==u?void 0:u.length)>0&&f()},[u]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==i?void 0:i.code))[0],r=null==T?void 0:T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(h(r),b(null==n?void 0:n.fileStoreId),A((null==n?void 0:n.fileName)||null)):N(!0)}},[]),n.useEffect(()=>{var e;null!=i&&i.hasDropdown||h({code:null==i?void 0:i.code,i18nKey:null==i||null===(e=i.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{s(null),function(){if(y){if(w(!0),!(y.type&&I.includes(y.type)||L.some(e=>{var t;return null===(t=y.name)||void 0===t?void 0:t.toLowerCase().endsWith(e)})))return w(!1),b(null),void s(a("CS_FILE_TYPE_NOT_ALLOWED")||"Only PDF, JPG, JPEG, and PNG files are allowed.");if(y.size>=5242880)return w(!1),b(null),void s(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));const e=Ze(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),s(a("CS_FILE_UPLOAD_ERROR"))});e&&e.then&&e.then(function(){})}}()}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{C&&b(null)},[C]),r.createElement("div",{style:{marginBottom:"24px"}},x&&r.createElement(t.Loader,null),(null==i?void 0:i.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==i?void 0:i.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *")),r.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:a})),!(null!=i&&i.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==i?void 0:i.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *"))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];E(n),A((null==n?void 0:n.name)||null)},onDelete:()=>{b(null),A(null),s&&s(null)},id:m,message:S?""+(D||(null==v?void 0:v.fileName)||"1 "+a("CS_ACTION_FILEUPLOADED")):a("CS_ACTION_NO_FILEUPLOADED")+" ("+(a("CS_ALLOWED_TYPES")||"PDF, JPG, JPEG, PNG")+"; ≤ 5MB)",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function Yn(e){var o;let{t:a,document:i,setDocuments:l,setError:s,documents:u,action:d,formData:p,handleSubmit:f,id:m}=e;const v=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?c({},v,{active:!0===(null==i?void 0:i.active),code:null==v?void 0:v.documentType}):1===(null==i||null===(o=i.dropdownData)||void 0===o?void 0:o.length)?null==i?void 0:i.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[D,A]=n.useState(()=>(null==v?void 0:v.fileName)||null),{dropdownData:_}=i;var T=_;const[C,N]=n.useState(!1);C&&A(null);const[x,w]=n.useState(!1),I=["image/jpeg","image/png","application/pdf"],L=[".jpeg",".jpg",".png",".pdf"];return n.useEffect(()=>{null!=g&&g.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==S?void 0:S.length)||null===S?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S))||[],{documentType:null==g?void 0:g.code,fileStoreId:S,documentDetailId:S,fileName:D||(null==v?void 0:v.fileName)||null,mimeType:(null==y?void 0:y.type)||null,size:(null==y?void 0:y.size)||null}]})},[S,D,g]),n.useEffect(()=>{(null==u?void 0:u.length)>0&&f()},[u]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==i?void 0:i.code))[0],r=null==T?void 0:T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(h(r),b(null==n?void 0:n.fileStoreId),A((null==n?void 0:n.fileName)||null)):N(!0)}},[]),n.useEffect(()=>{var e;null!=i&&i.hasDropdown||h({code:null==i?void 0:i.code,i18nKey:null==i||null===(e=i.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{s(null),function(){if(y){if(w(!0),!(y.type&&I.includes(y.type)||L.some(e=>{var t;return null===(t=y.name)||void 0===t?void 0:t.toLowerCase().endsWith(e)})))return w(!1),b(null),void s(a("CS_FILE_TYPE_NOT_ALLOWED")||"Only PDF, JPG, JPEG, and PNG files are allowed.");if(y.size>=5242880)return w(!1),b(null),void s(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));const e=Ze(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),s(a("CS_FILE_UPLOAD_ERROR"))});e&&e.then&&e.then(function(){})}}()}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{C&&b(null)},[C]),r.createElement("div",{style:{marginBottom:"24px"}},x&&r.createElement(t.Loader,null),(null==i?void 0:i.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==i?void 0:i.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *")),r.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:a})),!(null!=i&&i.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==i?void 0:i.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *"))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];E(n),A((null==n?void 0:n.name)||null)},onDelete:()=>{b(null),A(null),s&&s(null)},id:m,message:S?""+(D||(null==v?void 0:v.fileName)||"1 "+a("CS_ACTION_FILEUPLOADED")):a("CS_ACTION_NO_FILEUPLOADED")+" ("+(a("CS_ALLOWED_TYPES")||"PDF, JPG, JPEG, PNG")+"; ≤ 5MB)",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}const Xn={step:1,isValid:!1,formData:{}},Zn=function(e,t){switch(void 0===e&&(e=Xn),t.type){case"UPDATE_ADSNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_ADSNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_ADS_NEW_APPLICATION_FORM":return Xn;default:return e}},Jn={ADSCreate:e=>{var n,i,s,u;const d=l.useQueryClient(),p=a.useRouteMatch(),{t:f}=o.useTranslation(),{pathname:m}=a.useLocation(),v=a.useHistory(),g=Digit.ULBService.getStateId();let h=[];const[y,E,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:D}=Digit.Hooks.ads.useMDMS(g,"PropertyTax","CommonFieldsConfig");function A(e,t,n,r,o){if(void 0===o&&(o=!1),"owners"===e){let n=y.owners||[];n[r]=t,E(c({},y,{[e]:[...n]}))}else if("units"===e){let e=y.units||[];e=t,E(c({},y,{units:e}))}else E(c({},y,{[e]:c({},y[e],t)}));((e,t,n,r)=>{let o,a=m.split("/").pop(),i=a.charAt(a.length-1),l=!1;Number(parseInt(a))||"0"==a||"-1"==a?"-1"==a||"-2"==a?(a=m.slice(0,-3),a=a.split("/").pop(),l=!0):(a=m.slice(0,-2),a=a.split("/").pop(),l=!0):l=!1,isNaN(i)||(l=!0);let{nextStep:s={}}=h.find(e=>e.route===(a||"0")),u=v.push;if(e&&(u=v.replace),n&&(s=r),null===s)return u(p.path+"/check");o=isNaN(s.split("/").pop())&&l&&"map"!==s?p.path+"/"+s+"/"+t:p.path+"/"+s,u(o)})(n,r,o,e)}const _=()=>{},T=()=>{};if(D)return r.createElement(t.Loader,null);b=k,b.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="searchads";const C=null===(n=Digit)||void 0===n||null===(i=n.ComponentRegistryService)||void 0===i?void 0:i.getComponent("ADSCheckPage"),N=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSAcknowledgement");return r.createElement(a.Switch,null,h.map((e,t)=>{const{component:n,texts:o,inputs:i,key:l}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return r.createElement(a.Route,{path:p.path+"/"+e.route,key:t},r.createElement(s,{config:{texts:o,inputs:i,key:l},onSelect:A,onSkip:_,t:f,formData:y,onAdd:T}))}),r.createElement(a.Route,{path:p.path+"/check"},r.createElement(C,{onSubmit:function(){try{return v.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),r.createElement(a.Route,{path:p.path+"/acknowledgement"},r.createElement(N,{data:y,onSuccess:()=>{S(),d.invalidateQueries("ADS_CREATE")}})),r.createElement(a.Route,null,r.createElement(a.Redirect,{to:p.path+"/"+h.indexRoute})))},ADSSearch:e=>{var o,l;let{t:s,onSelect:u,config:d,userType:p,formData:f}=e;a.useLocation();const m=Digit.UserService.getUser().info,[v,g]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].cartDetails||(null==f||null===(o=f.adslist)||void 0===o?void 0:o.cartDetails)||[]),[h,y]=n.useState(null==f?void 0:f.adType),[E,S]=n.useState(null==f?void 0:f.location),[b,D]=n.useState(null==f?void 0:f.faceArea),[A,_]=n.useState(!0),[T,C]=n.useState(null==f?void 0:f.fromDate),[N,x]=n.useState([]),[w,I]=n.useState(null==f?void 0:f.toDate),[L,k]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].Searchdata||(null==f||null===(l=f.adslist)||void 0===l?void 0:l.Searchdata)||[]),[O,R]=n.useState(null),[P,M]=n.useState(!1),[B,F]=n.useState(""),[j,H]=n.useState((null==f?void 0:f.nightLight)||{i18nKey:"Yes",code:"Yes",value:"true"}),U=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[z,q]=n.useState(!1);let W=[],V=[],G=[];const{data:K}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"AdType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.AdType.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:$}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"Location"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.Location.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Y}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:X}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"CalculationType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.CalculationType}});K&&K.map(e=>{W.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),$&&$.map(e=>{V.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Y&&Y.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Z=Digit.Hooks.ads.useADSSlotSearch();let J={advertisementSlotSearchCriteria:[{bookingId:"",addType:L.addType,bookingStartDate:L.bookingStartDate,bookingEndDate:L.bookingEndDate,faceArea:L.faceArea,tenantId:U,location:L.location,nightLight:L.nightLight,isTimerRequired:!1}]};n.useEffect(()=>{var e;if(Z.data&&null!==(e=Z.data)&&void 0!==e&&e.advertisementSlotAvailabiltityDetails){var t;const e=null===(t=Z.data)||void 0===t?void 0:t.advertisementSlotAvailabiltityDetails.map((e,t)=>({slotId:t+1,addType:""+s(e.addType),addTypeCode:e.addType,faceAreaCode:e.faceArea,faceArea:""+s(e.faceArea),locationCode:e.location,location:""+s(e.location),nightLight:!1===e.nightLight?"No":"Yes",bookingDate:e.bookingDate,price:L.unitPrice,status:"AVAILABLE"===e.slotStaus?r.createElement("div",{className:"sla-cell-success"},"Available"):r.createElement("div",{className:"sla-cell-error"},"Booked")}));ee(t=>JSON.stringify(t)!==JSON.stringify(e)?e:t),ne(e=>e||!0)}},[Z.data,L]);const[Q,ee]=n.useState(""),[te,ne]=n.useState(!1),re=[{Header:""+s("ADS_TYPE"),accessor:"addType"},{Header:""+s("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+s("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+s("ADS_DATE"),accessor:"bookingDate"},{Header:""+s("ADS_STATUS"),accessor:"status"}],{control:oe}=i.useForm(),ae=()=>{let e,t=f.adslist&&f.adslist[0];"citizen"===p?(e=c({},t,{Searchdata:L,cartDetails:v,adsType:h,selectedLocation:E,selectedFace:b,selectNight:j,fromDate:T,toDate:w,existingDataSet:B}),u(d.key,c({},f[d.key],e),!1,0)):(e=c({},t,{Searchdata:L,cartDetails:v,adsType:h,selectNight:j,selectedLocation:E,selectedFace:b,fromDate:T,toDate:w,existingDataSet:B}),u(d.key,e,!1,0)),console.log("ownerStep",e)};n.useEffect(()=>{"citizen"===p&&ae()},[v,h,j,b,E,L]);const ie=[{id:"selection",Header:e=>r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:N.length===Q.length,onChange:()=>{if(N.length===Q.length)x([]);else{const e=Q.filter(e=>"Available"===e.status.props.children).map(e=>e.slotId);x(e)}}})),Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:N.includes(t.original.slotId),onChange:()=>(e=>{const t=Q[e].slotId;x(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(t.index),disabled:"Available"!==t.original.status.props.children}))}},...re];return n.useEffect(()=>{if(null!=f&&f.adType&&null!=f&&f.faceArea&&null!=f&&f.fromDate&&null!=f&&f.toDate&&null!=f&&f.nightLight&&null!=f&&f.location&&X){var e,t,n,r,o;let s,u=null==f||null===(e=f.location)||void 0===e?void 0:e.value;const c=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===u);if(c){var a,i,l;const e="CalculationType_"+(null==f||null===(a=f.faceArea)||void 0===a?void 0:a.code);s=null==c||null===(i=c[e])||void 0===i||null===(l=i[0])||void 0===l?void 0:l.amount}const d={addType:null==f||null===(t=f.adType)||void 0===t?void 0:t.code,faceArea:null==f||null===(n=f.faceArea)||void 0===n?void 0:n.code,location:null==f||null===(r=f.location)||void 0===r?void 0:r.code,nightLight:null==f||null===(o=f.nightLight)||void 0===o?void 0:o.value,bookingStartDate:null==f?void 0:f.fromDate,bookingEndDate:null==f?void 0:f.toDate,unitPrice:s};JSON.stringify(d)!==JSON.stringify(L)&&k(d)}},[f,X]),n.useEffect(()=>{if(O){const e=setTimeout(()=>{R(null)},1500);return()=>clearTimeout(e)}},[O]),n.useEffect(()=>{L.addType&&Z.mutate(J)},[L]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen"),r.createElement(t.FormStep,{config:d,onSelect:ae,onSkip:()=>u(),t:s},r.createElement(t.CardHeader,null,s("ADS_SEARCH_HEADER")),r.createElement(t.CardLabel,null,""+s("ADS_TYPE")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(i.Controller,{control:oe,name:"adsType",defaultValue:h,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:h,select:e=>{y(e)},placeholder:"Select Advertisement Type",option:W,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_LOCATION")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(i.Controller,{control:oe,name:"selectedLocation",defaultValue:E,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:E,select:e=>{S(e)},placeholder:"Select Ad Type",option:V,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FACE_AREA")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(i.Controller,{control:oe,name:"adsType",defaultValue:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{D(e)},placeholder:"Select Ad Type",option:G,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FROM_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"fromDate",value:T,onChange:function(e){C(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).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")}}),r.createElement(t.CardLabel,null,""+s("ADS_TO_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"toDate",value:w,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).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")}}),r.createElement(t.CardLabel,null,""+s("ADS_NIGHT_LIGHT")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.RadioButtons,{t:s,options:[{i18nKey:"Yes",code:"Yes",value:"true"},{i18nKey:"No",code:"No",value:"false"}],optionsKey:"code",name:"selectNight",value:j,selectedOption:j,innerStyles:{display:"inline-block",marginLeft:"10px",paddingBottom:"2px",marginBottom:"2px"},onSelect:H,isDependent:!0}),r.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"15px"}},r.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),onSubmit:()=>{const e=null==h?void 0:h.code,t=T,n=w,r=null==b?void 0:b.code,o=null==E?void 0:E.value,a=null==j?void 0:j.value;let i;const l=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===o);if(l){var u,c;const e="CalculationType_"+r;i=null==l||null===(u=l[e])||void 0===u||null===(c=u[0])||void 0===c?void 0:c.amount}if(h&&t&&n&&r&&o&&a){if(new Date(t)>new Date(n))return void R({error:!0,label:s("ADS_INVALID_DATE_RANGE")});k({addType:e,faceArea:r,location:o,nightLight:a,bookingStartDate:t,bookingEndDate:n,unitPrice:i})}else R({error:!0,label:s("PLEASE_FILL_ALL_FIELDS_TO_SEARCH")})}}),r.createElement(t.SubmitBar,{label:s("ADS_ADD_TO_CART"),onSubmit:()=>{if(0===N.length)return void R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=Q.filter(e=>N.includes(e.slotId)),t=v.map(e=>({slotId:e.slotId,addType:e.addType,location:e.location,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})),n=e.map(e=>({slotId:e.slotId,addTypeCode:e.addTypeCode,faceAreaCode:e.faceAreaCode,locationCode:e.locationCode,addType:e.addType,location:e.location,faceArea:e.faceArea,price:e.price,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,status:e.status.props.children}));if(n.some(e=>t.some(t=>t.addType===e.addType&&t.location===e.location&&t.faceArea===e.faceArea&&t.nightLight===e.nightLight&&t.bookingDate===e.bookingDate)))return R({error:!0,label:s("ADS_ITEM_ALREADY_IN_CART")}),void x([]);const r={};[...t,...n].forEach(e=>{const t=e.addType+"-"+e.location+"-"+e.faceArea+"-"+e.nightLight;r[t]||(r[t]=[]),r[t].push(e)});for(let e in r){const t=r[e].sort((e,t)=>e.slotId-t.slotId);for(let e=1;e<t.length;e++)if(t[e].slotId-t[e-1].slotId>1)return R({error:!0,label:s("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void x([])}g(e=>[...e,...n]),R({success:!0,label:n.length+" item(s) added to cart."}),x([])}}),r.createElement("div",null,r.createElement(t.SubmitBar,{label:s("ADS_VIEW_CART"),onSubmit:()=>{v.length>0?q(!0):R({error:!0,label:s("ADS_NO_ITEMS_IN_CART")})}})),r.createElement("div",{class:"container",style:{width:"1px"}},r.createElement("div",{style:{width:"1px",position:"relative"}},r.createElement("div",{style:{position:"absolute",right:"83px",backgroundColor:"#FFFFFF",color:"#008000",padding:"4px",borderRadius:"30px",margin:"1px 0 1px 0",width:"31px",height:"30px",textAlign:"center",transform:"translateX(100%)"}},r.createElement("div",null," ",v.length)))),z&&r.createElement(He,{onClose:()=>{q(!1)},cartDetails:v,setCartDetails:g}),r.createElement(t.SubmitBar,{label:s("ADS_BOOK_NOW"),onSubmit:()=>{0===v.length?R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")}):A?M(!0):ae()}}))),te&&r.createElement(t.Card,{style:{overflowX:"auto"}},r.createElement(Oe,{t:s,data:Q,columns:ie,getCellProps:e=>({style:{minWidth:"140px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:Q.length,style:{width:"100%",overflowX:"auto"}})),O&&r.createElement(t.Toast,{error:O.error,warning:O.warning,label:s(O.label),onClose:()=>{R(null)}}),P&&r.createElement(Be,{t:s,closeModal:()=>M(!1),actionCancelOnSubmit:()=>M(!1),onSubmit:()=>{ae(),M(!1)},setExistingDataSet:F,Searchdata:v}))},ADSCitizenDetails:e=>{var o,i,l,s,u,d,p,f,m,v,g,h,y,E,S;let{t:b,config:D,onSelect:A,userType:_,formData:T,value:C=T.adslist}=e;a.useLocation();let N=window.location.href.charAt(window.location.href.length-1),x={};const w=Digit.UserService.getUser().info,I=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),L=Digit.Hooks.ads.useADSCreateAPI(),[k,O]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].applicantName||(null==T||null===(o=T.applicant)||void 0===o?void 0:o.applicantName)||(null==C||null===(i=C.existingDataSet)||void 0===i||null===(l=i.applicant)||void 0===l?void 0:l.applicantName)||""),[R,P]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].emailId||(null==T||null===(s=T.applicant)||void 0===s?void 0:s.emailId)||(null==C||null===(u=C.existingDataSet)||void 0===u||null===(d=u.applicant)||void 0===d?void 0:d.emailId)||""),[M,B]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].mobileNumber||(null==C||null===(p=C.existingDataSet)||void 0===p||null===(f=p.applicant)||void 0===f?void 0:f.mobileNumber)||(null==T||null===(m=T.applicant)||void 0===m?void 0:m.mobileNumber)||(null==w?void 0:w.mobileNumber)),[F,j]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].alternateNumber||(null==T||null===(v=T.applicant)||void 0===v?void 0:v.alternateNumber)||(null==C||null===(g=C.existingDataSet)||void 0===g||null===(h=g.applicant)||void 0===h?void 0:h.alternateNumber)||""),H=()=>{let e=T.applicant&&T.applicant[N],t=null==C?void 0:C.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));L.mutate({bookingApplication:{tenantId:I,applicantDetail:{applicantName:k,applicantMobileNo:M,applicantAlternateMobileNo:F,applicantEmailId:R},cartDetails:t,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0},{onSuccess:t=>{var n;const r=null==t||null===(n=t.bookingApplication[0])||void 0===n?void 0:n.draftId;let o;"citizen"===_?(o=c({},e,{applicantName:k,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),A(D.key,c({},T[D.key],o),!1,N)):(o=c({},e,{applicantName:k,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),A(D.key,o,!1,N))}})};return n.useEffect(()=>{"citizen"===_&&H()},[]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ke,{currentStep:1}):null,r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(Je,{timerValues:null==C||null===(y=C.existingDataSet)||void 0===y||null===(E=y.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==C?void 0:C.cartDetails,draftId:null==C||null===(S=C.existingDataSet)||void 0===S?void 0:S.draftId})),r.createElement(Xe,null))),r.createElement(t.FormStep,{config:D,onSelect:H,onSkip:()=>A(),t:b,isDisabled:!k||!M||!R},r.createElement("div",null,r.createElement(t.CardLabel,null,""+b("ADS_APPLICANT_NAME")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",placeholder:"Enter Applicant Name",value:k,onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t)},style:{width:"EMPLOYEE"===w.type?"51.6%":null},ValidationRequired:!0},x={pattern:"^[a-zA-Z ]+$",type:"tel",title:b("CHB_NAME_ERROR_MESSAGE")})),r.createElement(t.CardLabel,null,""+b("ADS_MOBILE_NUMBER")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.MobileNumber,{value:M,name:"mobileNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Applicant Register Mobile Number",onChange:e=>function(e){B(e.target.value)}({target:{value:e}}),pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_ALT_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{value:F,name:"alternateNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Alternate Mobile Number",onChange:e=>function(e){j(e.target.value)}({target:{value:e}}),required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_EMAIL_ID")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:R,placeholder:"Enter Applicant Email Id",style:{width:"EMPLOYEE"===w.type?"51.6%":null},onChange:function(e){P(e.target.value)},ValidationRequired:!0},x={required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:b("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:Qe,ADSWFCaption:qe,LocationSearchCard:ke,NewSiteInspectionStepperForm:e=>{const i=Kn.map(e=>c({},e,{currStepConfig:Gn.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(a.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement(kn,{stepsList:i,onSubmit:e=>{console.log("dataGet===",e)},step:f,setStep:e=>{u(Mn(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},NewSiteInspectionStepperFormOne:e=>{let{config:o,onGoNext:a,onBackClick:i,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.ads.useADSDocumentsMDMS(m,"Advertisements",["Documents"]),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){var t;console.log("goNext data in NewADSStepFormThree: ",e);const n=(e=>{var t;const n=((null==e||null===(t=e.NDC)||void 0===t?void 0:t.Documents)||[]).filter(e=>null==e?void 0:e.required).map(e=>e.code);return function(e){void 0===e&&(e=[]);const t={};if(null==n||!n.length)return t;for(const o of n){var r;if(!(null===(r=e)||void 0===r?void 0:r.some(e=>{var t,n;return(null==e||null===(t=e.documentType)||void 0===t||null===(n=t.includes)||void 0===n?void 0:n.call(t,o))&&((null==e?void 0:e.filestoreId)||(null==e?void 0:e.fileStoreId))}))){t.missingRequired="ADS_MISSING_REQUIRED_DOCUMENTS";break}}return t}})(v)((null==g||null===(t=g.documents)||void 0===t?void 0:t.documents)||[]);if(null!=n&&n.missingRequired)return f("Please upload all required documents"),void d(!0);a()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!N.isEqual(t,g)),N.isEqual(t,g)||u(Pn(o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){i(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},ADSSiteInspection:e=>{var o,a,i;let{t:l,config:s,onSelect:u,formData:d}=e;Digit.ULBService.getStateId();const[p,f]=n.useState((null==d||null===(o=d.documents)||void 0===o?void 0:o.documents)||[]),[m,v]=n.useState(null),[g,h]=n.useState(!0),[y,E]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:D}=Digit.Hooks.pt.usePropertyMDMS(S,"NDC",["Documents"]),A=()=>{let e;e=c({},d.documents,{documents:p}),u(s.key,e)};return n.useEffect(()=>{var e,t;const n=(null==D||null===(e=D.NDC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>null==e?void 0:e.required))||[],r=p||[],o=n.every(e=>r.some(t=>{var n;return(null==t||null===(n=t.documentType)||void 0===n?void 0:n.includes(e.code))&&(null==t?void 0:t.fileStoreId)}));h(!(o&&!m))},[p,D,m]),r.createElement("div",null,b?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:l,config:s,onSelect:A,onSkip:()=>u(),isDisabled:g,onAdd:function(){}},null==D||null===(a=D.NDC)||void 0===a||null===(i=a.Documents)||void 0===i?void 0:i.map((e,t)=>r.createElement($n,{key:t,document:e,t:l,error:m,setError:v,setDocuments:f,documents:p,setCheckRequiredFields:E,handleSubmit:A})),m&&r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(t.Toast,{label:m,onClose:()=>v(null),error:!0}),r.createElement("button",{type:"button","aria-label":"Dismiss",onClick:()=>v(null),style:{background:"transparent",border:"none",fontSize:"18px",cursor:"pointer",lineHeight:1},title:l("CS_ACTION_CLOSE")||"Close"},"×"))))},ADSSiteMaster:Vn,NewSiteMasterFormStepOne:e=>{let{config:a,onGoNext:i}=e;const{t:l}=o.useTranslation(),u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement(Vn,{goNext:function(e){u(Pn(a.key,e)),i()},currentStepData:m,t:l}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewSiteMasterStepperForm:e=>{const i=qn.map(e=>c({},e,{currStepConfig:zn.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(a.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement(kn,{stepsList:i,onSubmit:e=>{console.log("dataGet===",e)},step:f,setStep:e=>{u(Mn(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},ADSWFReason:ze,ADSWFApplicationTimeline:Ve,ADSDocumentDetails:e=>{var o,a,i,l,s,u,d,p;let{t:f,config:m,onSelect:v,formData:g,value:h=g.adslist}=e;const[y,E]=n.useState((null==g||null===(o=g.documents)||void 0===o?void 0:o.documents)||(null==h||null===(a=h.existingDataSet)||void 0===a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[S,b]=n.useState(null),[D,A]=n.useState(!0),[_,T]=n.useState(!1),C=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),N=Digit.Hooks.ads.useADSCreateAPI(),x=Digit.ULBService.getStateId(),{isLoading:w,data:I}=Digit.Hooks.ads.useADSDocumentsMDMS(x,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==I||null===(e=I.Advertisement)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;y.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),A("0"!=t&&0!=t||!(y.length>0))},[y,_]),r.createElement("div",null,r.createElement(Ke,{currentStep:3}),r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(Je,{timerValues:null==h||null===(l=h.existingDataSet)||void 0===l||null===(s=l.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==h?void 0:h.cartDetails,draftId:null==h||null===(u=h.existingDataSet)||void 0===u?void 0:u.draftId})),r.createElement(Xe,null))),w?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:f,config:m,onSelect:()=>{var e,t,n,r,o,a,i,l,s,u,d,p,f,E,S,b,D,A,_,T,x;let w=null==h?void 0:h.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const I={bookingApplication:{tenantId:C,draftId:null==g||null===(e=g.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==g||null===(t=g.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==g||null===(n=g.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==g||null===(r=g.applicant)||void 0===r?void 0:r.alternateNumber,applicantEmailId:null==g||null===(o=g.applicant)||void 0===o?void 0:o.emailId},addressdetails:{pincode:null==g||null===(a=g.address)||void 0===a?void 0:a.pincode,city:null==g||null===(i=g.address)||void 0===i||null===(l=i.city)||void 0===l||null===(s=l.city)||void 0===s?void 0:s.name,cityCode:null==g||null===(u=g.address)||void 0===u||null===(d=u.city)||void 0===d||null===(p=d.city)||void 0===p?void 0:p.code,locality:null==g||null===(f=g.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==g||null===(S=g.address)||void 0===S||null===(b=S.locality)||void 0===b?void 0:b.code,streetName:null==g||null===(D=g.address)||void 0===D?void 0:D.streetName,addressLine1:null==g||null===(A=g.address)||void 0===A?void 0:A.addressline1,addressLine2:null==g||null===(_=g.address)||void 0===_?void 0:_.addressline2,houseNo:null==g||null===(T=g.address)||void 0===T?void 0:T.houseNo,landmark:null==g||null===(x=g.address)||void 0===x?void 0:x.landmark},documents:y,cartDetails:w,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let L;N.mutate(I),L=c({},g.documents,{documents:y}),v(m.key,L)},onSkip:()=>v(),isDisabled:D,onAdd:function(){}},r.createElement(t.CardSubHeader,null,f("ADS_PROOF_OF_DOCUMENTS")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_SIZE")),null==I||null===(d=I.Advertisement)||void 0===d||null===(p=d.Documents)||void 0===p?void 0:p.map((e,t)=>r.createElement(et,{key:t,document:e,t:f,error:S,setError:b,setDocuments:E,documents:y,setCheckRequiredFields:T})),S&&r.createElement(t.Toast,{label:S,onClose:()=>b(null),error:!0})))},ADSCheckPage:e=>{var i,l,s,u,d,f,m,v,g,h,y;let{onSubmit:E,value:S={}}=e;const{t:b}=o.useTranslation(),[D,A]=(a.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:_,isEditADS:T,isUpdateADS:C,documents:N,address:x}=S,w=T||C?"editbookad":"bookad",I=[{Header:""+b("ADS_TYPE"),accessor:"addType"},{Header:""+b("ADS_FACE_AREA"),accessor:"faceArea"},{Header:b("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,b(t?"Yes":"No"))}},{Header:""+b("ADS_DATE"),accessor:"bookingDate"},{Header:b("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>L(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],L=e=>{var t;const n=c({},D);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),A(n)},k=(null==D||null===(i=D.adslist)||void 0===i?void 0:i.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[O,R]=n.useState(!1);return r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ke,{currentStep:4}):null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,b("ADS_SUMMARY")),r.createElement(t.CardSubHeader,null,r.createElement(Je,{timerValues:null==D||null===(l=D.adslist)||void 0===l||null===(s=l.existingDataSet)||void 0===s||null===(u=s.timervalue)||void 0===u?void 0:u.timervalue,SlotSearchData:null==D||null===(d=D.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==D||null===(f=D.adslist)||void 0===f||null===(m=f.existingDataSet)||void 0===m?void 0:m.draftId}))),r.createElement("div",null,r.createElement(t.CardText,null,b("ADS_CHECK_CHECK_YOUR_ANSWERS_TEXT")),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_APPLICANT_NAME"),text:""+b(p(null==_?void 0:_.applicantName)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(p(null==_?void 0:_.mobileNumber)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(p(null==_?void 0:_.alternateNumber)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(p(null==_?void 0:_.emailId)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_ADDRESS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_HOUSE_NO"),text:""+b(p(null==x?void 0:x.houseNo)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(p(null==x?void 0:x.houseName)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(p(null==x?void 0:x.streetName)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(p(null==x?void 0:x.addressline1)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(p(null==x?void 0:x.addressline2)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(p(null==x?void 0:x.landmark)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(p(null==x||null===(v=x.city)||void 0===v||null===(g=v.city)||void 0===g?void 0:g.name)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(p(null==x||null===(h=x.locality)||void 0===h?void 0:h.i18nKey)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(p(null==x?void 0:x.pincode)),actionButton:r.createElement(nt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),r.createElement(Oe,{t:b,data:k,columns:I,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==D||null===(y=D.adslist)||void 0===y?void 0:y.cartDetails.length}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Card,null,N&&(null==N?void 0:N.documents.map((e,t)=>r.createElement(tt,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),r.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{R(!O)},styles:{height:"auto"}})),r.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:E,disabled:!O})))},ADSAcknowledgement:e=>{var n;const{state:i}=e.location,{t:l}=o.useTranslation(),s=a.useHistory(),u=null==i?void 0:i.applicationData,c=(window.localStorage.getItem("Citizen.tenant-id"),((null==s||null===(n=s.location)||void 0===n?void 0:n.pathname)||"").split("/").pop());return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:l("ADS_"+(null==u?void 0:u.applicationStatus)+"_HEADER"),applicationNumber:c,info:"REJECTED"===(null==u?void 0:u.applicationStatus)?"":l("ADS_BOOKING_NUMBER"),successful:"REJECTED"!==(null==u?void 0:u.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==u?void 0:u.applicationStatus)?r.createElement(t.CardText,null,l("ADS_"+(null==u?void 0:u.applicationStatus)+"_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/citizen")}}),r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{s.push("/digit-ui/citizen/ads-home")}}),"PENDINGPAYMENT"===(null==u?void 0:u.applicationStatus)&&r.createElement(t.SubmitBar,{label:l("COMMON_MAKE_PAYMENT"),onSubmit:()=>{s.push("/digit-ui/citizen/payment/my-bills/ADV/"+c)}}))))},ADSAddressField:ot,ADSCard:rt,ADSMyApplications:()=>{const{t:e}=o.useTranslation(),[i,l]=(Digit.UserService.getUser(),n.useState(null));let s,u,c=window.location.href.split("/").pop();isNaN(parseInt(c))?s=4:(u=c,s=parseInt(c)+50);let d=isNaN(parseInt(c))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:"pb.testing"}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:"pb.testing"};n.useEffect(()=>{l(d)},[c]);const{isLoading:p,data:f}=Digit.Hooks.ads.useADSSearch({filters:i});if(console.log("data being returned:>> ",f),p)return r.createElement(t.Loader,null);const m=(null==f?void 0:f.bookingApplication)||[];return r.createElement(n.Fragment,null,r.createElement(t.Header,null,e("ADS_MY_BOOKINGS_HEADER")+" "+(m?"("+m.length+")":"")),r.createElement("div",null,(null==m?void 0:m.length)>0&&m.map((t,n)=>r.createElement("div",{key:n},r.createElement(Et,{application:t,tenantId:"pb.testing",buttonLabel:e("ADS_SUMMARY")}))),!(null!=m&&m.length)>0&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),0!==(null==m?void 0:m.length)&&(null==f?void 0:f.count)>s&&r.createElement("div",null,r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r.createElement("span",{className:"link"},r.createElement(a.Link,{to:"/digit-ui/citizen/ads/myBookings/"+s},e("ADS_LOAD_MORE_MSG")))))),r.createElement("div",{style:{marginLeft:"16px",marginTop:"16px"}},r.createElement(a.Link,{to:"/digit-ui/citizen/ads/bookad/searchads"},r.createElement("button",{style:{borderRadius:"30px",padding:"8px 16px"}},e("ADS_NEW_BOOKING")+" +"))))},ApplicationDetails:()=>{var e,i,l,s,u,d,p,f,m,v,g,h,y,E,S;const{bookingNo:b}=a.useParams(),{t:D}=o.useTranslation(),A=a.useHistory(),_=Digit.ULBService.getCurrentTenantId(),[T,C]=n.useState({}),N=null==_?void 0:_.split(".")[0],[x,w]=n.useState(null),[I,L]=n.useState(null),[k,O]=n.useState({}),R=Array.isArray(null==k?void 0:k.Documents)?k.Documents:Array.isArray(null==k?void 0:k.documents)?k.documents:[],[P,M]=n.useState({}),[B,F]=n.useState(!1),[j,H]=n.useState(!1);n.useEffect(()=>{var e,t,n;console.log("Docs (from displayData):",R);const r=(R||[]).map(e=>{var t;return e?e.fileStoreId?e.fileStoreId:e.fileStoreIds&&Array.isArray(e.fileStoreIds)?e.fileStoreIds[0]:e.fileId?e.fileId:e.documentDetailId?e.documentDetailId:null!=e&&null!==(t=e.file)&&void 0!==t&&t.fileStoreId?e.file.fileStoreId:null:null}).filter(Boolean);if(console.log("Computed filesArray:",r),!r.length)return M({}),void F(!1);F(!0);const o=(null===(e=Digit)||void 0===e||null===(t=e.ULBService)||void 0===t||null===(n=t.getStateId)||void 0===n?void 0:n.call(t))||_;console.log("Calling Digit.UploadServices.Filefetch with state/tenant:",o),Digit.UploadServices.Filefetch(r,o).then(e=>{var t,n;console.log("Filefetch raw response:",e);let r=null!=(t=null!=(n=null==e?void 0:e.data)?n:null==e?void 0:e.files)?t:e;if(Array.isArray(r)){const e={};r.forEach(t=>{if(!t)return;if("string"==typeof t)return;const n=t.fileStoreId||t.fileId||t.documentDetailId,r=t.url||t.fileUrl||("string"==typeof t?t:null);n&&r&&(e[n]=r)}),r=e}console.log("Normalized pdfFiles map:",r),M(r||{})}).catch(e=>{console.error("Filefetch error:",e),M({})}).finally(()=>F(!1))},[JSON.stringify(R)]);const{isLoading:U,data:z}=Digit.Hooks.ads.useADSSearchApplication({bookingNo:b},_);console.log("applicationDetails 5454 :>> ",z);const q=null!=(e=null!=(i=null==z||null===(l=z.data)||void 0===l?void 0:l[0])?i:null==z?void 0:z[0])?e:null,W=q,V=W||q||T||null,G=n.useRef(),[K,$]=n.useState(!1),[Y,X]=n.useState(null),[Z,J]=n.useState(!1),[Q,ee]=n.useState(!1),te=null===(s=Digit.Hooks.ads)||void 0===s||null===(u=s.useADSCreateAPI)||void 0===u?void 0:u.call(s,_,!1),{data:ne,isLoading:re}=Digit.Hooks.useRecieptSearch({tenantId:_,businessService:"ADV",consumerCodes:(null==k||null===(d=k.applicantData)||void 0===d?void 0:d.applicationNo)||b,isEmployee:!1},{enabled:!!(null!=k&&null!==(p=k.applicantData)&&void 0!==p&&p.applicationNo||b)});Digit.Hooks.useClickOutside(G,()=>{$(!1)},K);const oe=Digit.Hooks.useWorkflowDetails({tenantId:_,id:null==W?void 0:W.bookingNo,moduleCode:"advandhoarding"});console.log("workflowDetails :>> ",oe);const ae=(null==oe||null===(f=oe.data)||void 0===f||null===(m=f.nextActions)||void 0===m?void 0:m.map(e=>({action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase()})))||[];n.useEffect(()=>{const e=W;if(e){var t,n,r,o,a,i,l,s;const u={address:((null==e||null===(t=e.address)||void 0===t?void 0:t.addressLine1)||"")+", "+((null==e||null===(n=e.address)||void 0===n?void 0:n.locality)||"")+", "+((null==e||null===(r=e.address)||void 0===r?void 0:r.city)||"")+" - "+((null==e||null===(o=e.address)||void 0===o?void 0:o.pincode)||""),email:null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.applicantEmailId,mobile:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantMobileNo,name:null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantName,applicationNo:null==e?void 0:e.bookingNo,bookingStatus:null==e?void 0:e.bookingStatus,paymentDate:null!=e&&e.paymentDate?new Date(e.paymentDate).toLocaleDateString():"",receiptNo:null==e?void 0:e.receiptNo},c=(e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))})((null==e?void 0:e.documents)||[]),d=(null==e||null===(s=e.cartDetails)||void 0===s?void 0:s.map(e=>({adType:null==e?void 0:e.addType,location:null==e?void 0:e.location,faceArea:null==e?void 0:e.faceArea,bookingDate:null==e?void 0:e.bookingDate,bookingTime:(null==e?void 0:e.bookingFromTime)+" - "+(null==e?void 0:e.bookingToTime),nightLight:D(null!=e&&e.nightLight?"YES":"NO"),status:null==e?void 0:e.status})))||[];O({applicantData:u,Documents:c,AdsDetails:d})}else O({})},[W,D]),n.useEffect(()=>{H(U||!W),C(W?c({},W,{applicationDetails:[{title:"ADS_DETAILS_SUMMARY_LABEL"}]}):{}),console.debug("bookingObj (normalized):",W,"isLoading:",U)},[U,W]);const ie=function(e){try{var t,n,r,o,a,i,l;const s=null!=(t=null!=(n=null!=(r=null==z||null===(o=z.Applications)||void 0===o?void 0:o[0])?r:null==z||null===(a=z.data)||void 0===a?void 0:a[0])?n:null==z?void 0:z[0])?t:W;if(!s)return w({key:"error",message:"Application data not loaded. Try reloading the page."}),L("Application data not loaded"),Promise.resolve();const u=(null==e||null===(i=e.Licenses)||void 0===i?void 0:i[0])||e;if(!u||!u.action)return w({key:"error",message:"No workflow action provided"}),L("No workflow action provided"),Promise.resolve();const d=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==u?void 0:u.assignee)||(null==u?void 0:u.assignees)||(null==u?void 0:u.assigneeUuid)),p=(null==oe||null===(l=oe.data)||void 0===l?void 0:l.applicationBusinessService)||"ADV",f=c({tenantId:_},s,{documents:(null==s?void 0:s.documents)||(null==s?void 0:s.Documents)||[],workflow:c({businessService:p,action:u.action,comments:u.comment||u.action||""},d?{assignes:d}:{})});return null!=u&&u.assignee||"FORWARD"!==u.action?Promise.resolve(Ze(function(){var e;if(null===(e=Digit)||void 0===e||!e.ADSServices||"function"!=typeof Digit.ADSServices.update)throw new Error("Digit.ADSServices.update is not available in this runtime");return Promise.resolve(Digit.ADSServices.update({bookingApplication:f},_)).then(function(e){var t,n;"SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)?(w({key:"success",message:"Successfully updated the status"}),L("Successfully updated the status"),null==oe||null===(n=oe.revalidate)||void 0===n||n.call(oe),setTimeout(()=>{A.push("/digit-ui/employee/ads/inbox")},1200),X(null),J(!1)):(w({key:"error",message:(null==D?void 0:D("SOMETHING_WENT_WRONG"))||"Failed to update"}),L("Failed to update"))})},function(e){console.error("submitAction error:",e),w({key:"error",message:"Something went wrong"}),L("Something went wrong")})):(w({key:"error",message:"Assignee is mandatory"}),L("Assignee is mandatory"),Promise.resolve())}catch(e){return Promise.reject(e)}};let le=[];return ne&&(null==ne||null===(v=ne.Payments)||void 0===v?void 0:v.length)>0&&!1===re&&(le.push({label:D("ADS_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;try{const e=Ze(function(){var e;function r(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:a})).then(function(e){window.open(e[a],"_blank")})}let o=(null==ne||null===(e=ne.bookingApplication)||void 0===e?void 0:e[0])||{},a=null==o?void 0:o.paymentReceiptFilestoreId;const i=function(){if(!a)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n)]},"advservice-receipt")).then(function(e){var t;function n(){var t;a=null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}const r=c({},o,{paymentReceiptFilestoreId:null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}),i=function(){if(null!=te&&te.mutateAsync)return Promise.resolve(te.mutateAsync({bookingApplication:r})).then(function(){})}();return i&&i.then?i.then(n):n()})}();return i&&i.then?i.then(r):r()},function(e){console.error("getRecieptSearch error",e),w({key:"error",message:"Unable to fetch receipt"})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}({tenantId:null==ne||null===(e=ne.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ne?void 0:ne.Payments[0]})}}),le.push({label:D("ADS_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t}=e;try{const e=Ze(function(){var e;function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let r=(null==ne||null===(e=ne.bookingApplication)||void 0===e?void 0:e[0])||{},o=null==r?void 0:r.permissionLetterFilestoreId;const a=function(){if(!o)return Promise.resolve(Digit.PaymentService.generatePdf(t,{bookingApplication:[r]},"advpermissionletter")).then(function(e){var t;function n(){var t;o=null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}const a=c({},r,{permissionLetterFilestoreId:null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}),i=function(){if(null!=te&&te.mutateAsync)return Promise.resolve(te.mutateAsync({bookingApplication:a})).then(function(){})}();return i&&i.then?i.then(n):n()})}();return a&&a.then?a.then(n):n()},function(e){console.error("getPermissionLetter error",e),w({key:"error",message:"Unable to fetch permission letter"})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}({tenantId:null==ne||null===(e=ne.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ne?void 0:ne.Payments[0]})}})),U||j?r.createElement(t.Loader,null):r.createElement("div",{className:"employee-main-application-details"},r.createElement("div",{style:{marginBottom:"15px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},D("ADS_APP_OVER_VIEW_HEADER")),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},le&&le.length>0&&r.createElement("div",{style:{position:"relative",zIndex:10}},r.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>ee(!Q),displayOptions:Q,options:le,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"}))))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,D("ADS_APPLICATION_DETAILS_OVERVIEW")),r.createElement(t.StatusTable,null,(null==k?void 0:k.applicantData)&&(null===(g=Object.entries(null==k?void 0:k.applicantData))||void 0===g?void 0:g.map(e=>{let[n,o]=e;return r.createElement(t.Row,{key:n,label:D(""+(null==n?void 0:n.toUpperCase())),text:Array.isArray(o)?o.map(e=>D("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):D("object"==typeof o?(null==o?void 0:o.code)||"N/A":o||"N/A")})})))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,D("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")),null==k||null===(h=k.AdsDetails)||void 0===h?void 0:h.map((e,n)=>r.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:D("ADS_AD_TYPE"),text:D(e.adType)||e.adType}),r.createElement(t.Row,{label:D("ADS_LOCATION"),text:e.location||"N/A"}),r.createElement(t.Row,{label:D("ADS_FACE_AREA"),text:e.faceArea||"N/A"}),r.createElement(t.Row,{label:D("ADS_BOOKING_START_DATE"),text:e.bookingDate||"N/A"}),r.createElement(t.Row,{label:D("ADS_BOOKING_TIME"),text:e.bookingTime||"N/A"}),r.createElement(t.Row,{label:D("ADS_NIGHT_LIGHT"),text:e.nightLight}),r.createElement(t.Row,{label:D("ADS_STATUS"),text:D(e.status)||e.status}))))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,D("ADS_APPLICATION_DOCUMENTS_OVERVIEW")),r.createElement("div",{style:{display:"flex",gap:"16px"}},R.length?r.createElement(n.Fragment,null,r.createElement(tt,{value:R,workflowDocs:R,config:{value:R,workflowDocs:R,documents:R},application:W,pdfFiles:P,files:P,filesMap:P}),R.length>0&&r.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap",marginTop:"12px"}},R.map(e=>{const n=((e,t)=>{if(!e||!t)return null;let n=t[e];if(!n)if(Array.isArray(t)){const r=t.find(t=>(null==t?void 0:t.fileStoreId)===e||(null==t?void 0:t.fileId)===e||(null==t?void 0:t.documentDetailId)===e);n=(null==r?void 0:r.url)||(null==r?void 0:r.fileUrl)||null}else"object"==typeof t&&t.url&&(n=t.url);if(!n)return null;if("string"==typeof n&&n.includes(",")){const e=n.split(",").map(e=>e.trim());return e.find(e=>!(e.toLowerCase().includes("large")||e.toLowerCase().includes("medium")||e.toLowerCase().includes("small")||e.toLowerCase().includes("thumbnail")))||e[0]}return Array.isArray(n)?n[0]:"object"==typeof n?n.url||n.fileUrl||n[0]||null:"string"==typeof n?n:null})(e.fileStoreId||e.fileId||e.documentDetailId,P);return r.createElement("div",{key:e.documentDetailId||e.fileStoreId||e.fileId,style:{minWidth:100,textAlign:"center"}},r.createElement("a",{href:n||"#",target:"_blank",rel:"noreferrer",style:{textDecoration:"none",color:"#000"}},r.createElement("div",{style:{display:"flex",justifyContent:"center"}},r.createElement(t.PDFSvg,null)),r.createElement("div",{style:{marginTop:8,fontSize:13}},D(e.documentType)||e.documentType),r.createElement("div",{style:{fontSize:11,color:"#666"}},n?"Open":"No file URL")))}))):r.createElement("div",null,D("TL_NO_DOCUMENTS_MSG"))),r.createElement(Ve,{application:V,id:(null==k||null===(y=k.applicantData)||void 0===y?void 0:y.applicationNo)||b,userType:"employee"}),x&&r.createElement(t.Toast,{error:"error"===x.key,label:x.label?D(x.label):x.message||x,style:{bottom:"0px"},onClose:()=>{w(null)}})),!(null!=oe&&oe.isLoading)&&Array.isArray(ae)&&ae.length>0&&r.createElement(t.ActionBar,null,K&&r.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_ADS",options:ae,optionKey:"buttonLabel",t:D,onSelect:e=>{!function(e){if(e){if("PAY"===e.action){var t;const e=(null==k||null===(t=k.applicantData)||void 0===t?void 0:t.applicationNo)||b;return A.push("/digit-ui/employee/payment/collect/adv-services/"+e+"/"+_+"?tenantId="+_)}if("SUBMIT"===e.action||"INITIATE"===e.action)return ie({Licenses:[{action:e.action,comment:e.action||""}]});X({action:e.action,comment:""}),J(!0)}}(e),$(!1)}}),r.createElement(t.SubmitBar,{ref:G,label:D("WF_TAKE_ACTION"),onSubmit:()=>$(!K)})),Z?r.createElement(At,{t:D,action:Y,tenantId:_,state:N,bookingNo:b,applicationDetails:z,applicationData:null==z?void 0:z.applicationData,closeModal:()=>{X(null),J(!1)},submitAction:ie,actionData:(null==oe||null===(E=oe.data)||void 0===E?void 0:E.processInstances)||[],businessService:(null==oe||null===(S=oe.data)||void 0===S?void 0:S.applicationBusinessService)||"ADV",moduleCode:"advandhoarding",workflowActions:ae,showToast:x,closeToast:()=>{w(null)},errors:I}):null,x&&r.createElement(t.Toast,{error:"error"===x.key,label:x.label?D(x.label):x.message||x,style:{bottom:"0px"},onClose:()=>{w(null)}}))},ADSApplicationDetails:()=>{var e,i,l,s,u,d,p,f,m,v,g,h,y,E,S,b,D;const[A,_]=n.useState([]),{t:T}=o.useTranslation(),{acknowledgementIds:C,tenantId:N}=(a.useHistory(),a.useParams()),[x,w]=n.useState([]),[I,L]=n.useState(!1),[k,O]=n.useState(!1),[R,P]=n.useState(null),[M,B]=n.useState(!1),[F,j]=n.useState(null),[H,U]=n.useState(!1),z=n.useRef(),[q,W]=n.useState(null),{isLoading:V,error:G,data:K}=(Digit.Hooks.useStore.getInitData(),Digit.Hooks.ads.useADSSearch({tenantId:N,filters:{bookingNo:C}})),[$,Y]=(Digit.Hooks.ads.useADSCreateAPI(N,!1),n.useState(null)),X=En(K,"bookingApplication",[]),Z=En(K,"bookingApplication[0].bookingNo",[]);let J=X&&X.length>0&&X[0]||{};const Q=J;sessionStorage.setItem("ads",JSON.stringify(Q));const[ee,te]=n.useState(!1),ne=Digit.Hooks.useWorkflowDetails({tenantId:N,id:C,moduleCode:"advandhoarding"});console.log("workflowDetails :>> ",ne);const re=(null==ne||null===(e=ne.data)||void 0===e||null===(i=e.nextActions)||void 0===i?void 0:i.map(e=>c({},e,{action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase(),assignee:(null==e?void 0:e.assignee)||null,nextStateUuid:(null==e?void 0:e.nextState)||null})))||[];n.useEffect(()=>{_(re)},[JSON.stringify(re)]),Digit.Hooks.useClickOutside&&Digit.Hooks.useClickOutside(z,()=>{B(!1)},M);const{isLoading:oe}=Digit.Hooks.ads.useADSSearch({tenantId:N,filters:{bookingNo:Z,audit:!0}},{enabled:!0});let ae=[];if(ae=null!=(l=null==Q?void 0:Q.documents)?l:[],V||oe||null!=ne&&ne.isLoading)return r.createElement(t.Loader,null);let ie=T("CS_NA");if(null!=J&&null!==(s=J.additionalDetails)&&void 0!==s&&s.documentDate){var le;const e=new Date(null==J||null===(le=J.additionalDetails)||void 0===le?void 0:le.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];ie=e.getDate()+" "+t+" "+e.getFullYear()}let se=[];const ue=[{Header:""+T("ADS_TYPE"),accessor:"addType"},{Header:""+T("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+T("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+T("ADS_BOOKING_START_DATE"),accessor:"bookingDate"},{Header:""+T("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:"bookingStatus"}],ce=(null==J||null===(u=J.cartDetails)||void 0===u?void 0:u.map(e=>({addType:""+T(e.addType),faceArea:""+T(e.faceArea),nightLight:""+T(!0===e.nightLight?"Yes":"No"),bookingDate:""+T(e.bookingDate),bookingStatus:""+T(e.status)})))||[];return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},T("ADS_BOOKING_DETAILS")),se&&se.length>0&&r.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>L(!I),displayOptions:I,options:se})),r.createElement(t.Card,null,r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:T("ADS_BOOKING_NO"),text:null==J?void 0:J.bookingNo})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:T("ADS_APPLICANT_NAME"),text:(null==J||null===(d=J.applicantDetail)||void 0===d?void 0:d.applicantName)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_MOBILE_NUMBER"),text:(null==J||null===(p=J.applicantDetail)||void 0===p?void 0:p.applicantMobileNo)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_EMAIL_ID"),text:(null==J||null===(f=J.applicantDetail)||void 0===f?void 0:f.applicantEmailId)||T("CS_NA")})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ADS_ADDRESS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:T("ADS_HOUSE_NO"),text:(null==J||null===(m=J.address)||void 0===m?void 0:m.houseNo)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_HOUSE_NAME"),text:(null==J||null===(v=J.address)||void 0===v?void 0:v.houseName)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_STREET_NAME"),text:(null==J||null===(g=J.address)||void 0===g?void 0:g.streetName)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_ADDRESS_LINE1"),text:(null==J||null===(h=J.address)||void 0===h?void 0:h.addressLine1)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_ADDRESS_LINE2"),text:(null==J||null===(y=J.address)||void 0===y?void 0:y.addressLine2)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_LANDMARK"),text:(null==J||null===(E=J.address)||void 0===E?void 0:E.landmark)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_CITY"),text:(null==J||null===(S=J.address)||void 0===S?void 0:S.city)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_LOCALITY"),text:(null==J||null===(b=J.address)||void 0===b?void 0:b.locality)||T("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:T("ADS_ADDRESS_PINCODE"),text:(null==J||null===(D=J.address)||void 0===D?void 0:D.pincode)||T("CS_NA")})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ADS_CART_DETAILS")),r.createElement(Oe,{t:T,data:ce,columns:ue,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:ce.length}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},T("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,ae.map((e,t)=>r.createElement(tt,{value:ae,Code:null==e?void 0:e.documentType,index:t}))),r.createElement(Ve,{application:Q,id:null==J?void 0:J.bookingNo,userType:"citizen"})),R&&r.createElement(t.Toast,{error:"error"===R.key,label:q||G,onClose:()=>P(null)})))},ADSSearchApplication:y,ADSRequiredDoc:e=>{var n,o,a,i;let{t:l,onSelect:s,formData:u,value:c=u.adslist}=e;Digit.ULBService.getCurrentTenantId();const d=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:p,data:m={}}=Digit.Hooks.ads.useADSDocumentsMDMS(d,"Advertisement","Documents");let v=null==m||null===(n=m.Advertisement)||void 0===n?void 0:n.Documents;return r.createElement(r.Fragment,null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,l("MODULE_ADS")),r.createElement(t.CardSubHeader,null,r.createElement(Je,{timerValues:null==c||null===(o=c.existingDataSet)||void 0===o||null===(a=o.timervalue)||void 0===a?void 0:a.timervalue,SlotSearchData:null==c?void 0:c.cartDetails,draftId:null==c||null===(i=c.existingDataSet)||void 0===i?void 0:i.draftId}))),r.createElement("div",null,r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_HEADER")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_TEXT")),r.createElement(t.CardSubHeader,null,l("ADS_REQ_SCREEN_LABEL")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_LABEL_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_SIZE")),r.createElement("div",null,p&&r.createElement(t.Loader,null),Array.isArray(v)?v.map((e,n)=>{let{code:o,dropdownData:a}=e;return r.createElement("div",{key:n},r.createElement(t.CardSubHeader,null,n+1,". ",l("ADS_"+f(o,".","_"))),a.map((e,n)=>r.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",l("ADS_"+f(null==e?void 0:e.code,".","_")))))}):null)),r.createElement("span",null,r.createElement(t.SubmitBar,{label:l("ADS_COMMON_NEXT"),onSubmit:s}))))},LocationSearch:F,GIS:We,NewADSStepperForm:e=>{let{userType:i}=e;const l=("employee"===i?Bn:Fn).map(e=>c({},e,{currStepConfig:("employee"===i?On:Rn).filter(t=>t.stepNumber===e.stepNumber)})),{t:u}=(a.useHistory(),o.useTranslation()),d=s.useDispatch(),[p,f]=n.useState(null),m=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{d({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},u("ADS_REGISTRATION_APPLICATION")),r.createElement(kn,{stepsList:l,onSubmit:e=>{console.log("dataGet===",e)},step:m,setStep:e=>{d(Mn(e))}}),p&&r.createElement(t.Toast,{error:p.key,label:u(p.label),onClose:()=>{f(null)},isDleteBtn:"true"}))},NewADSStepFormOne:e=>{let{config:a,onGoNext:i,onBackClick:l}=e;const u=s.useDispatch(),{t:c}=o.useTranslation(),[d,p]=n.useState(!1),[f,m]=n.useState(""),v=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null," ",r.createElement(jn,{onGoBack:function(e){l(a.key,e)},goNext:function(e){u(Pn(a.key,e)),console.log("conifg keyeeee",a.key),console.log("dataaaaa",e),i()},currentStepData:v,t:c})," ",d&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{p(!1),m("")}})," ")},NewADSStepFormTwo:e=>{let{config:a,onBackClick:i,onGoNext:l}=e;const{t:u}=o.useTranslation(),c=s.useDispatch(),[d,p]=n.useState(!1),[f,m]=n.useState(""),v=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement(Hn,{onGoBack:function(e){i(a.key,e)},goNext:function(e){c(Pn(a.key,e)),l()},currentStepData:v,t:u}),d&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{p(!1),m("")}}))},NewADSStepFormThree:e=>{let{config:o,onGoNext:a,onBackClick:i,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.ads.useADSDocumentsMDMS(m,"Advertisements",["Documents"]),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){var t;console.log("goNext data in NewADSStepFormThree: ",e);const n=(e=>{var t;const n=((null==e||null===(t=e.NDC)||void 0===t?void 0:t.Documents)||[]).filter(e=>null==e?void 0:e.required).map(e=>e.code);return function(e){void 0===e&&(e=[]);const t={};if(null==n||!n.length)return t;for(const o of n){var r;if(!(null===(r=e)||void 0===r?void 0:r.some(e=>{var t,n;return(null==e||null===(t=e.documentType)||void 0===t||null===(n=t.includes)||void 0===n?void 0:n.call(t,o))&&((null==e?void 0:e.filestoreId)||(null==e?void 0:e.fileStoreId))}))){t.missingRequired="ADS_MISSING_REQUIRED_DOCUMENTS";break}}return t}})(v)((null==g||null===(t=g.documents)||void 0===t?void 0:t.documents)||[]);if(null!=n&&n.missingRequired)return f("Please upload all required documents"),void d(!0);a()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!N.isEqual(t,g)),N.isEqual(t,g)||u(Pn(o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){i(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewADSStepFormFour:e=>{let{config:a,onGoNext:i,onBackClick:l}=e;const u=s.useDispatch(),{t:d}=o.useTranslation(),[p,f]=n.useState(!1),[m,v]=n.useState(""),{currentStepData:g,isLoading:h}=s.useSelector(e=>{var t,n,r;return{currentStepData:null===(t=e.ads.ADSNewApplicationFormReducer)||void 0===t?void 0:t.formData,isLoading:(null===(n=e.ads.ADSNewApplicationFormReducer)||void 0===n?void 0:n.isLoading)||!(null!==(r=e.ads.ADSNewApplicationFormReducer)&&void 0!==r&&r.formData)}});return h?null:r.createElement(n.Fragment,null,r.createElement(Un,{onGoBack:e=>{const t=c({},g,{penalty:e});l(a.key,t)},goNext:e=>{const t=c({},g,{penalty:e});u(Pn(a.key,t)),i()},currentStepData:null==g?void 0:g.penalty,t:d}),p&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{f(!1),v("")}}))},NewADSStepFormFive:function(e){var o,i,l,u,d,p,f,m=e.config,v=e.onBackClick,g=e.t;const h=a.useHistory(),[y,E]=n.useState(!1),S=n.useRef(),[b,D]=n.useState([]);var A=s.useDispatch(),_=n.useState(!1),T=_[0],C=_[1];const x=window.location.href.includes("citizen"),w=x?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");var I=n.useState(""),L=I[0],k=I[1],O=s.useSelector(function(e){return e&&e.ads&&e.ads.ADSNewApplicationFormReducer&&e.ads.ADSNewApplicationFormReducer.formData||{}},N.isEqual),R=n.useRef(O);n.useEffect(function(){R.current=O},[O]);const P=(null==O?void 0:O.bookingNo)||(null==O||null===(o=O.CreatedResponse)||void 0===o?void 0:o.bookingNo)||"";console.log("globalBookingNo",P);const M=Digit.Hooks.useWorkflowDetails({tenantId:w,id:P,moduleCode:"advandhoarding-services"});console.log("live workflowDetails:",M),n.useEffect(()=>{var e,t;const n=null==M?void 0:M.data;if(console.log("wd :>> ",n),!n)return void D(e=>e&&e.length?[]:e);const r=n.processInstances&&n.processInstances.length?n.processInstances[0]:null,o=(r&&r.nextActions||n.nextActions||[]||[]).map(e=>({action:e.action,roles:e.roles||[],assignee:e.assignee||e.assignees||e.assigner||null,nextStateUuid:e.nextState||e.nextStateUuid||null,nextState:e.nextState||e.nextStateUuid||null,buttonLabel:(e.action||"").replace(/_/g," ").toUpperCase(),comment:e.comment||e.action||"",_rawAction:e})),a=Digit.UserService.getUser();let i=(null==a||null===(e=a.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.map(e=>e.code))||[];if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){var l,s,u;const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};i=(null==t||null===(l=t.value)||void 0===l||null===(s=l.info)||void 0===s||null===(u=s.roles)||void 0===u?void 0:u.map(e=>e.code))||i}const c=o.filter(e=>!e.roles||0===e.roles.length||i.some(t=>e.roles.includes(t)));D(e=>N.isEqual(e,c)?e:(console.log("wfActions from workflowDetails:",c),c))},[null==M||null===(i=M.data)||void 0===i?void 0:i.applicationBusinessService,null==M||null===(l=M.data)||void 0===l||null===(u=l.processInstances)||void 0===u?void 0:u.length]);var B=n.useRef(!0),F=n.useRef(null),j=n.useRef(null),H=n.useCallback(function(e){void 0===e&&(e=void 0);try{var t,n,r,o,a,i,l,s,u,d;const p=null==M?void 0:M.data;console.log("goNext called with:",e);const f=N.merge(N.cloneDeep(R.current),e||{});console.log("payloadState issss6666 :>> ",f);const m=null!==(t=e)&&void 0!==t&&t.action?e:(null===(n=e)||void 0===n||null===(r=n.Licenses)||void 0===r?void 0:r[0])||null,v=m.nextState||m.nextStateUuid||m.status||"";console.log("filtData :>> ",m);const y=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==m?void 0:m.assignee)||(null==m?void 0:m.assignees)||(null==m?void 0:m.assigneeUuid));if(!m||!m.action)return A(Pn("finalSubmission",f)),Promise.resolve();A(Pn("finalSubmission",f));const E=(null==p||null===(o=p.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(i=a.state)||void 0===i?void 0:i.applicationStatus)||"",S={bookingApplication:c({tenantId:w},null==f?void 0:f.CreatedResponse,{bookingStatus:"INITIATED"===E?"BOOKING_CREATED":"REFUND"===E?"CANCELLED":E||(null==f||null===(l=f.CreatedResponse)||void 0===l?void 0:l.bookingStatus),documents:(null==f||null===(s=f.documents)||void 0===s||null===(u=s.documents)||void 0===u?void 0:u.documents)||(null==f?void 0:f.documents)||(null==f?void 0:f.Documents)||[],workflow:c({businessService:(null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService)||"ADV",states:v||E||"",action:m.action||"",comments:m.comment||m.action||"",status:E},y?{assignee:y}:{})})};if((null==m||!m.assignee)&&"FORWARD"===m.action)return k("Assignee is mandatory"),C(!0),Promise.resolve();const b=Ze(function(){return Promise.resolve(Digit.ADSServices.update(S,w)).then(function(e){var t;if(console.log("ADS Update response:",e),"SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)){var n,r,o,a,i,l,s,u,d,p,m;const e=c({},(null===(n=Digit)||void 0===n||null===(r=n.Store)||void 0===r||null===(o=r.getState)||void 0===o||null===(a=o.call(r))||void 0===a||null===(i=a.ads)||void 0===i||null===(l=i.ADSNewApplicationFormReducer)||void 0===l?void 0:l.formData)||R.current||{},f),t=Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}));A(Pn("formData",t)),h.replace(x?"/digit-ui/citizen/ads/adsservice/response/"+(null===(s=R.current)||void 0===s||null===(u=s.CreatedResponse)||void 0===u?void 0:u.bookingNo):"/digit-ui/employee/ads/adsservice/response/"+(null===(d=R.current)||void 0===d||null===(p=d.CreatedResponse)||void 0===p?void 0:p.bookingNo),{applicationData:null===(m=R.current)||void 0===m?void 0:m.CreatedResponse})}else k(g&&g("SOMETHING_WENT_WRONG")||"Failed to update"),C(!0)})},function(e){console.error("ADS update error:",e),k(g&&g("SOMETHING_WENT_WRONG")||"Failed to update"),C(!0)});return Promise.resolve(b&&b.then?b.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[w,g,A,null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService,h,x]);function U(e){v(m.key,e)}var z=n.useCallback(function(){var e=arguments.length>1?arguments[1]:void 0;B.current?B.current=!1:e&&(N.isEqual(e,R.current)||F.current&&N.isEqual(e,F.current)||(j.current&&clearTimeout(j.current),j.current=setTimeout(function(){const t=N.omitBy(N.cloneDeep(e),e=>void 0===e);if(console.log("cleanStep keys",Object.keys(t)),"summary"===(null==m?void 0:m.key)&&1===Object.keys(t).length&&""===t.summary)return;const n=N.merge({},R.current,t);Object.keys(t).length>0&&!N.isEqual(n,R.current)&&(F.current=n,A(Pn("formData",n)))},100)))},[A,m&&m.key]);n.useEffect(function(){return function(){j.current&&clearTimeout(j.current)}},[]),console.log("defaultValues keys:",Object.keys(O||{}));const q=r.useMemo(()=>{const e=O||{};return void 0===e.summary?c({},e,{summary:""}):e},[O]);let W=Digit.UserService.getUser();null==W||null===(p=W.info)||void 0===p||null===(f=p.roles)||void 0===f||f.map(e=>e.code);const V=r.useMemo(()=>b||[],[b]);return Digit.Hooks.useClickOutside(S,()=>{E(!1)},y),r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:q,config:m&&m.currStepConfig,onSubmit:e=>H(c({},e,{_isFormSubmit:!0})),onFormValueChange:z,label:g&&m&&m.texts?g(m.texts.submitBarLabel):"",currentStep:m&&m.currStepNumber,onBackClick:U}),T&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:L,onClose:function(){C(!1),k("")}}),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:g("CS_COMMON_BACK"),onSubmit:U,variant:"secondary"}),y&&r.createElement(t.Menu,{localeKeyPrefix:"",options:V,optionKey:"action",t:g,onSelect:e=>{!function(e){var t;if(!e)return;const n=new Set(["SUBMIT","INITIATE","PAY"]),r=e.fromStateCode||(null===(t=e._rawStateObj)||void 0===t?void 0:t.state)||null,o=e.toStateCode||null,a=n.has(e.action)?o||r||e.nextStateUuid:r||o||e.nextStateUuid;H({action:e.action,nextState:e.nextState||e.nextStateUuid||null,status:a||"",comment:e.comment||e.action||"",assignee:e.assignee||null,_rawAction:e})}(e),E(!1)}}),r.createElement(t.SubmitBar,{ref:S,label:g("WF_TAKE_ACTION"),onSubmit:()=>E(!y)})))},ADSCitizenDetailsNew:jn,ADSCitizenSecond:Hn,ADSSelectProofIdentity:e=>{var o;let{t:a,config:i,onSelect:l,formData:s}=e;Digit.ULBService.getStateId();const[u,d]=n.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]),[p,f]=n.useState(null),[m,v]=n.useState(!0),[g,h]=n.useState(!1),y=Digit.ULBService.getStateId(),{isLoading:E,data:S}=Digit.Hooks.ads.useADSDocumentsMDMS(y),b=()=>{let e;e=c({},s.documents,{documents:u}),l(i.key,e)};return n.useEffect(()=>{const e=(null==S?void 0:S.filter(e=>null==e?void 0:e.required))||[],t=u||[],n=e.every(e=>t.some(t=>{var n;return(null==t||null===(n=t.documentType)||void 0===n?void 0:n.includes(e.code))&&(null==t?void 0:t.fileStoreId)}));v(!(n&&!p))},[u,S,p]),r.createElement("div",null,E?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:a,config:i,onSelect:b,onSkip:()=>l(),isDisabled:m,onAdd:function(){}},null==S?void 0:S.map((e,t)=>r.createElement(Yn,{key:t,document:e,t:a,error:p,setError:f,setDocuments:d,documents:u,setCheckRequiredFields:h,handleSubmit:b})),p&&r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(t.Toast,{label:p,onClose:()=>f(null),error:!0}),r.createElement("button",{type:"button","aria-label":"Dismiss",onClick:()=>f(null),style:{background:"transparent",border:"none",fontSize:"18px",cursor:"pointer",lineHeight:1},title:a("CS_ACTION_CLOSE")||"Close"},"×"))))},ADSSummary:function(e){var o,a,i,l,u,c,d,p,f;let{t:m}=e;const v=s.useDispatch(),g=e=>m?m(e):e,h=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer.formData),y=r.useMemo(()=>h||{},[h]);console.log("formData :>> ",y);const E=(null===(o=y.CreatedResponse)||void 0===o?void 0:o.applicantDetail)||{},S=y.address||(null===(a=y.CreatedResponse)||void 0===a?void 0:a.address)||{},b=Array.isArray(null===(i=y.CreatedResponse)||void 0===i?void 0:i.cartDetails)?null===(l=y.CreatedResponse)||void 0===l?void 0:l.cartDetails:[];console.log("cartArray isss:>> ",b),n.useEffect(()=>{window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id")},[y]);const D=Array.isArray(null===(u=y.documents)||void 0===u||null===(c=u.documents)||void 0===c?void 0:c.documents)?y.documents.documents.documents:Array.isArray(null===(d=y.documents)||void 0===d?void 0:d.documents)?y.documents.documents:Array.isArray(y.documents)?y.documents:[];return r.createElement("div",{className:"application-summary"},r.createElement("h2",{style:{fontSize:20,fontWeight:"bold"}},g("Application Summary")),r.createElement(t.Card,{className:"summary-section",style:{padding:2}},r.createElement("div",{className:"section-header"},r.createElement("h3",null,g("Applicant Details")),r.createElement("button",{onClick:()=>v(Mn(2)),style:{marginLeft:"10px",padding:"5px 10px",background:"none",border:"1px solid #ccc",cursor:"pointer"}},"Edit")),r.createElement("div",{className:"section-content"},r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Applicant Name")),r.createElement("div",null,E.applicantName||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Mobile Number")),r.createElement("div",null,E.applicantMobileNo||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Email ID")),r.createElement("div",null,E.applicantEmailId||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("SGST")),r.createElement("div",null,E.SGST||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Self Declaration")),r.createElement("div",null,g(E.selfDeclaration?"True":"False"))))),r.createElement(t.Card,{className:"summary-section",style:{padding:2}},r.createElement("div",{className:"section-header"},r.createElement("h3",null,g("Address")),r.createElement("button",{onClick:()=>v(Mn(2)),style:{marginLeft:"10px",padding:"5px 10px",background:"none",border:"1px solid #ccc",cursor:"pointer"}},"Edit")),r.createElement("div",{className:"section-content"},r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Address ID")),r.createElement("div",null,S.addressId||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Door No")),r.createElement("div",null,S.doorNo||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("House No")),r.createElement("div",null,S.houseNo||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("House Name")),r.createElement("div",null,S.houseName||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Street Name")),r.createElement("div",null,S.streetName||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Address Line 1")),r.createElement("div",null,S.addressLine1||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Address Line 2")),r.createElement("div",null,S.addressLine2||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Landmark")),r.createElement("div",null,S.landmark||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("City")),r.createElement("div",null,(null===(p=S.city)||void 0===p?void 0:p.label)||S.city||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Locality")),r.createElement("div",null,(null===(f=S.locality)||void 0===f?void 0:f.label)||S.locality||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Pincode")),r.createElement("div",null,S.pincode||"NA")))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{className:"section-header"},r.createElement("h3",null,g("Advertisement Details")),r.createElement("button",{onClick:()=>v(Mn(1)),style:{marginLeft:"10px",padding:"5px 10px",background:"none",border:"1px solid #ccc",cursor:"pointer"}},"Edit")),r.createElement("div",{className:"section-content"},b.length?b.map((e,n)=>{return r.createElement(r.Fragment,{key:n},r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Site ID")),r.createElement("div",null,e.advertisementId||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Site Name")),r.createElement("div",null,e.location||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("geolocation")),r.createElement("div",null,(o=e.geoLocation)?"string"==typeof o?o:(e=>{if(null==e||""===e)return"NA";if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return String(e);if("object"==typeof e){if(e.formattedAddress)return e.formattedAddress;if(e.addressLine1)return e.addressLine1;if(e.label)return e.label;if(e.name)return e.name;if(e.latitude&&e.longitude)return e.latitude+", "+e.longitude;if(e.lat&&e.lng)return e.lat+", "+e.lng;try{const t=JSON.stringify(e);return t.length>120?t.slice(0,117)+"...":t}catch(e){return"NA"}}return String(e)})(o):"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Advertisement Type")),r.createElement("div",null,e.addType||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Booking Date")),r.createElement("div",null,e.bookingDate||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("End Date")),r.createElement("div",null,e.endDate||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Address")),r.createElement("div",null,e.location||"NA")),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Face Area")),r.createElement("div",null,e.faceArea||"NA")));var o}):r.createElement("div",null,"NA"))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{className:"section-header"},r.createElement("h3",null,g("Documents")),r.createElement("button",{onClick:()=>v(Mn(3)),style:{marginLeft:"10px",padding:"5px 10px",background:"none",border:"1px solid #ccc",cursor:"pointer"}},"Edit")),r.createElement("div",{className:"section-content"},D.length>0?D.map((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,null,g("Document Type")),r.createElement("div",null,e.documentType?g(e.documentType).replace(/\./g,"_"):"NA")),r.createElement(tt,{value:D,Code:null==e?void 0:e.documentType,index:n})," ")):r.createElement("div",null,g("No documents uploaded")))))},ADSPenalty:Un,ADSResponseCitizen:e=>{var n;const i=window.location.href.includes("citizen");console.log("props",e);const{state:l}=e.location,{t:s}=o.useTranslation(),u=a.useHistory(),c=null==l?void 0:l.applicationData;console.log("state",l),console.log("applicationData",c);const d=i?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),p=((null==u||null===(n=u.location)||void 0===n?void 0:n.pathname)||"").split("/").pop();return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:s("ADS_BOOKED_HEADER"),applicationNumber:p,info:"REJECTED"==(null==c?void 0:c.bookingStatus)?"":s("ADS_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.bookingStatus)?r.createElement(t.CardText,null,s("ADS_BOOKED_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{u.push(i?"/digit-ui/citizen":"/digit-ui/employee")}}),r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{u.push(i?"/digit-ui/citizen/ads-home":"/digit-ui/employee/ads/inbox")}}),r.createElement(t.SubmitBar,{label:s("COMMON_MAKE_PAYMENT"),onSubmit:()=>{u.push(i?"/digit-ui/citizen/payment/collect/adv-services/"+p+"/"+d+"?tenantId="+d:"/digit-ui/employee/payment/collect/adv-services/"+p+"/"+d+"?tenantId="+d)}}))))}},Qn=e=>{let{stateCode:t,userType:o,tenants:i}=e;const{path:l,url:s}=a.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"ADS",language:u}),Object.entries(Jn).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("ADS_TENANTS",i),n.useEffect(()=>"employee"===o&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===o?r.createElement(yt,{path:l,url:s,userType:o}):r.createElement(D,null)},er=e=>{const{t:a}=o.useTranslation(),[i,l,s]=Digit.Hooks.useSessionStorage("ADS",{});return n.useEffect(()=>{s()},[]),r.createElement(t.CitizenHomeCard,{header:a("ADVERTISEMENT_MODULE"),links:[],Icon:()=>r.createElement(Ue,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:Qn,ADSLinks:er,ADSCard:rt,ADS_INBOX_FILTER:e=>r.createElement(w,e),ADSInboxTableConfig:e=>({ADS:{inboxColumns:t=>[{Header:e("ADS_BOOKING_NO"),Cell:e=>{var n,o,i,l;let{row:s}=e;return console.log("row is :>> ",s),r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(a.Link,{to:t.parentRoute+"/applicationsearch/application-details/"+(null==s||null===(n=s.original)||void 0===n||null===(o=n.searchData)||void 0===o?void 0:o.bookingNo)},null===(i=s.original)||void 0===i||null===(l=i.searchData)||void 0===l?void 0:l.bookingNo)))},mobileCell:e=>{var t;return L(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r,o,a;return I(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(r=n.original)||void 0===r||null===(o=r.searchData)||void 0===o||null===(a=o.applicantDetail)||void 0===a?void 0:a.applicantName))},mobileCell:e=>{var t,n;return L(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.applicantName)}},{Header:e("AD _TYPE"),Cell:e=>{var t,n,r,o;let{row:a}=e;return I(""+(null===(t=a.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(r=n.cartDetails)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.addType))},mobileCell:e=>{var t,n,r;return L(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.cartDetails)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.addType)}},{Header:e("BOOKING_STATUS"),Cell:t=>{var n,r,o;let{row:a}=t;return I(e(""+(null==a||null===(n=a.original)||void 0===n||null===(r=n.workflowData)||void 0===r||null===(o=r.state)||void 0===o?void 0:o.applicationStatus)))},mobileCell:t=>{var n,r;return L(e("ES_ADS_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(r=n.state)||void 0===r?void 0:r.applicationStatus)))}},{Header:e("ADS_DATE"),Cell:e=>{var t,n;let{row:r}=e;const o=null===(t=r.original)||void 0===t||null===(n=t.searchData)||void 0===n?void 0:n.applicationDate,a=o?new Date(o).toLocaleDateString("en-GB"):"";return I(a)},mobileCell:e=>{var t;const n=null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationDate,r=n?new Date(n).toLocaleDateString("en-GB"):"";return L(r)}}],serviceRequestIdKey:t=>{var n,r;return null==t||null===(n=t[e("ADS_INBOX_UNIQUE_BOOKING_NUMBER")])||void 0===n||null===(r=n.props)||void 0===r?void 0:r.children}}})},exports.ADSLinks=er,exports.ADSModule=Qn,exports.ADSReducers=()=>u.combineReducers({ADSNewApplicationFormReducer:Zn});
|
|
1
|
+
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),i=require("react-router-dom"),a=require("react-hook-form"),l=require("react-query"),s=require("react-redux"),u=require("redux");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function d(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"CS_NA"},f=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},m=e=>r.createElement("h1",{className:"heading-m"},e.t("CHB_CANCEL")),v=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),g=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(v,null)),h=e=>{let{t:o,closeModal:i,actionCancelLabel:l,actionCancelOnSubmit:s,actionSaveLabel:u,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,f]=n.useState(!1),{handleSubmit:v}=a.useForm();return r.createElement(t.Modal,{headerBarMain:r.createElement(m,{t:o}),headerBarEnd:r.createElement(g,{onClick:i}),actionCancelLabel:o(l),actionCancelOnSubmit:s,actionSaveLabel:o(u),actionSaveOnSubmit:v(c),isDisabled:!p,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},r.createElement("form",{onSubmit:v(d)},r.createElement(t.CheckBox,{label:o("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{f(!p)},style:{height:"auto"}}))))},y=e=>{var o,l,s;let{tenantId:u,isLoading:d,t:p,onSubmit:f,data:m,count:v,setShowToast:g,userType:y}=e;const E=window.Digit.Utils.browser.isMobile(),{register:S,control:b,handleSubmit:D,setValue:_,getValues:A,reset:T,formState:C}=a.useForm({defaultValues:{offset:0,limit:!E&&10,sortBy:"createdTime",sortOrder:"DESC",fromDate:(new Date).toISOString().split("T")[0],toDate:(new Date).toISOString().split("T")[0],status:""}});console.log("data :>> ",m),n.useEffect(()=>{S("offset",0),S("limit",10),S("sortBy","createdTime"),S("sortOrder","DESC"),D(f)()},[S]);const[N,x]=n.useState(""),[w,I]=n.useState(!1),k=Digit.Hooks.ads.useADSCreateAPI(u,!1),L=i.useHistory(),{data:O}=(((null==L||null===(o=L.location)||void 0===o?void 0:o.pathname)||"").split("/").pop(),Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}));O&&O.map(e=>{});const R=e=>r.createElement("span",{className:"cell-text"},e),P=function(){try{I(!1);const e=c({},N,{bookingStatus:"CANCELLED"});return Promise.resolve(k.mutateAsync({bookingApplication:e})).then(function(){D(f)()})}catch(e){return Promise.reject(e)}},M=n.useMemo(()=>[{Header:p("ADS_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(i.Link,{to:"citizen"===y?"/digit-ui/citizen/ads/application/"+t.original.bookingNo+"/"+u:"/digit-ui/employee/ads/applicationsearch/application-details/"+t.original.bookingNo},t.original.bookingNo)))}},{Header:p("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r;return R(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(r=n.applicantDetail)||void 0===r?void 0:r.applicantName))},disableSortBy:!0},{Header:p("ADS_LOCALITY"),Cell:e=>{var t;let{row:n}=e;const r=null==n||null===(t=n.original)||void 0===t?void 0:t.cartDetails,o=null==r?void 0:r.map(e=>null==e?void 0:e.location).join(", ");return R(o)},disableSortBy:!0},{Header:p("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{let{row:t}=e;return R(""+p(null==t?void 0:t.original.bookingStatus))},disableSortBy:!0}],[]),B=[{i18nKey:"Booked",code:"BOOKED",value:p("ADS_BOOKED")},{i18nKey:"Booking in Progress",code:"BOOKING_CREATED",value:p("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:p("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:p("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:p("ADS_CANCELLED")},{i18nKey:"Available",code:"AVAILABLE",value:p("ADS_AVAILABLE")}],F=n.useCallback(e=>{0!==e.length&&(_("sortBy",e.id),_("sortOrder",e.desc?"DESC":"ASC"))},[]);function j(){_("offset",A("offset")-A("limit")),D(f)()}return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(t.Header,null,p("ADS_SEARCH_BOOKINGS")),r.createElement(t.Card,{className:"card-search-heading"},r.createElement("span",{style:{color:"#505A5F"}},p("Provide at least one parameter to search for an application"))),r.createElement(t.SearchForm,{onSubmit:f,handleSubmit:D},r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_BOOKING_NO")),r.createElement(t.TextInput,{name:"bookingNo",inputRef:S({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_APPLICANT_NAME")),r.createElement(t.TextInput,{name:"applicantName",inputRef:S({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("PT_COMMON_TABLE_COL_STATUS_LABEL")),r.createElement(a.Controller,{control:b,name:"status",render:e=>r.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:B,optionKey:"i18nKey",t:p,disable:!1})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:S({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:r.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),r.createElement(t.CardLabelError,null,null==C||null===(l=C.errors)||void 0===l||null===(s=l.mobileNumber)||void 0===s?void 0:s.message)),r.createElement(t.SearchField,null,r.createElement("label",null,p("FROM_DATE")),r.createElement(a.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:b})),r.createElement(t.SearchField,null,r.createElement("label",null,p("TO_DATE")),r.createElement(a.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:b})),r.createElement(t.SearchField,{className:"submit"},r.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),r.createElement("p",{style:{marginTop:"10px"},onClick:()=>{T({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),g(null),j()}},p("ES_COMMON_CLEAR_ALL")))),!d&&null!=m&&m.display?r.createElement(t.Card,{style:{marginTop:20}},p(m.display).split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):d||""===m?""!==m||d&&r.createElement(t.Loader,null):r.createElement(t.Table,{t:p,data:m,totalRecords:v,columns:M,getCellProps:e=>({style:{minWidth:e.column.Header===p("ADS_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){_("limit",Number(e.target.value)),D(f)()},currentPage:A("offset")/A("limit"),onNextPage:function(){_("offset",A("offset")+A("limit")),D(f)()},onPrevPage:j,pageSizeLimit:A("limit"),onSort:F,disableSort:!1,sortParams:[{id:A("sortBy"),desc:"DESC"===A("sortOrder")}]})),w&&r.createElement(h,{t:p,closeModal:()=>I(!1),actionCancelLabel:"BACK",actionCancelOnSubmit:()=>I(!1),actionSaveLabel:"ADS_CANCEL",actionSaveOnSubmit:P,onSubmit:P}))},E=e=>{var a,l;let{userType:s}=e;i.useParams();const{t:u}=o.useTranslation(),d="undefined"!=typeof window&&(null===(a=window.location)||void 0===a||null===(l=a.href)||void 0===l?void 0:l.includes("citizen"))?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState({}),[m,v]=n.useState(null);n.useEffect(()=>{if(m){const e=setTimeout(()=>{v(null)},1e3);return()=>clearTimeout(e)}},[m]);const g={enabled:!!(p&&Object.keys(p).length>0)},{isLoading:h,isSuccess:E,data:{bookingApplication:S,Count:b}={}}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:p},g);return r.createElement(r.Fragment,null,r.createElement(y,{t:u,isLoading:h,tenantId:d,setShowToast:v,onSubmit:function(e){const t=c({},e,e.toDate?{toDate:null==e?void 0:e.toDate}:{},e.fromDate?{fromDate:null==e?void 0:e.fromDate}:{});let n=Object.keys(t).filter(e=>t[e]).reduce((e,n)=>c({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{});!(Object.entries(n).length>0)||n.bookingNo||n.fromDate||n.status||n.applicantName||n.faceArea||n.toDate||n.mobileNumber?Object.entries(n).length>0&&n.fromDate&&!n.toDate||!n.fromDate&&n.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):f(n):v({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:E&&!h?S.length>0?S:{display:"ES_COMMON_NO_DATA"}:"",count:b,userType:s}),m&&r.createElement(t.Toast,{error:m.error,warning:m.warning,label:u(m.label),onClose:()=>{v(null)}}))},S=["path","url"],b=[],D=()=>{var e,n,a,l,s,u,c,p,f,m;const v=i.useRouteMatch(),{path:g}=v,h=(d(v,S),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewADSStepperForm")),y=null===(a=Digit)||void 0===a||null===(l=a.ComponentRegistryService)||void 0===l?void 0:l.getComponent("ADSMyApplications"),E=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSApplicationDetails"),D=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ADSResponseCitizen"),_=null===(f=Digit)||void 0===f||null===(m=f.ComponentRegistryService)||void 0===m?void 0:m.getComponent("CitizenApplicationOverview");return r.createElement("span",{className:"ads-citizen",style:{width:"100%"}},r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,(void 0===(A=b)&&(A=[]),A.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":r.createElement(t.BackButton,null,"Back")),r.createElement(t.PrivateRoute,{path:g+"/bookad",component:h}),r.createElement(t.PrivateRoute,{path:g+"/myBookings",component:y}),r.createElement(t.PrivateRoute,{path:g+"/application/:acknowledgementIds/:tenantId",component:E}),r.createElement(t.PrivateRoute,{path:g+"/adsservice/:response/:bookingNo",component:D}),r.createElement(t.PrivateRoute,{path:g+"/adsservice/:application-overview/:bookingNo",component:_}))));var A},_=e=>{var n;let{status:i,searchParams:a,onAssignmentChange:l,statusMap:s}=e;return o.useTranslation(),r.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>l(c({},e,{state:i.state}),i),checked:null==a||null===(u=a.applicationStatus)||void 0===u?void 0:u.some(e=>e.uuid===i.uuid),label:i.name+" ("+((null==s||null===(n=s.find(e=>e.statusid===i.uuid))||void 0===n?void 0:n.count)||"-")+")"});var u},A=e=>{var i,a,l,s,u;let{onAssignmentChange:d,searchParams:p,businessServices:f,statusMap:m}=e;const{t:v}=o.useTranslation(),[g,h]=n.useState(!1),{data:y,isLoading:E}=Digit.Hooks.useApplicationStatusGeneral({businessServices:f},{});console.log("statusData :>> ",y);const{userRoleStates:S}=y||{},b={"ADV.CREATE":v("ES_ADV_NEW_BOOKING"),"ADV.UPDATE":v("ES_ADV_UPDATE_BOOKING")},D=(e,t)=>t(b[e.stateBusinessService])+" - "+t("ES_ADS_COMMON_STATUS_"+(e.state||"CREATED"));return E?r.createElement(t.Loader,null):null!=S&&S.filter(e=>!e.isTerminateState).length?r.createElement("div",{className:"status-container"},r.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_INBOX_STATUS")),null==S||null===(i=S.filter(e=>!e.isTerminateState))||void 0===i||null===(a=i.slice(0,4))||void 0===a?void 0:a.map((e,t)=>r.createElement(_,{businessServices:f,key:t,onAssignmentChange:d,status:c({name:D(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m})),(null==S||null===(l=S.filter(e=>!e.isTerminateState))||void 0===l?void 0:l.slice(4).length)>0?r.createElement(r.Fragment,null,g&&(null==S||null===(s=S.filter(e=>!e.isTerminateState))||void 0===s||null===(u=s.slice(4))||void 0===u?void 0:u.map((e,t)=>r.createElement(_,{businessServices:f,key:e.uuid,onAssignmentChange:d,status:c({name:D(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m}))),r.createElement("div",{className:"filter-button",onClick:()=>h(!g)}," ",v(g?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(e,t){return e(t={exports:{}},t.exports),t.exports}var N=C(function(e,t){(function(){var n="Expected a function",r="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",a="[object Array]",l="[object Boolean]",s="[object Date]",u="[object Error]",c="[object Function]",d="[object GeneratorFunction]",p="[object Map]",f="[object Number]",m="[object Object]",v="[object RegExp]",g="[object Set]",h="[object String]",y="[object Symbol]",E="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",D="[object Float32Array]",_="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",x="[object Uint8Array]",w="[object Uint16Array]",I="[object Uint32Array]",k=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(R.source),B=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,V=RegExp(W.source),G=/^\s+/,K=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,re=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",fe="["+ce+"]",me="\\d+",ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",ge="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",he="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",De="(?:"+ve+"|"+ge+")",_e="(?:"+be+"|"+ge+")",Ae="(?:"+fe+"|"+he+")?",Te="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[ye,Ee,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",Ce="(?:"+["[\\u2700-\\u27bf]",Ee,Se].join("|")+")"+Te,Ne="(?:"+[ye+fe+"?",fe,Ee,Se,"[\\ud800-\\udfff]"].join("|")+")",xe=RegExp("['’]","g"),we=RegExp(fe,"g"),Ie=RegExp(he+"(?="+he+")|"+Ne+Te,"g"),ke=RegExp([be+"?"+ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,be,"$"].join("|")+")",_e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,be+De,"$"].join("|")+")",be+"?"+De+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ce].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Oe=/[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"],Pe=-1,Me={};Me[D]=Me[_]=Me[A]=Me[C]=Me[N]=Me[x]=Me["[object Uint8ClampedArray]"]=Me[w]=Me[I]=!0,Me[i]=Me[a]=Me[S]=Me[l]=Me[b]=Me[s]=Me[u]=Me[c]=Me[p]=Me[f]=Me[m]=Me[v]=Me[g]=Me[h]=Me[E]=!1;var Be={};Be[i]=Be[a]=Be[S]=Be[b]=Be[l]=Be[s]=Be[D]=Be[_]=Be[A]=Be[C]=Be[N]=Be[p]=Be[f]=Be[m]=Be[v]=Be[g]=Be[h]=Be[y]=Be[x]=Be["[object Uint8ClampedArray]"]=Be[w]=Be[I]=!0,Be[u]=Be[c]=Be[E]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},je=parseFloat,He=parseInt,Ue="object"==typeof T&&T&&T.Object===Object&&T,ze="object"==typeof self&&self&&self.Object===Object&&self,qe=Ue||ze||Function("return this")(),We=t&&!t.nodeType&&t,Ve=We&&e&&!e.nodeType&&e,Ge=Ve&&Ve.exports===We,Ke=Ge&&Ue.process,$e=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ye=$e&&$e.isArrayBuffer,Xe=$e&&$e.isDate,Ze=$e&&$e.isMap,Je=$e&&$e.isRegExp,Qe=$e&&$e.isSet,et=$e&&$e.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function lt(e,t){return!(null==e||!e.length)&&ht(e,t,0)>-1}function st(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function dt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function pt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function ft(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=bt("length");function vt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function gt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function ht(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):gt(e,Et,n)}function yt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Et(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function Dt(e){return function(t){return null==e?void 0:e[t]}}function _t(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function At(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Tt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ct(e){return e?e.slice(0,Wt(e)+1).replace(G,""):e}function Nt(e){return function(t){return e(t)}}function xt(e,t){return ut(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function It(e,t){for(var n=-1,r=e.length;++n<r&&ht(t,e[n],0)>-1;);return n}function kt(e,t){for(var n=e.length;n--&&ht(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Ot=Dt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=Dt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Pt(e){return"\\"+Fe[e]}function Mt(e){return Le.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function jt(e,t){for(var n=-1,o=e.length,i=0,a=[];++n<o;){var l=e[n];l!==t&&l!==r||(e[n]=r,a[i++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return Mt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):mt(e)}function qt(e){return Mt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Wt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Vt=Dt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var T,K=(t=null==t?qe:Gt.defaults(qe.Object(),t,Gt.pick(qe,Re))).Array,ce=t.Date,de=t.Error,pe=t.Function,fe=t.Math,me=t.Object,ve=t.RegExp,ge=t.String,he=t.TypeError,ye=K.prototype,Ee=me.prototype,Se=t["__core-js_shared__"],be=pe.prototype.toString,De=Ee.hasOwnProperty,_e=0,Ae=(T=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",Te=Ee.toString,Ce=be.call(me),Ne=qe._,Ie=ve("^"+be.call(De).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ge?t.Buffer:void 0,Fe=t.Symbol,Ue=t.Uint8Array,ze=Le?Le.allocUnsafe:void 0,We=Ft(me.getPrototypeOf,me),Ve=me.create,Ke=Ee.propertyIsEnumerable,$e=ye.splice,mt=Fe?Fe.isConcatSpreadable:void 0,Dt=Fe?Fe.iterator:void 0,Kt=Fe?Fe.toStringTag:void 0,$t=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==qe.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==qe.Date.now&&ce.now,Zt=t.setTimeout!==qe.setTimeout&&t.setTimeout,Jt=fe.ceil,Qt=fe.floor,en=me.getOwnPropertySymbols,tn=Le?Le.isBuffer:void 0,nn=t.isFinite,rn=ye.join,on=Ft(me.keys,me),an=fe.max,ln=fe.min,sn=ce.now,un=t.parseInt,cn=fe.random,dn=ye.reverse,pn=Qo(t,"DataView"),fn=Qo(t,"Map"),mn=Qo(t,"Promise"),vn=Qo(t,"Set"),gn=Qo(t,"WeakMap"),hn=Qo(me,"create"),yn=gn&&new gn,En={},Sn=xi(pn),bn=xi(fn),Dn=xi(mn),_n=xi(vn),An=xi(gn),Tn=Fe?Fe.prototype:void 0,Cn=Tn?Tn.valueOf:void 0,Nn=Tn?Tn.toString:void 0;function xn(e){if(Va(e)&&!Ra(e)&&!(e instanceof Ln)){if(e instanceof kn)return e;if(De.call(e,"__wrapped__"))return wi(e)}return new kn(e)}var wn=function(){function e(){}return function(t){if(!Wa(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ln(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Rn(e);this.size=t.size}function Fn(e,t){var n=Ra(e),r=!n&&Oa(e),o=!n&&!r&&Fa(e),i=!n&&!r&&!o&&Qa(e),a=n||r||o||i,l=a?Tt(e.length,ge):[],s=l.length;for(var u in e)!t&&!De.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ai(u,s))||l.push(u);return l}function jn(e){var t=e.length;return t?e[Pr(0,t-1)]:void 0}function Hn(e,t){return _i(ho(e),Yn(t,0,e.length))}function Un(e){return _i(ho(e))}function zn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function qn(e,t,n){var r=e[t];De.call(e,t)&&Ia(r,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function Vn(e,t,n,r){return er(e,function(e,o,i){t(r,e,n(e),i)}),r}function Gn(e,t){return e&&yo(t,bl(t),e)}function Kn(e,t,n){"__proto__"==t&&$t?$t(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function $n(e,t){for(var n=-1,r=t.length,o=K(r),i=null==e;++n<r;)o[n]=i?void 0:gl(e,t[n]);return o}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,r,o,a){var u,E=1&t,T=2&t,k=4&t;if(n&&(u=o?n(e,r,o,a):n(e)),void 0!==u)return u;if(!Wa(e))return e;var L=Ra(e);if(L){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!E)return ho(e,u)}else{var O=ni(e),R=O==c||O==d;if(Fa(e))return co(e,E);if(O==m||O==i||R&&!o){if(u=T||R?{}:oi(e),!E)return T?function(e,t){return yo(e,ti(e),t)}(e,function(e,t){return e&&yo(t,Dl(t),e)}(u,e)):function(e,t){return yo(e,ei(e),t)}(e,Gn(u,e))}else{if(!Be[O])return o?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case S:return po(e);case l:case s:return new r(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case _:case A:case C:case N:case x:case"[object Uint8ClampedArray]":case w:case I:return fo(e,n);case p:return new r;case f:case h:return new r(e);case v:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new r;case y:return Cn?me(Cn.call(e)):{}}}(e,O,E)}}a||(a=new Bn);var P=a.get(e);if(P)return P;a.set(e,u),Xa(e)?e.forEach(function(r){u.add(Xn(r,t,n,r,e,a))}):Ga(e)&&e.forEach(function(r,o){u.set(o,Xn(r,t,n,o,e,a))});var M=L?void 0:(k?T?Go:Vo:T?Dl:bl)(e);return rt(M||e,function(r,o){M&&(r=e[o=r]),qn(u,o,Xn(r,t,n,o,e,a))}),u}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var o=n[r],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,r){if("function"!=typeof e)throw new he(n);return Ei(function(){e.apply(void 0,r)},t)}function Qn(e,t,n,r){var o=-1,i=lt,a=!0,l=e.length,s=[],u=t.length;if(!l)return s;n&&(t=ut(t,Nt(n))),r?(i=st,a=!1):t.length>=200&&(i=wt,a=!1,t=new Mn(t));e:for(;++o<l;){var c=e[o],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var p=u;p--;)if(t[p]===d)continue e;s.push(c)}else i(t,d,r)||s.push(c)}return s}xn.templateSettings={escape:F,evaluate:j,interpolate:H,variable:"",imports:{_:xn}},(xn.prototype=In.prototype).constructor=xn,(kn.prototype=wn(In.prototype)).constructor=kn,(Ln.prototype=wn(In.prototype)).constructor=Ln,On.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return De.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:De.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0||(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return Wn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(fn||Rn),string:new On}},Pn.prototype.delete=function(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Zo(this,e).get(e)},Pn.prototype.has=function(e){return Zo(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=bo(sr),tr=bo(ur,!0);function nr(e,t){var n=!0;return er(e,function(e,r,o){return n=!!t(e,r,o)}),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],a=t(i);if(null!=a&&(void 0===l?a==a&&!Ja(a):n(a,l)))var l=a,s=i}return s}function or(e,t){var n=[];return er(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function ir(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ii),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?ir(l,t-1,n,r,o):ct(o,l):r||(o[o.length]=l)}return o}var ar=Do(),lr=Do(!0);function sr(e,t){return e&&ar(e,t,bl)}function ur(e,t){return e&&lr(e,t,bl)}function cr(e,t){return at(t,function(t){return Ua(e[t])})}function dr(e,t){for(var n=0,r=(t=ao(t,e)).length;null!=e&&n<r;)e=e[Ni(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ra(e)?r:ct(r,n(e))}function fr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=De.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var r=!0}catch(e){}var o=Te.call(e);return r&&(t?e[Kt]=n:delete e[Kt]),o}(e):function(e){return Te.call(e)}(e)}function mr(e,t){return e>t}function vr(e,t){return null!=e&&De.call(e,t)}function gr(e,t){return null!=e&&t in me(e)}function hr(e,t,n){for(var r=n?st:lt,o=e[0].length,i=e.length,a=i,l=K(i),s=Infinity,u=[];a--;){var c=e[a];a&&t&&(c=ut(c,Nt(t))),s=ln(c.length,s),l[a]=!n&&(t||o>=120&&c.length>=120)?new Mn(a&&c):void 0}c=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<s;){var f=c[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?wt(p,m):r(u,m,n))){for(a=i;--a;){var v=l[a];if(!(v?wt(v,m):r(e[a],m,n)))continue e}p&&p.push(m),u.push(f)}}return u}function yr(e,t,n){var r=null==(e=vi(e,t=ao(t,e)))?e:e[Ni(Hi(t))];return null==r?void 0:tt(r,e,n)}function Er(e){return Va(e)&&fr(e)==i}function Sr(e,t,n,r,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,r,o,c){var d=Ra(e),E=Ra(t),D=d?a:ni(e),_=E?a:ni(t),A=(D=D==i?m:D)==m,T=(_=_==i?m:_)==m,C=D==_;if(C&&Fa(e)){if(!Fa(t))return!1;d=!0,A=!1}if(C&&!A)return c||(c=new Bn),d||Qa(e)?qo(e,t,n,r,o,c):function(e,t,n,r,o,i,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new Ue(e),new Ue(t)));case l:case s:case f:return Ia(+e,+t);case u:return e.name==t.name&&e.message==t.message;case v:case h:return e==t+"";case p:var c=Bt;case g:if(c||(c=Ht),e.size!=t.size&&!(1&r))return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var m=qo(c(e),c(t),r,o,i,a);return a.delete(e),m;case y:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,D,n,r,o,c);if(!(1&n)){var N=A&&De.call(e,"__wrapped__"),x=T&&De.call(t,"__wrapped__");if(N||x){var w=N?e.value():e,I=x?t.value():t;return c||(c=new Bn),o(w,I,n,r,c)}}return!!C&&(c||(c=new Bn),function(e,t,n,r,o,i){var a=1&n,l=Vo(e),s=l.length;if(s!=Vo(t).length&&!a)return!1;for(var u=s;u--;){var c=l[u];if(!(a?c in t:De.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var m=a;++u<s;){var v=e[c=l[u]],g=t[c];if(r)var h=a?r(g,v,c,t,e,i):r(v,g,c,e,t,i);if(!(void 0===h?v===g||o(v,g,n,r,i):h)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var y=e.constructor,E=t.constructor;y==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof E&&E instanceof E||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,r,o,c))}(e,t,n,r,Sr,o))}function br(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=me(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<i;){var s=(l=n[o])[0],u=e[s],c=l[1];if(a&&l[2]){if(void 0===u&&!(s in e))return!1}else{var d=new Bn;if(r)var p=r(u,c,s,e,t,d);if(!(void 0===p?Sr(c,u,3,r,d):p))return!1}}return!0}function Dr(e){return!(!Wa(e)||(t=e,Ae&&Ae in t))&&(Ua(e)?Ie:oe).test(xi(e));var t}function _r(e){return"function"==typeof e?e:null==e?Kl:"object"==typeof e?Ra(e)?xr(e[0],e[1]):Nr(e):ns(e)}function Ar(e){if(!di(e))return on(e);var t=[];for(var n in me(e))De.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Tr(e,t){return e<t}function Cr(e,t){var n=-1,r=Ma(e)?K(e.length):[];return er(e,function(e,o,i){r[++n]=t(e,o,i)}),r}function Nr(e){var t=Jo(e);return 1==t.length&&t[0][2]?fi(t[0][0],t[0][1]):function(n){return n===e||br(n,e,t)}}function xr(e,t){return si(e)&&pi(t)?fi(Ni(e),t):function(n){var r=gl(n,e);return void 0===r&&r===t?hl(n,e):Sr(t,r,3)}}function wr(e,t,n,r,o){e!==t&&ar(t,function(i,a){if(o||(o=new Bn),Wa(i))!function(e,t,n,r,o,i,a){var l=hi(e,n),s=hi(t,n),u=a.get(s);if(u)zn(e,n,u);else{var c=i?i(l,s,n+"",e,t,a):void 0,d=void 0===c;if(d){var p=Ra(s),f=!p&&Fa(s),m=!p&&!f&&Qa(s);c=s,p||f||m?Ra(l)?c=l:Ba(l)?c=ho(l):f?(d=!1,c=co(s,!0)):m?(d=!1,c=fo(s,!0)):c=[]:$a(s)||Oa(s)?(c=l,Oa(l)?c=ll(l):Wa(l)&&!Ua(l)||(c=oi(s))):d=!1}d&&(a.set(s,c),o(c,s,r,i,a),a.delete(s)),zn(e,n,c)}}(e,t,a,n,wr,r,o);else{var l=r?r(hi(e,a),i,a+"",e,t,o):void 0;void 0===l&&(l=i),zn(e,a,l)}},Dl)}function Ir(e,t){var n=e.length;if(n)return ai(t+=t<0?n:0,n)?e[t]:void 0}function kr(e,t,n){t=t.length?ut(t,function(e){return Ra(e)?function(t){return dr(t,1===e.length?e[0]:e)}:e}):[Kl];var r=-1;return t=ut(t,Nt(Xo())),function(e,t){var r=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,a=o.length,l=n.length;++r<a;){var s=mo(o[r],i[r]);if(s)return r>=l?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Cr(e,function(e,n,o){return{criteria:ut(t,function(t){return t(e)}),index:++r,value:e}}))}function Lr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=dr(e,a);n(l,a)&&Hr(i,ao(a,e),l)}return i}function Or(e,t,n,r){var o=r?yt:ht,i=-1,a=t.length,l=e;for(e===t&&(t=ho(t)),n&&(l=ut(e,Nt(n)));++i<a;)for(var s=0,u=t[i],c=n?n(u):u;(s=o(l,c,s,r))>-1;)l!==e&&$e.call(l,s,1),$e.call(e,s,1);return e}function Rr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ai(o)?$e.call(e,o,1):Jr(e,o)}}return e}function Pr(e,t){return e+Qt(cn()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return Si(mi(e,t,Kl),e+"")}function Fr(e){return jn(Il(e))}function jr(e,t){var n=Il(e);return _i(n,Yn(t,0,n.length))}function Hr(e,t,n,r){if(!Wa(e))return e;for(var o=-1,i=(t=ao(t,e)).length,a=i-1,l=e;null!=l&&++o<i;){var s=Ni(t[o]),u=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=a){var c=l[s];void 0===(u=r?r(c,s,l):void 0)&&(u=Wa(c)?c:ai(t[o+1])?[]:{})}qn(l,s,u),l=l[s]}return e}var Ur=yn?function(e,t){return yn.set(e,t),e}:Kl,zr=$t?function(e,t){return $t(e,"toString",{configurable:!0,enumerable:!1,value:Wl(t),writable:!0})}:Kl;function qr(e){return _i(Il(e))}function Wr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=K(o);++r<o;)i[r]=e[r+t];return i}function Vr(e,t){var n;return er(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!Ja(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return Kr(e,t,Kl,n)}function Kr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,l=null===t,s=Ja(t),u=void 0===t;o<i;){var c=Qt((o+i)/2),d=n(e[c]),p=void 0!==d,f=null===d,m=d==d,v=Ja(d);if(a)var g=r||m;else g=u?m&&(r||p):l?m&&p&&(r||!f):s?m&&p&&!f&&(r||!v):!f&&!v&&(r?d<=t:d<t);g?o=c+1:i=c}return ln(i,4294967294)}function $r(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Ia(l,s)){var s=l;i[o++]=0===a?0:a}}return i}function Yr(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xr(e){if("string"==typeof e)return e;if(Ra(e))return ut(e,Xr)+"";if(Ja(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zr(e,t,n){var r=-1,o=lt,i=e.length,a=!0,l=[],s=l;if(n)a=!1,o=st;else if(i>=200){var u=t?null:Bo(e);if(u)return Ht(u);a=!1,o=wt,s=new Mn}else s=t?[]:l;e:for(;++r<i;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=s.length;p--;)if(s[p]===d)continue e;t&&s.push(d),l.push(c)}else o(s,d,n)||(s!==l&&s.push(d),l.push(c))}return l}function Jr(e,t){return null==(e=vi(e,t=ao(t,e)))||delete e[Ni(Hi(t))]}function Qr(e,t,n,r){return Hr(e,t,n(dr(e,t)),r)}function eo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?Wr(e,r?0:i,r?i+1:o):Wr(e,r?i+1:0,r?o:i)}function to(e,t){var n=e;return n instanceof Ln&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function no(e,t,n){var r=e.length;if(r<2)return r?Zr(e[0]):[];for(var o=-1,i=K(r);++o<r;)for(var a=e[o],l=-1;++l<r;)l!=o&&(i[o]=Qn(i[o]||a,e[l],t,n));return Zr(ir(i,1),t,n)}function ro(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;)n(a,e[r],r<i?t[r]:void 0);return a}function oo(e){return Ba(e)?e:[]}function io(e){return"function"==typeof e?e:Kl}function ao(e,t){return Ra(e)?e:si(e,t)?[e]:Ci(sl(e))}var lo=Br;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Wr(e,t,n)}var uo=Yt||function(e){return qe.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function fo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Ja(e),a=void 0!==t,l=null===t,s=t==t,u=Ja(t);if(!l&&!u&&!i&&e>t||i&&a&&s&&!l&&!u||r&&a&&s||!n&&s||!o)return 1;if(!r&&!i&&!u&&e<t||u&&n&&o&&!r&&!i||l&&n&&o||!a&&o||!s)return-1}return 0}function vo(e,t,n,r){for(var o=-1,i=e.length,a=n.length,l=-1,s=t.length,u=an(i-a,0),c=K(s+u),d=!r;++l<s;)c[l]=t[l];for(;++o<a;)(d||o<i)&&(c[n[o]]=e[o]);for(;u--;)c[l++]=e[o++];return c}function go(e,t,n,r){for(var o=-1,i=e.length,a=-1,l=n.length,s=-1,u=t.length,c=an(i-l,0),d=K(c+u),p=!r;++o<c;)d[o]=e[o];for(var f=o;++s<u;)d[f+s]=t[s];for(;++a<l;)(p||o<i)&&(d[f+n[a]]=e[o++]);return d}function ho(e,t){var n=-1,r=e.length;for(t||(t=K(r));++n<r;)t[n]=e[n];return t}function yo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var l=t[i],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),o?Kn(n,l,s):qn(n,l,s)}return n}function Eo(e,t){return function(n,r){var o=Ra(n)?nt:Vn,i=t?t():{};return o(n,e,Xo(r,2),i)}}function So(e){return Br(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&li(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=me(t);++r<o;){var l=n[r];l&&e(t,l,r,i)}return t})}function bo(e,t){return function(n,r){if(null==n)return n;if(!Ma(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=me(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Do(e){return function(t,n,r){for(var o=-1,i=me(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}function _o(e){return function(t){var n=Mt(t=sl(t))?qt(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function Ao(e){return function(t){return dt(Ul(Ol(t).replace(xe,"")),e,"")}}function To(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=wn(e.prototype),r=e.apply(n,t);return Wa(r)?r:n}}function Co(e){return function(t,n,r){var o=me(t);if(!Ma(t)){var i=Xo(n,3);t=bl(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[i?t[a]:a]:void 0}}function No(e){return Wo(function(t){var r=t.length,o=r,i=kn.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new he(n);if(i&&!l&&"wrapper"==$o(a))var l=new kn([],!0)}for(o=l?o:r;++o<r;){var s=$o(a=t[o]),u="wrapper"==s?Ko(a):void 0;l=u&&ui(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[$o(u[0])].apply(l,u[3]):1==a.length&&ui(a)?l[s]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ra(n))return l.plant(n).value();for(var o=0,i=r?t[o].apply(this,e):n;++o<r;)i=t[o].call(this,i);return i}})}function xo(e,t,n,r,o,i,a,l,s,u){var c=128&t,d=1&t,p=2&t,f=24&t,m=512&t,v=p?void 0:To(e);return function g(){for(var h=arguments.length,y=K(h),E=h;E--;)y[E]=arguments[E];if(f)var S=Yo(g),b=Lt(y,S);if(r&&(y=vo(y,r,o,f)),i&&(y=go(y,i,a,f)),h-=b,f&&h<u){var D=jt(y,S);return Po(e,t,xo,g.placeholder,n,y,D,l,s,u-h)}var _=d?n:this,A=p?_[e]:e;return h=y.length,l?y=gi(y,l):m&&h>1&&y.reverse(),c&&s<h&&(y.length=s),this&&this!==qe&&this instanceof g&&(A=v||To(A)),A.apply(_,y)}}function wo(e,t){return function(n,r){return function(e,t,n,r){return sr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Io(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Xr(n),r=Xr(r)):(n=Yr(n),r=Yr(r)),o=e(n,r)}return o}}function ko(e){return Wo(function(t){return t=ut(t,Nt(Xo())),Br(function(n){var r=this;return e(t,function(e){return tt(e,r,n)})})})}function Lo(e,t){var n=(t=void 0===t?" ":Xr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Jt(e/zt(t)));return Mt(t)?so(qt(r),0,e).join(""):r.slice(0,e)}function Oo(e){return function(t,n,r){return r&&"number"!=typeof r&&li(t,n,r)&&(n=r=void 0),t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n,r){for(var o=-1,i=an(Jt((t-e)/(n||1)),0),a=K(i);i--;)a[r?i:++o]=e,e+=n;return a}(t,n,r=void 0===r?t<n?1:-1:rl(r),e)}}function Ro(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=al(t),n=al(n)),e(t,n)}}function Po(e,t,n,r,o,i,a,l,s,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,l,s,u],p=n.apply(void 0,d);return ui(e)&&yi(p,d),p.placeholder=r,bi(p,e,t)}function Mo(e){var t=fe[e];return function(e,n){if(e=al(e),(n=null==n?0:ln(ol(n),292))&&nn(e)){var r=(sl(e)+"e").split("e");return+((r=(sl(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Bo=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Jl;function Fo(e){return function(t){var n=ni(t);return n==p?Bt(t):n==g?Ut(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function jo(e,t,o,i,a,l,s,u){var c=2&t;if(!c&&"function"!=typeof e)throw new he(n);var d=i?i.length:0;if(d||(t&=-97,i=a=void 0),s=void 0===s?s:an(ol(s),0),u=void 0===u?u:ol(u),d-=a?a.length:0,64&t){var p=i,f=a;i=a=void 0}var m=c?void 0:Ko(e),v=[e,t,o,i,a,p,f,l,s,u];if(m&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var a=t[3];if(a){var l=e[3];e[3]=l?vo(l,a,t[4]):a,e[4]=l?jt(e[3],r):t[4]}(a=t[5])&&(e[5]=(l=e[5])?go(l,a,t[6]):a,e[6]=l?jt(e[5],r):t[6]),(a=t[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?t[8]:ln(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,m),e=v[0],t=v[1],o=v[2],i=v[3],a=v[4],!(u=v[9]=void 0===v[9]?c?0:e.length:an(v[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var r=To(e);return function o(){for(var i=arguments.length,a=K(i),l=i,s=Yo(o);l--;)a[l]=arguments[l];var u=i<3&&a[0]!==s&&a[i-1]!==s?[]:jt(a,s);if((i-=u.length)<n)return Po(e,t,xo,o.placeholder,void 0,a,u,void 0,void 0,n-i);var c=this&&this!==qe&&this instanceof o?r:e;return tt(c,this,a)}}(e,t,u):32!=t&&33!=t||a.length?xo.apply(void 0,v):function(e,t,n,r){var o=1&t,i=To(e);return function t(){for(var a=-1,l=arguments.length,s=-1,u=r.length,c=K(u+l),d=this&&this!==qe&&this instanceof t?i:e;++s<u;)c[s]=r[s];for(;l--;)c[s++]=arguments[++a];return tt(d,o?n:this,c)}}(e,t,o,i);else var g=function(e,t,n){var r=1&t,o=To(e);return function t(){var i=this&&this!==qe&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,o);return bi((m?Ur:yi)(g,v),e,t)}function Ho(e,t,n,r){return void 0===e||Ia(e,Ee[n])&&!De.call(r,n)?t:e}function Uo(e,t,n,r,o,i){return Wa(e)&&Wa(t)&&(i.set(t,e),wr(e,t,void 0,Uo,i),i.delete(t)),e}function zo(e){return $a(e)?void 0:e}function qo(e,t,n,r,o,i){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new Mn:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var m=e[d],v=t[d];if(r)var g=a?r(v,m,d,t,e,i):r(m,v,d,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!ft(t,function(e,t){if(!wt(f,t)&&(m===e||o(m,e,n,r,i)))return f.push(t)})){p=!1;break}}else if(m!==v&&!o(m,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Wo(e){return Si(mi(e,void 0,Pi),e+"")}function Vo(e){return pr(e,bl,ei)}function Go(e){return pr(e,Dl,ti)}var Ko=yn?function(e){return yn.get(e)}:Jl;function $o(e){for(var t=e.name+"",n=En[t],r=De.call(En,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function Yo(e){return(De.call(xn,"placeholder")?xn:e).placeholder}function Xo(){var e=xn.iteratee||$l;return e=e===$l?_r:e,arguments.length?e(arguments[0],arguments[1]):e}function Zo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=bl(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,pi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Dr(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=me(e),at(en(e),function(t){return Ke.call(e,t)}))}:is,ti=en?function(e){for(var t=[];e;)ct(t,ei(e)),e=We(e);return t}:is,ni=fr;function ri(e,t,n){for(var r=-1,o=(t=ao(t,e)).length,i=!1;++r<o;){var a=Ni(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&qa(o)&&ai(a,o)&&(Ra(e)||Oa(e))}function oi(e){return"function"!=typeof e.constructor||di(e)?{}:wn(We(e))}function ii(e){return Ra(e)||Oa(e)||!!(mt&&e&&e[mt])}function ai(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function li(e,t,n){if(!Wa(n))return!1;var r=typeof t;return!!("number"==r?Ma(n)&&ai(t,n.length):"string"==r&&t in n)&&Ia(n[t],e)}function si(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||z.test(e)||!U.test(e)||null!=t&&e in me(t)}function ui(e){var t=$o(e),n=xn[t];if("function"!=typeof n||!(t in Ln.prototype))return!1;if(e===n)return!0;var r=Ko(n);return!!r&&e===r[0]}(pn&&ni(new pn(new ArrayBuffer(1)))!=b||fn&&ni(new fn)!=p||mn&&"[object Promise]"!=ni(mn.resolve())||vn&&ni(new vn)!=g||gn&&ni(new gn)!=E)&&(ni=function(e){var t=fr(e),n=t==m?e.constructor:void 0,r=n?xi(n):"";if(r)switch(r){case Sn:return b;case bn:return p;case Dn:return"[object Promise]";case _n:return g;case An:return E}return t});var ci=Se?Ua:as;function di(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function pi(e){return e==e&&!Wa(e)}function fi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=an(r.length-t,0),a=K(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=K(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),tt(e,this,l)}}function vi(e,t){return t.length<2?e:dr(e,Wr(t,0,-1))}function gi(e,t){for(var n=e.length,r=ln(t.length,n),o=ho(e);r--;){var i=t[r];e[r]=ai(i,n)?o[i]:void 0}return e}function hi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var yi=Di(Ur),Ei=Zt||function(e,t){return qe.setTimeout(e,t)},Si=Di(zr);function bi(e,t,n){var r=t+"";return Si(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace($,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return rt(o,function(n){var r="_."+n[0];t&n[1]&&!lt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(X):[]}(r),n)))}function Di(e){var t=0,n=0;return function(){var r=sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function _i(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=Pr(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Ai,Ti,Ci=(Ai=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(q,function(e,n,r,o){t.push(r?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ti.size&&Ti.clear(),e}),Ti=Ai.cache,Ai);function Ni(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function xi(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wi(e){if(e instanceof Ln)return e.clone();var t=new kn(e.__wrapped__,e.__chain__);return t.__actions__=ho(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ii=Br(function(e,t){return Ba(e)?Qn(e,ir(t,1,Ba,!0)):[]}),ki=Br(function(e,t){var n=Hi(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ir(t,1,Ba,!0),Xo(n,2)):[]}),Li=Br(function(e,t){var n=Hi(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ir(t,1,Ba,!0),void 0,n):[]});function Oi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),gt(e,Xo(t,3),o)}function Ri(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ol(n),o=n<0?an(r+o,0):ln(o,r-1)),gt(e,Xo(t,3),o,!0)}function Pi(e){return null!=e&&e.length?ir(e,1):[]}function Mi(e){return e&&e.length?e[0]:void 0}var Bi=Br(function(e){var t=ut(e,oo);return t.length&&t[0]===e[0]?hr(t):[]}),Fi=Br(function(e){var t=Hi(e),n=ut(e,oo);return t===Hi(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hr(n,Xo(t,2)):[]}),ji=Br(function(e){var t=Hi(e),n=ut(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hr(n,void 0,t):[]});function Hi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ui=Br(zi);function zi(e,t){return e&&e.length&&t&&t.length?Or(e,t):e}var qi=Wo(function(e,t){var n=null==e?0:e.length,r=$n(e,t);return Rr(e,ut(t,function(e){return ai(e,n)?+e:e}).sort(mo)),r});function Wi(e){return null==e?e:dn.call(e)}var Vi=Br(function(e){return Zr(ir(e,1,Ba,!0))}),Gi=Br(function(e){var t=Hi(e);return Ba(t)&&(t=void 0),Zr(ir(e,1,Ba,!0),Xo(t,2))}),Ki=Br(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,Zr(ir(e,1,Ba,!0),void 0,t)});function $i(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=an(e.length,t),!0}),Tt(t,function(t){return ut(e,bt(t))})}function Yi(e,t){if(!e||!e.length)return[];var n=$i(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var Xi=Br(function(e,t){return Ba(e)?Qn(e,t):[]}),Zi=Br(function(e){return no(at(e,Ba))}),Ji=Br(function(e){var t=Hi(e);return Ba(t)&&(t=void 0),no(at(e,Ba),Xo(t,2))}),Qi=Br(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,no(at(e,Ba),void 0,t)}),ea=Br($i),ta=Br(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yi(e,n)});function na(e){var t=xn(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var oa=Wo(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return $n(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Ln&&ai(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[o],thisArg:void 0}),new kn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ia=Eo(function(e,t,n){De.call(e,n)?++e[n]:Kn(e,n,1)}),aa=Co(Oi),la=Co(Ri);function sa(e,t){return(Ra(e)?rt:er)(e,Xo(t,3))}function ua(e,t){return(Ra(e)?ot:tr)(e,Xo(t,3))}var ca=Eo(function(e,t,n){De.call(e,n)?e[n].push(t):Kn(e,n,[t])}),da=Br(function(e,t,n){var r=-1,o="function"==typeof t,i=Ma(e)?K(e.length):[];return er(e,function(e){i[++r]=o?tt(t,e,n):yr(e,t,n)}),i}),pa=Eo(function(e,t,n){Kn(e,n,t)});function fa(e,t){return(Ra(e)?ut:Cr)(e,Xo(t,3))}var ma=Eo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),va=Br(function(e,t){if(null==e)return[];var n=t.length;return n>1&&li(e,t[0],t[1])?t=[]:n>2&&li(t[0],t[1],t[2])&&(t=[t[0]]),kr(e,ir(t,1),[])}),ga=Xt||function(){return qe.Date.now()};function ha(e,t,n){return t=n?void 0:t,jo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var r;if("function"!=typeof t)throw new he(n);return e=ol(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var Ea=Br(function(e,t,n){var r=1;if(n.length){var o=jt(n,Yo(Ea));r|=32}return jo(e,r,t,n,o)}),Sa=Br(function(e,t,n){var r=3;if(n.length){var o=jt(n,Yo(Sa));r|=32}return jo(t,r,e,n,o)});function ba(e,t,r){var o,i,a,l,s,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new he(n);function m(t){var n=o,r=i;return o=i=void 0,c=t,l=e.apply(r,n)}function v(e){return c=e,s=Ei(h,t),d?m(e):l}function g(e){var n=e-u;return void 0===u||n>=t||n<0||p&&e-c>=a}function h(){var e=ga();if(g(e))return y(e);s=Ei(h,function(e){var n=t-(e-u);return p?ln(n,a-(e-c)):n}(e))}function y(e){return s=void 0,f&&o?m(e):(o=i=void 0,l)}function E(){var e=ga(),n=g(e);if(o=arguments,i=this,u=e,n){if(void 0===s)return v(u);if(p)return uo(s),s=Ei(h,t),m(u)}return void 0===s&&(s=Ei(h,t)),l}return t=al(t)||0,Wa(r)&&(d=!!r.leading,a=(p="maxWait"in r)?an(al(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),E.cancel=function(){void 0!==s&&uo(s),c=0,o=u=i=s=void 0},E.flush=function(){return void 0===s?l:y(ga())},E}var Da=Br(function(e,t){return Jn(e,1,t)}),_a=Br(function(e,t,n){return Jn(e,al(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Aa.Cache||Pn),r}function Ta(e){if("function"!=typeof e)throw new he(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Pn;var Ca=lo(function(e,t){var n=(t=1==t.length&&Ra(t[0])?ut(t[0],Nt(Xo())):ut(ir(t,1),Nt(Xo()))).length;return Br(function(r){for(var o=-1,i=ln(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return tt(e,this,r)})}),Na=Br(function(e,t){return jo(e,32,void 0,t,jt(t,Yo(Na)))}),xa=Br(function(e,t){return jo(e,64,void 0,t,jt(t,Yo(xa)))}),wa=Wo(function(e,t){return jo(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var ka=Ro(mr),La=Ro(function(e,t){return e>=t}),Oa=Er(function(){return arguments}())?Er:function(e){return Va(e)&&De.call(e,"callee")&&!Ke.call(e,"callee")},Ra=K.isArray,Pa=Ye?Nt(Ye):function(e){return Va(e)&&fr(e)==S};function Ma(e){return null!=e&&qa(e.length)&&!Ua(e)}function Ba(e){return Va(e)&&Ma(e)}var Fa=tn||as,ja=Xe?Nt(Xe):function(e){return Va(e)&&fr(e)==s};function Ha(e){if(!Va(e))return!1;var t=fr(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!$a(e)}function Ua(e){if(!Wa(e))return!1;var t=fr(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function za(e){return"number"==typeof e&&e==ol(e)}function qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Wa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Ze?Nt(Ze):function(e){return Va(e)&&ni(e)==p};function Ka(e){return"number"==typeof e||Va(e)&&fr(e)==f}function $a(e){if(!Va(e)||fr(e)!=m)return!1;var t=We(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Ce}var Ya=Je?Nt(Je):function(e){return Va(e)&&fr(e)==v},Xa=Qe?Nt(Qe):function(e){return Va(e)&&ni(e)==g};function Za(e){return"string"==typeof e||!Ra(e)&&Va(e)&&fr(e)==h}function Ja(e){return"symbol"==typeof e||Va(e)&&fr(e)==y}var Qa=et?Nt(et):function(e){return Va(e)&&qa(e.length)&&!!Me[fr(e)]},el=Ro(Tr),tl=Ro(function(e,t){return e<=t});function nl(e){if(!e)return[];if(Ma(e))return Za(e)?qt(e):ho(e);if(Dt&&e[Dt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Dt]());var t=ni(e);return(t==p?Bt:t==g?Ht:Il)(e)}function rl(e){return e?(e=al(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ol(e){var t=rl(e),n=t%1;return t==t?n?t-n:t:0}function il(e){return e?Yn(ol(e),0,4294967295):0}function al(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(Wa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Wa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ct(e);var n=re.test(e);return n||ie.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ll(e){return yo(e,Dl(e))}function sl(e){return null==e?"":Xr(e)}var ul=So(function(e,t){if(di(t)||Ma(t))yo(t,bl(t),e);else for(var n in t)De.call(t,n)&&qn(e,n,t[n])}),cl=So(function(e,t){yo(t,Dl(t),e)}),dl=So(function(e,t,n,r){yo(t,Dl(t),e,r)}),pl=So(function(e,t,n,r){yo(t,bl(t),e,r)}),fl=Wo($n),ml=Br(function(e,t){e=me(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&li(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=Dl(i),l=-1,s=a.length;++l<s;){var u=a[l],c=e[u];(void 0===c||Ia(c,Ee[u])&&!De.call(e,u))&&(e[u]=i[u])}return e}),vl=Br(function(e){return e.push(void 0,Uo),tt(Al,void 0,e)});function gl(e,t,n){var r=null==e?void 0:dr(e,t);return void 0===r?n:r}function hl(e,t){return null!=e&&ri(e,t,gr)}var yl=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Te.call(t)),e[t]=n},Wl(Kl)),El=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Te.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]},Xo),Sl=Br(yr);function bl(e){return Ma(e)?Fn(e):Ar(e)}function Dl(e){return Ma(e)?Fn(e,!0):function(e){if(!Wa(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=di(e),n=[];for(var r in e)("constructor"!=r||!t&&De.call(e,r))&&n.push(r);return n}(e)}var _l=So(function(e,t,n){wr(e,t,n)}),Al=So(function(e,t,n,r){wr(e,t,n,r)}),Tl=Wo(function(e,t){var n={};if(null==e)return n;var r=!1;t=ut(t,function(t){return t=ao(t,e),r||(r=t.length>1),t}),yo(e,Go(e),n),r&&(n=Xn(n,7,zo));for(var o=t.length;o--;)Jr(n,t[o]);return n}),Cl=Wo(function(e,t){return null==e?{}:function(e,t){return Lr(e,t,function(t,n){return hl(e,n)})}(e,t)});function Nl(e,t){if(null==e)return{};var n=ut(Go(e),function(e){return[e]});return t=Xo(t),Lr(e,n,function(e,n){return t(e,n[0])})}var xl=Fo(bl),wl=Fo(Dl);function Il(e){return null==e?[]:xt(e,bl(e))}var kl=Ao(function(e,t,n){return t=t.toLowerCase(),e+(n?Ll(t):t)});function Ll(e){return Hl(sl(e).toLowerCase())}function Ol(e){return(e=sl(e))&&e.replace(le,Ot).replace(we,"")}var Rl=Ao(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Pl=Ao(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ml=_o("toLowerCase"),Bl=Ao(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fl=Ao(function(e,t,n){return e+(n?" ":"")+Hl(t)}),jl=Ao(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hl=_o("toUpperCase");function Ul(e,t,n){return e=sl(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(ke)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var zl=Br(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ha(e)?e:new de(e)}}),ql=Wo(function(e,t){return rt(t,function(t){t=Ni(t),Kn(e,t,Ea(e[t],e))}),e});function Wl(e){return function(){return e}}var Vl=No(),Gl=No(!0);function Kl(e){return e}function $l(e){return _r("function"==typeof e?e:Xn(e,1))}var Yl=Br(function(e,t){return function(n){return yr(n,e,t)}}),Xl=Br(function(e,t){return function(n){return yr(e,n,t)}});function Zl(e,t,n){var r=bl(t),o=cr(t,r);null!=n||Wa(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=cr(t,bl(t)));var i=!(Wa(n)&&"chain"in n&&!n.chain),a=Ua(e);return rt(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=ho(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ct([this.value()],arguments))})}),e}function Jl(){}var Ql=ko(ut),es=ko(it),ts=ko(ft);function ns(e){return si(e)?bt(Ni(e)):function(e){return function(t){return dr(t,e)}}(e)}var rs=Oo(),os=Oo(!0);function is(){return[]}function as(){return!1}var ls,ss=Io(function(e,t){return e+t},0),us=Mo("ceil"),cs=Io(function(e,t){return e/t},1),ds=Mo("floor"),ps=Io(function(e,t){return e*t},1),fs=Mo("round"),ms=Io(function(e,t){return e-t},0);return xn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=ol(e),function(){if(--e<1)return t.apply(this,arguments)}},xn.ary=ha,xn.assign=ul,xn.assignIn=cl,xn.assignInWith=dl,xn.assignWith=pl,xn.at=fl,xn.before=ya,xn.bind=Ea,xn.bindAll=ql,xn.bindKey=Sa,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},xn.chain=na,xn.chunk=function(e,t,n){t=(n?li(e,t,n):void 0===t)?1:an(ol(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,i=0,a=K(Jt(r/t));o<r;)a[i++]=Wr(e,o,o+=t);return a},xn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},xn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return ct(Ra(n)?ho(n):[n],ir(t,1))},xn.cond=function(e){var t=null==e?0:e.length,r=Xo();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new he(n);return[r(e[0]),e[1]]}):[],Br(function(n){for(var r=-1;++r<t;){var o=e[r];if(tt(o[0],this,n))return tt(o[1],this,n)}})},xn.conforms=function(e){return function(e){var t=bl(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},xn.constant=Wl,xn.countBy=ia,xn.create=function(e,t){var n=wn(e);return null==t?n:Gn(n,t)},xn.curry=function e(t,n,r){var o=jo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},xn.curryRight=function e(t,n,r){var o=jo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},xn.debounce=ba,xn.defaults=ml,xn.defaultsDeep=vl,xn.defer=Da,xn.delay=_a,xn.difference=Ii,xn.differenceBy=ki,xn.differenceWith=Li,xn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=n||void 0===t?1:ol(t))<0?0:t,r):[]},xn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,0,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t):[]},xn.dropRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0,!0):[]},xn.dropWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0):[]},xn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&li(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ol(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ol(r))<0&&(r+=o),r=n>r?0:il(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},xn.filter=function(e,t){return(Ra(e)?at:or)(e,Xo(t,3))},xn.flatMap=function(e,t){return ir(fa(e,t),1)},xn.flatMapDeep=function(e,t){return ir(fa(e,t),1/0)},xn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ol(n),ir(fa(e,t),n)},xn.flatten=Pi,xn.flattenDeep=function(e){return null!=e&&e.length?ir(e,1/0):[]},xn.flattenDepth=function(e,t){return null!=e&&e.length?ir(e,t=void 0===t?1:ol(t)):[]},xn.flip=function(e){return jo(e,512)},xn.flow=Vl,xn.flowRight=Gl,xn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},xn.functions=function(e){return null==e?[]:cr(e,bl(e))},xn.functionsIn=function(e){return null==e?[]:cr(e,Dl(e))},xn.groupBy=ca,xn.initial=function(e){return null!=e&&e.length?Wr(e,0,-1):[]},xn.intersection=Bi,xn.intersectionBy=Fi,xn.intersectionWith=ji,xn.invert=yl,xn.invertBy=El,xn.invokeMap=da,xn.iteratee=$l,xn.keyBy=pa,xn.keys=bl,xn.keysIn=Dl,xn.map=fa,xn.mapKeys=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,t(e,r,o),e)}),n},xn.mapValues=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,r,t(e,r,o))}),n},xn.matches=function(e){return Nr(Xn(e,1))},xn.matchesProperty=function(e,t){return xr(e,Xn(t,1))},xn.memoize=Aa,xn.merge=_l,xn.mergeWith=Al,xn.method=Yl,xn.methodOf=Xl,xn.mixin=Zl,xn.negate=Ta,xn.nthArg=function(e){return e=ol(e),Br(function(t){return Ir(t,e)})},xn.omit=Tl,xn.omitBy=function(e,t){return Nl(e,Ta(Xo(t)))},xn.once=function(e){return ya(2,e)},xn.orderBy=function(e,t,n,r){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=r?void 0:n)||(n=null==n?[]:[n]),kr(e,t,n))},xn.over=Ql,xn.overArgs=Ca,xn.overEvery=es,xn.overSome=ts,xn.partial=Na,xn.partialRight=xa,xn.partition=ma,xn.pick=Cl,xn.pickBy=Nl,xn.property=ns,xn.propertyOf=function(e){return function(t){return null==e?void 0:dr(e,t)}},xn.pull=Ui,xn.pullAll=zi,xn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,Xo(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,void 0,n):e},xn.pullAt=qi,xn.range=rs,xn.rangeRight=os,xn.rearg=wa,xn.reject=function(e,t){return(Ra(e)?at:or)(e,Ta(Xo(t,3)))},xn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Xo(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Rr(e,o),n},xn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Br(e,t=void 0===t?t:ol(t))},xn.reverse=Wi,xn.sampleSize=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:ol(t),(Ra(e)?Hn:jr)(e,t)},xn.set=function(e,t,n){return null==e?e:Hr(e,t,n)},xn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Hr(e,t,n,r)},xn.shuffle=function(e){return(Ra(e)?Un:qr)(e)},xn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&li(e,t,n)?(t=0,n=r):(t=null==t?0:ol(t),n=void 0===n?r:ol(n)),Wr(e,t,n)):[]},xn.sortBy=va,xn.sortedUniq=function(e){return e&&e.length?$r(e):[]},xn.sortedUniqBy=function(e,t){return e&&e.length?$r(e,Xo(t,2)):[]},xn.split=function(e,t,n){return n&&"number"!=typeof n&&li(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=sl(e))&&("string"==typeof t||null!=t&&!Ya(t))&&!(t=Xr(t))&&Mt(e)?so(qt(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:an(ol(t),0),Br(function(n){var r=n[t],o=so(n,0,t);return r&&ct(o,r),tt(e,this,o)})},xn.tail=function(e){var t=null==e?0:e.length;return t?Wr(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?Wr(e,0,(t=n||void 0===t?1:ol(t))<0?0:t):[]},xn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t,r):[]},xn.takeRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.throttle=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw new he(n);return Wa(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),ba(e,t,{leading:o,maxWait:t,trailing:i})},xn.thru=ra,xn.toArray=nl,xn.toPairs=xl,xn.toPairsIn=wl,xn.toPath=function(e){return Ra(e)?ut(e,Ni):Ja(e)?[e]:ho(Ci(sl(e)))},xn.toPlainObject=ll,xn.transform=function(e,t,n){var r=Ra(e),o=r||Fa(e)||Qa(e);if(t=Xo(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Wa(e)&&Ua(i)?wn(We(e)):{}}return(o?rt:sr)(e,function(e,r,o){return t(n,e,r,o)}),n},xn.unary=function(e){return ha(e,1)},xn.union=Vi,xn.unionBy=Gi,xn.unionWith=Ki,xn.uniq=function(e){return e&&e.length?Zr(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Zr(e,Xo(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Jr(e,t)},xn.unzip=$i,xn.unzipWith=Yi,xn.update=function(e,t,n){return null==e?e:Qr(e,t,io(n))},xn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Qr(e,t,io(n),r)},xn.values=Il,xn.valuesIn=function(e){return null==e?[]:xt(e,Dl(e))},xn.without=Xi,xn.words=Ul,xn.wrap=function(e,t){return Na(io(t),e)},xn.xor=Zi,xn.xorBy=Ji,xn.xorWith=Qi,xn.zip=ea,xn.zipObject=function(e,t){return ro(e||[],t||[],qn)},xn.zipObjectDeep=function(e,t){return ro(e||[],t||[],Hr)},xn.zipWith=ta,xn.entries=xl,xn.entriesIn=wl,xn.extend=cl,xn.extendWith=dl,Zl(xn,xn),xn.add=ss,xn.attempt=zl,xn.camelCase=kl,xn.capitalize=Ll,xn.ceil=us,xn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=al(n))==n?n:0),void 0!==t&&(t=(t=al(t))==t?t:0),Yn(al(e),t,n)},xn.clone=function(e){return Xn(e,4)},xn.cloneDeep=function(e){return Xn(e,5)},xn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Zn(e,t,bl(t))},xn.deburr=Ol,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=cs,xn.endsWith=function(e,t,n){e=sl(e),t=Xr(t);var r=e.length,o=n=void 0===n?r:Yn(ol(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},xn.eq=Ia,xn.escape=function(e){return(e=sl(e))&&B.test(e)?e.replace(P,Rt):e},xn.escapeRegExp=function(e){return(e=sl(e))&&V.test(e)?e.replace(W,"\\$&"):e},xn.every=function(e,t,n){var r=Ra(e)?it:nr;return n&&li(e,t,n)&&(t=void 0),r(e,Xo(t,3))},xn.find=aa,xn.findIndex=Oi,xn.findKey=function(e,t){return vt(e,Xo(t,3),sr)},xn.findLast=la,xn.findLastIndex=Ri,xn.findLastKey=function(e,t){return vt(e,Xo(t,3),ur)},xn.floor=ds,xn.forEach=sa,xn.forEachRight=ua,xn.forIn=function(e,t){return null==e?e:ar(e,Xo(t,3),Dl)},xn.forInRight=function(e,t){return null==e?e:lr(e,Xo(t,3),Dl)},xn.forOwn=function(e,t){return e&&sr(e,Xo(t,3))},xn.forOwnRight=function(e,t){return e&&ur(e,Xo(t,3))},xn.get=gl,xn.gt=ka,xn.gte=La,xn.has=function(e,t){return null!=e&&ri(e,t,vr)},xn.hasIn=hl,xn.head=Mi,xn.identity=Kl,xn.includes=function(e,t,n,r){e=Ma(e)?e:Il(e),n=n&&!r?ol(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Za(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&ht(e,t,n)>-1},xn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),ht(e,t,o)},xn.inRange=function(e,t,n){return t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n){return e>=ln(t,n)&&e<an(t,n)}(e=al(e),t,n)},xn.invoke=Sl,xn.isArguments=Oa,xn.isArray=Ra,xn.isArrayBuffer=Pa,xn.isArrayLike=Ma,xn.isArrayLikeObject=Ba,xn.isBoolean=function(e){return!0===e||!1===e||Va(e)&&fr(e)==l},xn.isBuffer=Fa,xn.isDate=ja,xn.isElement=function(e){return Va(e)&&1===e.nodeType&&!$a(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Ma(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Qa(e)||Oa(e)))return!e.length;var t=ni(e);if(t==p||t==g)return!e.size;if(di(e))return!Ar(e).length;for(var n in e)if(De.call(e,n))return!1;return!0},xn.isEqual=function(e,t){return Sr(e,t)},xn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Sr(e,t,void 0,n):!!r},xn.isError=Ha,xn.isFinite=function(e){return"number"==typeof e&&nn(e)},xn.isFunction=Ua,xn.isInteger=za,xn.isLength=qa,xn.isMap=Ga,xn.isMatch=function(e,t){return e===t||br(e,t,Jo(t))},xn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,br(e,t,Jo(t),n)},xn.isNaN=function(e){return Ka(e)&&e!=+e},xn.isNative=function(e){if(ci(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=Ka,xn.isObject=Wa,xn.isObjectLike=Va,xn.isPlainObject=$a,xn.isRegExp=Ya,xn.isSafeInteger=function(e){return za(e)&&e>=-9007199254740991&&e<=9007199254740991},xn.isSet=Xa,xn.isString=Za,xn.isSymbol=Ja,xn.isTypedArray=Qa,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Va(e)&&ni(e)==E},xn.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==fr(e)},xn.join=function(e,t){return null==e?"":rn.call(e,t)},xn.kebabCase=Rl,xn.last=Hi,xn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ol(n))<0?an(r+o,0):ln(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):gt(e,Et,o,!0)},xn.lowerCase=Pl,xn.lowerFirst=Ml,xn.lt=el,xn.lte=tl,xn.max=function(e){return e&&e.length?rr(e,Kl,mr):void 0},xn.maxBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),mr):void 0},xn.mean=function(e){return St(e,Kl)},xn.meanBy=function(e,t){return St(e,Xo(t,2))},xn.min=function(e){return e&&e.length?rr(e,Kl,Tr):void 0},xn.minBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),Tr):void 0},xn.stubArray=is,xn.stubFalse=as,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=ps,xn.nth=function(e,t){return e&&e.length?Ir(e,ol(t)):void 0},xn.noConflict=function(){return qe._===this&&(qe._=Ne),this},xn.noop=Jl,xn.now=ga,xn.pad=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Lo(Qt(o),n)+e+Lo(Jt(o),n)},xn.padEnd=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?e+Lo(t-r,n):e},xn.padStart=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?Lo(t-r,n)+e:e},xn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(sl(e).replace(G,""),t||0)},xn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&li(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rl(e),void 0===t?(t=e,e=0):t=rl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=cn();return ln(e+o*(t-e+je("1e-"+((o+"").length-1))),t)}return Pr(e,t)},xn.reduce=function(e,t,n){var r=Ra(e)?dt:_t,o=arguments.length<3;return r(e,Xo(t,4),n,o,er)},xn.reduceRight=function(e,t,n){var r=Ra(e)?pt:_t,o=arguments.length<3;return r(e,Xo(t,4),n,o,tr)},xn.repeat=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:ol(t),Mr(sl(e),t)},xn.replace=function(){var e=arguments,t=sl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.result=function(e,t,n){var r=-1,o=(t=ao(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[Ni(t[r])];void 0===i&&(r=o,i=n),e=Ua(i)?i.call(e):i}return e},xn.round=fs,xn.runInContext=e,xn.sample=function(e){return(Ra(e)?jn:Fr)(e)},xn.size=function(e){if(null==e)return 0;if(Ma(e))return Za(e)?zt(e):e.length;var t=ni(e);return t==p||t==g?e.size:Ar(e).length},xn.snakeCase=Bl,xn.some=function(e,t,n){var r=Ra(e)?ft:Vr;return n&&li(e,t,n)&&(t=void 0),r(e,Xo(t,3))},xn.sortedIndex=function(e,t){return Gr(e,t)},xn.sortedIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2))},xn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ia(e[r],t))return r}return-1},xn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},xn.sortedLastIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2),!0)},xn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gr(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},xn.startCase=Fl,xn.startsWith=function(e,t,n){return e=sl(e),n=null==n?0:Yn(ol(n),0,e.length),t=Xr(t),e.slice(n,n+t.length)==t},xn.subtract=ms,xn.sum=function(e){return e&&e.length?At(e,Kl):0},xn.sumBy=function(e,t){return e&&e.length?At(e,Xo(t,2)):0},xn.template=function(e,t,n){var r=xn.templateSettings;n&&li(e,t,n)&&(t=void 0),e=sl(e),t=dl({},t,r,Ho);var o,i,a=dl({},t.imports,r.imports,Ho),l=bl(a),s=xt(a,l),u=0,c=t.interpolate||se,d="__p += '",p=ve((t.escape||se).source+"|"+c.source+"|"+(c===H?ee:se).source+"|"+(t.evaluate||se).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pe+"]")+"\n";e.replace(p,function(t,n,r,a,l,s){return r||(r=a),d+=e.slice(u,s).replace(ue,Pt),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),l&&(i=!0,d+="';\n"+l+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t}),d+="';\n";var m=De.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(k,""):d).replace(L,"$1").replace(O,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=zl(function(){return pe(l,f+"return "+d).apply(void 0,s)});if(v.source=d,Ha(v))throw v;return v},xn.times=function(e,t){if((e=ol(e))<1||e>9007199254740991)return[];var n=4294967295,r=ln(e,4294967295);e-=4294967295;for(var o=Tt(r,t=Xo(t));++n<e;)t(n);return o},xn.toFinite=rl,xn.toInteger=ol,xn.toLength=il,xn.toLower=function(e){return sl(e).toLowerCase()},xn.toNumber=al,xn.toSafeInteger=function(e){return e?Yn(ol(e),-9007199254740991,9007199254740991):0===e?e:0},xn.toString=sl,xn.toUpper=function(e){return sl(e).toUpperCase()},xn.trim=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return Ct(e);if(!e||!(t=Xr(t)))return e;var r=qt(e),o=qt(t);return so(r,It(r,o),kt(r,o)+1).join("")},xn.trimEnd=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.slice(0,Wt(e)+1);if(!e||!(t=Xr(t)))return e;var r=qt(e);return so(r,0,kt(r,qt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xr(t)))return e;var r=qt(e);return so(r,It(r,qt(t))).join("")},xn.truncate=function(e,t){var n=30,r="...";if(Wa(t)){var o="separator"in t?t.separator:o;n="length"in t?ol(t.length):n,r="omission"in t?Xr(t.omission):r}var i=(e=sl(e)).length;if(Mt(e)){var a=qt(e);i=a.length}if(n>=i)return e;var l=n-zt(r);if(l<1)return r;var s=a?so(a,0,l).join(""):e.slice(0,l);if(void 0===o)return s+r;if(a&&(l+=s.length-l),Ya(o)){if(e.slice(l).search(o)){var u,c=s;for(o.global||(o=ve(o.source,sl(te.exec(o))+"g")),o.lastIndex=0;u=o.exec(c);)var d=u.index;s=s.slice(0,void 0===d?l:d)}}else if(e.indexOf(Xr(o),l)!=l){var p=s.lastIndexOf(o);p>-1&&(s=s.slice(0,p))}return s+r},xn.unescape=function(e){return(e=sl(e))&&M.test(e)?e.replace(R,Vt):e},xn.uniqueId=function(e){var t=++_e;return sl(e)+t},xn.upperCase=jl,xn.upperFirst=Hl,xn.each=sa,xn.eachRight=ua,xn.first=Mi,Zl(xn,(ls={},sr(xn,function(e,t){De.call(xn.prototype,t)||(ls[t]=e)}),ls),{chain:!1}),xn.VERSION="4.17.21",rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){xn[e].placeholder=xn}),rt(["drop","take"],function(e,t){Ln.prototype[e]=function(n){n=void 0===n?1:an(ol(n),0);var r=this.__filtered__&&!t?new Ln(this):this.clone();return r.__filtered__?r.__takeCount__=ln(n,r.__takeCount__):r.__views__.push({size:ln(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Ln.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Ln.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Ln.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Ln.prototype[e]=function(){return this.__filtered__?new Ln(this):this[n](1)}}),Ln.prototype.compact=function(){return this.filter(Kl)},Ln.prototype.find=function(e){return this.filter(e).head()},Ln.prototype.findLast=function(e){return this.reverse().find(e)},Ln.prototype.invokeMap=Br(function(e,t){return"function"==typeof e?new Ln(this):this.map(function(n){return yr(n,e,t)})}),Ln.prototype.reject=function(e){return this.filter(Ta(Xo(e)))},Ln.prototype.slice=function(e,t){e=ol(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ln(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ol(t))<0?n.dropRight(-t):n.take(t-e)),n)},Ln.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295)},sr(Ln.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=xn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(xn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Ln,s=a[0],u=l||Ra(t),c=function(e){var t=o.apply(xn,ct([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof s&&1!=s.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=i&&!d,m=l&&!p;if(!i&&u){t=m?t:new Ln(this);var v=e.apply(t,a);return v.__actions__.push({func:ra,args:[c],thisArg:void 0}),new kn(v,d)}return f&&m?e.apply(this,a):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[n](function(n){return t.apply(Ra(n)?n:[],e)})}}),sr(Ln.prototype,function(e,t){var n=xn[t];if(n){var r=n.name+"";De.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[xo(void 0,2).name]=[{name:"wrapper",func:void 0}],Ln.prototype.clone=function(){var e=new Ln(this.__wrapped__);return e.__actions__=ho(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ho(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ho(this.__views__),e},Ln.prototype.reverse=function(){if(this.__filtered__){var e=new Ln(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ln.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ln(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,l=i.end,s=l-a,u=r?l:a-1,c=this.__iteratees__,d=c.length,p=0,f=ln(s,this.__takeCount__);if(!n||!r&&o==s&&f==s)return to(e,this.__actions__);var m=[];e:for(;s--&&p<f;){for(var v=-1,g=e[u+=t];++v<d;){var h=c[v],y=h.type,E=(0,h.iteratee)(g);if(2==y)g=E;else if(!E){if(1==y)continue e;break e}}m[p++]=g}return m},xn.prototype.at=oa,xn.prototype.chain=function(){return na(this)},xn.prototype.commit=function(){return new kn(this.value(),this.__chain__)},xn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof In;){var r=wi(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ln){var t=e;return this.__actions__.length&&(t=new Ln(this)),(t=t.reverse()).__actions__.push({func:ra,args:[Wi],thisArg:void 0}),new kn(t,this.__chain__)}return this.thru(Wi)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,Dt&&(xn.prototype[Dt]=function(){return this}),xn}();Ve?((Ve.exports=Gt)._=Gt,We._=Gt):qe._=Gt}).call(T)});const x=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],w=e=>{var i;let{searchParams:a,onFilterChange:s,defaultSearchParams:u,statusMap:p,moduleCode:f}=e,m=d(e,x);const{t:v}=o.useTranslation(),g=l.useQueryClient(),[h,y]=(Digit.ULBService.getCurrentTenantId(),Digit.UserService.getUser(),n.useState(()=>({services:(null==a?void 0:a.services)||["ADV"]})));console.log("_searchParams",h);const E=n.useMemo(()=>[{code:"ASSIGNED_TO_ME",name:v("ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:v("ASSIGNED_TO_ALL")}],[v]),S=E[1],[b,D]=n.useState(S),[_,T]=n.useState((null==a||null===(i=a.filters)||void 0===i?void 0:i.wfFilters)||{assignee:[{code:""}]});v("ADS_NEW_BOOKING_APPLICATION"),console.log("statusMap",p);const C=()=>{y(c({},u,{services:[]})),s(c({},u))};return console.log("hhh"),r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading",style:{alignItems:"center"}},r.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},r.createElement("span",null,r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.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"}))),r.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},v("ES_COMMON_FILTER_BY"),":")),r.createElement("div",{className:"clearAll",onClick:C},v("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&r.createElement("span",{className:"clear-search",onClick:C,style:{border:"1px solid #e0e0e0",padding:"6px"}},r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&r.createElement("span",{onClick:m.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:e=>{D(e),T({uuid:e}),s(c({},h,{uuid:e}))},selectedOption:b,t:v,optionsKey:"name",options:E}),r.createElement("div",null,r.createElement(A,{searchParams:h,businessServices:["ADV"],statusMap:p||g.getQueryData("INBOX_STATUS_MAP_"+f),moduleCode:f,onAssignmentChange:(e,t)=>{console.log("status is 222",t),console.log("e",e),(e=>{let t=e.delete,n=c({},h,e);t&&t.forEach(e=>delete n[e]),delete e.delete,y(c({},n))})(e.target.checked?{applicationStatus:[...h.applicationStatus||[],t]}:{applicationStatus:null==h?void 0:h.applicationStatus.filter(e=>e.state!==t.state)})}})),r.createElement("div",null,r.createElement(t.SubmitBar,{onSubmit:()=>{s(c({},h,{wfFilters:_}))},label:v("ES_COMMON_APPLY")}))))))},I=e=>r.createElement("span",{className:"cell-text"},e),k=e=>r.createElement("span",{className:"sla-cell"},e),L=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];C(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:T,function(e,t){var n=[],r=Object.getPrototypeOf,o=n.slice,i=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,l=n.indexOf,s={},u=s.toString,c=s.hasOwnProperty,d=c.toString,p=d.call(Object),f={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},g=e.document,h={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var r,o,i=(n=n||g).createElement("script");if(i.text=e,t)for(r in h)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function E(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[u.call(e)]||"object":typeof e}var S=function(e,t){return new S.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=E(e);return!m(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},l=1,s=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[l]||{},l++),"object"==typeof a||m(a)||(a={}),l===s&&(a=this,l--);l<s;l++)if(null!=(e=arguments[l]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(S.isPlainObject(r)||(o=Array.isArray(r)))?(n=a[t],i=o&&!Array.isArray(n)?[]:o||S.isPlainObject(n)?n:{},o=!1,a[t]=S.extend(u,i,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=r(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){y(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?S.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:l.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;r<n;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r=[],o=0,i=e.length,a=!n;o<i;o++)!t(e[o],o)!==a&&r.push(e[o]);return r},map:function(e,t,n){var r,o,a=0,l=[];if(b(e))for(r=e.length;a<r;a++)null!=(o=t(e[a],a,n))&&l.push(o);else for(a in e)null!=(o=t(e[a],a,n))&&l.push(o);return i(l)},guid:1,support:f}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var D=function(e){var t,n,r,o,i,a,l,s,u,c,d,p,f,m,v,g,h,y,E,S="sizzle"+1*new Date,b=e.document,D=0,_=0,A=se(),T=se(),C=se(),N=se(),x=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],k=I.pop,L=I.push,O=I.push,R=I.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\["+B+"*("+F+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+B+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",U=new RegExp(B+"+","g"),z=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),q=new RegExp("^"+B+"*,"+B+"*"),W=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),V=new RegExp(B+"|>"),G=new RegExp(H),K=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){p()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(I=R.call(b.childNodes),b.childNodes)}catch(e){O={apply:I.length?function(e,t){L.apply(e,R.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,o){var i,l,u,c,d,m,h,y=t&&t.ownerDocument,b=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return r;if(!o&&(p(t),t=t||f,v)){if(11!==b&&(d=Q.exec(e)))if(i=d[1]){if(9===b){if(!(u=t.getElementById(i)))return r;if(u.id===i)return r.push(u),r}else if(y&&(u=y.getElementById(i))&&E(t,u)&&u.id===i)return r.push(u),r}else{if(d[2])return O.apply(r,t.getElementsByTagName(e)),r;if((i=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(i)),r}if(n.qsa&&!N[e+" "]&&(!g||!g.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(h=e,y=t,1===b&&(V.test(e)||W.test(e))){for((y=ee.test(e)&&he(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,oe):t.setAttribute("id",c=S)),l=(m=a(e)).length;l--;)m[l]=(c?"#"+c:":scope")+" "+Ee(m[l]);h=m.join(",")}try{return O.apply(r,y.querySelectorAll(h)),r}catch(t){N(e,!0)}finally{c===S&&t.removeAttribute("id")}}}return s(e.replace(z,"$1"),t,r,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function ue(e){return e[S]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ve(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue(function(t){return t=+t,ue(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},i=le.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!Y.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=le.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:b;return a!=f&&9===a.nodeType&&a.documentElement?(m=(f=a).documentElement,v=!i(f),b!=f&&(o=f.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.scope=ce(function(e){return m.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ce(function(e){return m.appendChild(e).id=S,!f.getElementsByName||!f.getElementsByName(S).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&v)return t.getElementsByClassName(e)},h=[],g=[],(n.qsa=J.test(f.querySelectorAll))&&(ce(function(e){var t;m.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+B+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+S+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=J.test(y=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),h.push("!=",H)}),g=g.length&&new RegExp(g.join("|")),h=h.length&&new RegExp(h.join("|")),t=J.test(m.compareDocumentPosition),E=t||J.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},x=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==b&&E(b,e)?-1:t==f||t.ownerDocument==b&&E(b,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],l=[t];if(!o||!i)return e==f?-1:t==f?1:o?-1:i?1:c?P(c,e)-P(c,t):0;if(o===i)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[r]===l[r];)r++;return r?pe(a[r],l[r]):a[r]==b?-1:l[r]==b?1:0},f):f},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&v&&!N[t+" "]&&(!h||!h.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){N(t,!0)}return le(t,f,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=f&&p(e),E(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=f&&p(e);var o=r.attrHandle[t.toLowerCase()],i=o&&w.call(r.attrHandle,t.toLowerCase())?o(e,t,!v):void 0;return void 0!==i?i:n.attributes||!v?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},le.escape=function(e){return(e+"").replace(re,oe)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],o=0,i=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(x),d){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return c=null,e},o=le.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ue,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=A[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&A(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=le.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var u,c,d,p,f,m,v=i!==a?"nextSibling":"previousSibling",g=t.parentNode,h=l&&t.nodeName.toLowerCase(),y=!s&&!l,E=!1;if(g){if(i){for(;v;){for(p=t;p=p[v];)if(l?p.nodeName.toLowerCase()===h:1===p.nodeType)return!1;m=v="only"===e&&!m&&"nextSibling"}return!0}if(m=[a?g.firstChild:g.lastChild],a&&y){for(E=(f=(u=(c=(d=(p=g)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===D&&u[1])&&u[2],p=f&&g.childNodes[f];p=++f&&p&&p[v]||(E=f=0)||m.pop();)if(1===p.nodeType&&++E&&p===t){c[e]=[D,f,E];break}}else if(y&&(E=f=(u=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===D&&u[1]),!1===E)for(;(p=++f&&p&&p[v]||(E=f=0)||m.pop())&&((l?p.nodeName.toLowerCase()!==h:1!==p.nodeType)||!++E||(y&&((c=(d=p[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[D,E]),p!==t)););return(E-=o)===r||E%r==0&&E/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return o[S]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)e[r=P(e,i[a])]=!(n[r]=i[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:ue(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[S]?ue(function(e,t,n,o){for(var i,a=r(e,null,o,[]),l=e.length;l--;)(i=a[l])&&(e[l]=!(t[l]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:ue(function(e){return function(t){return le(e,t).length>0}}),contains:ue(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}}),lang:ue(function(e){return K.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ve(!1),disabled:ve(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge(function(){return[0]}),last:ge(function(e,t){return[t-1]}),eq:ge(function(e,t,n){return[n<0?n+t:n]}),even:ge(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ge(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ge(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ge(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=me(t);function ye(){}function Ee(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Se(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,l=_++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,s){var u,c,d,p=[D,l];if(s){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(d=t[S]||(t[S]={}))[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[i])&&u[0]===D&&u[1]===l)return p[2]=u[2];if(c[i]=p,p[2]=e(t,n,s))return!0}return!1}}function be(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function De(e,t,n,r,o){for(var i,a=[],l=0,s=e.length,u=null!=t;l<s;l++)(i=e[l])&&(n&&!n(i,r,o)||(a.push(i),u&&t.push(l)));return a}function _e(e,t,n,r,o,i){return r&&!r[S]&&(r=_e(r)),o&&!o[S]&&(o=_e(o,i)),ue(function(i,a,l,s){var u,c,d,p=[],f=[],m=a.length,v=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)le(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),g=!e||!i&&t?v:De(v,p,e,l,s),h=n?o||(i?e:m||r)?[]:a:g;if(n&&n(g,h,l,s),r)for(u=De(h,f),r(u,[],l,s),c=u.length;c--;)(d=u[c])&&(h[f[c]]=!(g[f[c]]=d));if(i){if(o||e){if(o){for(u=[],c=h.length;c--;)(d=h[c])&&u.push(g[c]=d);o(null,h=[],u,s)}for(c=h.length;c--;)(d=h[c])&&(u=o?P(i,d):p[c])>-1&&(i[u]=!(a[u]=d))}}else h=De(h===a?h.splice(m,h.length):h),o?o(null,a,h,s):O.apply(a,h)})}function Ae(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],l=a||r.relative[" "],s=a?1:0,c=Se(function(e){return e===t},l,!0),d=Se(function(e){return P(t,e)>-1},l,!0),p=[function(e,n,r){var o=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,o}];s<i;s++)if(n=r.relative[e[s].type])p=[Se(be(p),n)];else{if((n=r.filter[e[s].type].apply(null,e[s].matches))[S]){for(o=++s;o<i&&!r.relative[e[o].type];o++);return _e(s>1&&be(p),s>1&&Ee(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(z,"$1"),n,s<o&&Ae(e.slice(s,o)),o<i&&Ae(e=e.slice(o)),o<i&&Ee(e))}p.push(n)}return be(p)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=le.tokenize=function(e,t){var n,o,i,a,l,s,u,c=T[e+" "];if(c)return t?0:c.slice(0);for(l=e,s=[],u=r.preFilter;l;){for(a in n&&!(o=q.exec(l))||(o&&(l=l.slice(o[0].length)||l),s.push(i=[])),n=!1,(o=W.exec(l))&&(n=o.shift(),i.push({value:n,type:o[0].replace(z," ")}),l=l.slice(n.length)),r.filter)!(o=$[a].exec(l))||u[a]&&!(o=u[a](o))||(n=o.shift(),i.push({value:n,type:a,matches:o}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):T(e,s).slice(0)},l=le.compile=function(e,t){var n,o=[],i=[],l=C[e+" "];if(!l){for(t||(t=a(e)),n=t.length;n--;)(l=Ae(t[n]))[S]?o.push(l):i.push(l);(l=C(e,function(e,t){var n=t.length>0,o=e.length>0,i=function(i,a,l,s,c){var d,m,g,h=0,y="0",E=i&&[],S=[],b=u,_=i||o&&r.find.TAG("*",c),A=D+=null==b?1:Math.random()||.1,T=_.length;for(c&&(u=a==f||a||c);y!==T&&null!=(d=_[y]);y++){if(o&&d){for(m=0,a||d.ownerDocument==f||(p(d),l=!v);g=e[m++];)if(g(d,a||f,l)){s.push(d);break}c&&(D=A)}n&&((d=!g&&d)&&h--,i&&E.push(d))}if(h+=y,n&&y!==h){for(m=0;g=t[m++];)g(E,S,a,l);if(i){if(h>0)for(;y--;)E[y]||S[y]||(S[y]=k.call(s));S=De(S)}O.apply(s,S),c&&!i&&S.length>0&&h+t.length>1&&le.uniqueSort(s)}return c&&(D=A,u=b),E};return n?ue(i):i}(i,o))).selector=e}return l},s=le.select=function(e,t,n,o){var i,s,u,c,d,p="function"==typeof e&&e,f=!o&&a(e=p.selector||e);if(n=n||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(u=s[0]).type&&9===t.nodeType&&v&&r.relative[s[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(i=$.needsContext.test(e)?0:s.length;i--&&!r.relative[c=(u=s[i]).type];)if((d=r.find[c])&&(o=d(u.matches[0].replace(te,ne),ee.test(s[0].type)&&he(t.parentNode)||t))){if(s.splice(i,1),!(e=o.length&&Ee(s)))return O.apply(n,o),n;break}}return(p||l(e,f))(o,t,!v,n,!t||ee.test(e)&&he(t.parentNode)||t),n},n.sortStable=S.split("").sort(x).join("")===S,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),le}(e);S.find=D,S.expr=D.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=D.uniqueSort,S.text=D.getText,S.isXMLDoc=D.isXML,S.contains=D.contains,S.escapeSelector=D.escape;var _=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&S(e).is(n))break;r.push(e)}return r},A=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=S.expr.match.needsContext;function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function x(e,t,n){return m(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return l.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(o[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,o[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(x(this,e||[],!1))},not:function(e){return this.pushStack(x(this,e||[],!0))},is:function(e){return!!x(this,"string"==typeof e&&T.test(e)?S(e):e||[],!1).length}});var w,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||w,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(S.merge(this,S.parseHTML(r[1],(t=t instanceof S?t[0]:t)&&t.nodeType?t.ownerDocument||t:g,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=g.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(g);var k=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,o=this.length,i=[],a="string"!=typeof e&&S(e);if(!T.test(e))for(;r<o;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?S.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?l.call(S(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return _(e,"parentNode")},parentsUntil:function(e,t,n){return _(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return _(e,"nextSibling")},prevAll:function(e){return _(e,"previousSibling")},nextUntil:function(e,t,n){return _(e,"nextSibling",n)},prevUntil:function(e,t,n){return _(e,"previousSibling",n)},siblings:function(e){return A((e.parentNode||{}).firstChild,e)},children:function(e){return A(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var o=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=S.filter(r,o)),this.length>1&&(L[e]||S.uniqueSort(o),k.test(e)&&o.reverse()),this.pushStack(o)}});var R=/[^\x20\t\r\n\f]+/g;function P(e){return e}function M(e){throw e}function B(e,t,n,r){var o;try{e&&m(o=e.promise)?o.call(e).done(t).fail(n):e&&m(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,r,o,i=[],a=[],l=-1,s=function(){for(o=o||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l<i.length;)!1===i[l].apply(n[0],n[1])&&e.stopOnFalse&&(l=i.length,n=!1);e.memory||(n=!1),t=!1,o&&(i=n?[]:"")},u={add:function(){return i&&(n&&!t&&(l=i.length-1,a.push(n)),function t(n){S.each(n,function(n,r){m(r)?e.unique&&u.has(r)||i.push(r):r&&r.length&&"string"!==E(r)&&t(r)})}(arguments),n&&!t&&s()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,i,n))>-1;)i.splice(n,1),n<=l&&l--}),this},has:function(e){return e?S.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||s()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(t){S.each(n,function(n,r){var o=m(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,r,o){var i=0;function a(t,n,r,o){return function(){var l=this,s=arguments,u=function(){var e,u;if(!(t<i)){if((e=r.apply(l,s))===n.promise())throw new TypeError("Thenable self-resolution");m(u=e&&("object"==typeof e||"function"==typeof e)&&e.then)?o?u.call(e,a(i,n,P,o),a(i,n,M,o)):(i++,u.call(e,a(i,n,P,o),a(i,n,M,o),a(i,n,P,n.notifyWith))):(r!==P&&(l=void 0,s=[e]),(o||n.resolveWith)(l,s))}},c=o?u:function(){try{u()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,c.stackTrace),t+1>=i&&(r!==M&&(l=void 0,s=[e]),n.rejectWith(l,s))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),e.setTimeout(c))}}return S.Deferred(function(e){n[0][3].add(a(0,e,m(o)?o:P,e.notifyWith)),n[1][3].add(a(0,e,m(t)?t:P)),n[2][3].add(a(0,e,m(r)?r:M))}).promise()},promise:function(e){return null!=e?S.extend(e,o):o}},i={};return S.each(n,function(e,t){var a=t[2],l=t[5];o[t[1]]=a.add,l&&a.add(function(){r=l},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=a.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=S.Deferred(),l=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(B(e,a.done(l(n)).resolve,a.reject,!t),"pending"===a.state()||m(i[n]&&i[n].then)))return a.then();for(;n--;)B(i[n],l(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var j=S.Deferred();function H(){g.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return j.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||j.resolveWith(g,[S]))}}),S.ready.then=j.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(S.ready):(g.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var U=function(e,t,n,r,o,i,a){var l=0,s=e.length,u=null==n;if("object"===E(n))for(l in o=!0,n)U(e,t,l,n[l],!0,i,a);else if(void 0!==r&&(o=!0,m(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(S(e),n)})),t))for(;l<s;l++)t(e[l],n,a?r:r.call(e[l],l,t(e[l],n)));return o?e:u?t.call(e):s?t(e[0],n):i},z=/^-ms-/,q=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(q,W)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=S.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[V(t)]=n;else for(r in t)o[V(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var $=new K,Y=new K,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}Y.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Y.hasData(e)||$.hasData(e)},data:function(e,t,n){return Y.access(e,t,n)},removeData:function(e,t){Y.remove(e,t)},_data:function(e,t,n){return $.access(e,t,n)},_removeData:function(e,t){$.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===e){if(this.length&&(o=Y.get(i),1===i.nodeType&&!$.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=V(r.slice(5)),J(i,r,o[r]));$.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){Y.set(this,e)}):U(this,function(t){var n;if(i&&void 0===t)return void 0!==(n=Y.get(i,e))||void 0!==(n=J(i,e))?n:void 0;this.each(function(){Y.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return r=$.get(e,t=(t||"fx")+"queue"),n&&(!r||Array.isArray(n)?r=$.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){var n=S.queue(e,t=t||"fx"),r=n.length,o=n.shift(),i=S._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,function(){S.dequeue(e,t)},i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return $.get(e,n)||$.access(e,n,{empty:S.Callbacks("once memory").add(function(){$.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=S.Deferred(),i=this,a=this.length,l=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=$.get(i[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(l));return l(),o.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=g.documentElement,re=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};ne.getRootNode&&(re=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ie=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&re(e)&&"none"===S.css(e,"display")};function ae(e,t,n,r){var o,i,a=20,l=r?function(){return r.cur()}:function(){return S.css(e,t,"")},s=l(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+s)&&ee.exec(S.css(e,t));if(c&&c[3]!==u){for(u=u||c[3],c=+(s/=2)||1;a--;)S.style(e,t,c+u),(1-i)*(1-(i=l()/s||.5))<=0&&(a=0),c/=i;S.style(e,t,(c*=2)+u),n=n||[]}return n&&(c=+c||+s||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=o)),o}var le={};function se(e){var t,n=e.ownerDocument,r=e.nodeName,o=le[r];return o||(t=n.body.appendChild(n.createElement(r)),o=S.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),le[r]=o,o)}function ue(e,t){for(var n,r,o=[],i=0,a=e.length;i<a;i++)(r=e[i]).style&&(n=r.style.display,t?("none"===n&&(o[i]=$.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&ie(r)&&(o[i]=se(r))):"none"!==n&&(o[i]="none",$.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}S.fn.extend({show:function(){return ue(this,!0)},hide:function(){return ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ie(this)?S(this).show():S(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,fe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;ce=g.createDocumentFragment().appendChild(g.createElement("div")),(de=g.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),f.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",f.option=!!ce.lastChild;var ve={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ge(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?S.merge([e],n):n}function he(e,t){for(var n=0,r=e.length;n<r;n++)$.set(e[n],"globalEval",!t||$.get(t[n],"globalEval"))}ve.tbody=ve.tfoot=ve.colgroup=ve.caption=ve.thead,ve.th=ve.td,f.option||(ve.optgroup=ve.option=[1,"<select multiple='multiple'>","</select>"]);var ye=/<|&#?\w+;/;function Ee(e,t,n,r,o){for(var i,a,l,s,u,c,d=t.createDocumentFragment(),p=[],f=0,m=e.length;f<m;f++)if((i=e[f])||0===i)if("object"===E(i))S.merge(p,i.nodeType?[i]:i);else if(ye.test(i)){for(a=a||d.appendChild(t.createElement("div")),l=(fe.exec(i)||["",""])[1].toLowerCase(),a.innerHTML=(s=ve[l]||ve._default)[1]+S.htmlPrefilter(i)+s[2],c=s[0];c--;)a=a.lastChild;S.merge(p,a.childNodes),(a=d.firstChild).textContent=""}else p.push(t.createTextNode(i));for(d.textContent="",f=0;i=p[f++];)if(r&&S.inArray(i,r)>-1)o&&o.push(i);else if(u=re(i),a=ge(d.appendChild(i),"script"),u&&he(a),n)for(c=0;i=a[c++];)me.test(i.type||"")&&n.push(i);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function De(){return!1}function _e(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,o,i){var a,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,l,n,r,t[l],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=De;else if(!o)return e;return 1===i&&(a=o,(o=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,o,r,n)})}function Te(e,t,n){n?($.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,a=$.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=o.call(arguments),$.set(this,t,a),r=n(this,t),this[t](),a!==(i=$.get(this,t))||r?$.set(this,t,!1):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else a.length&&($.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===$.get(e,t)&&S.event.add(e,t,be)}S.event={global:{},add:function(e,t,n,r,o){var i,a,l,s,u,c,d,p,f,m,v,g=$.get(e);if(G(e))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&S.find.matchesSelector(ne,o),n.guid||(n.guid=S.guid++),(s=g.events)||(s=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(R)||[""]).length;u--;)f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},d=S.event.special[f=(o?d.delegateType:d.bindType)||f]||{},c=S.extend({type:f,origType:v,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&S.expr.match.needsContext.test(o),namespace:m.join(".")},i),(p=s[f])||((p=s[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,m,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[f]=!0)},remove:function(e,t,n,r,o){var i,a,l,s,u,c,d,p,f,m,v,g=$.hasData(e)&&$.get(e);if(g&&(s=g.events)){for(u=(t=(t||"").match(R)||[""]).length;u--;)if(f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},p=s[f=(r?d.delegateType:d.bindType)||f]||[],l=l[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)c=p[i],!o&&v!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(i,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,g.handle)||S.removeEvent(e,f,g.handle),delete s[f])}else for(f in s)S.event.remove(e,f+t[u],n,r,!0);S.isEmptyObject(s)&&$.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,l=new Array(arguments.length),s=S.event.fix(e),u=($.get(this,"events")||Object.create(null))[s.type]||[],c=S.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=S.event.handlers.call(this,s,u),t=0;(o=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==i.namespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(r=((S.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,o,i,a,l=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(i=[],a={},n=0;n<s;n++)void 0===a[o=(r=t[n]).selector+" "]&&(a[o]=r.needsContext?S(o,this).index(u)>-1:S.find(o,this,null,[u]).length),a[o]&&i.push(r);i.length&&l.push({elem:u,handlers:i})}return u=this,s<t.length&&l.push({elem:u,handlers:t.slice(s)}),l},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Te(t,"click",be),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Te(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&C(t,"input")&&$.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:De,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:De,isPropagationStopped:De,isImmediatePropagationStopped:De,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Te(this,e,_e),!1},trigger:function(){return Te(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return o&&(o===r||S.contains(r,o))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=De),this.each(function(){S.event.remove(this,e,n,t)})}});var Ce=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,xe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function we(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ke(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,o,i,a,l;if(1===t.nodeType){if($.hasData(e)&&(l=$.get(e).events))for(o in $.remove(t,"handle events"),l)for(n=0,r=l[o].length;n<r;n++)S.event.add(t,o,l[o][n]);Y.hasData(e)&&(i=Y.access(e),a=S.extend({},i),Y.set(t,a))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=i(t);var o,a,l,s,u,c,d=0,p=e.length,v=p-1,g=t[0],h=m(g);if(h||p>1&&"string"==typeof g&&!f.checkClone&&Ne.test(g))return e.each(function(o){var i=e.eq(o);h&&(t[0]=g.call(this,o,i.html())),Re(i,t,n,r)});if(p&&(a=(o=Ee(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=a),a||r)){for(s=(l=S.map(ge(o,"script"),Ie)).length;d<p;d++)u=o,d!==v&&(u=S.clone(u,!0,!0),s&&S.merge(l,ge(u,"script"))),n.call(e[d],u,d);if(s)for(c=l[l.length-1].ownerDocument,S.map(l,ke),d=0;d<s;d++)me.test((u=l[d]).type||"")&&!$.access(u,"globalEval")&&S.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):y(u.textContent.replace(xe,""),u,c))}return e}function Pe(e,t,n){for(var r,o=t?S.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||S.cleanData(ge(r)),r.parentNode&&(n&&re(r)&&he(ge(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,o,i,a,l=e.cloneNode(!0),s=re(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ge(l),r=0,o=(i=ge(e)).length;r<o;r++)Oe(i[r],a[r]);if(t)if(n)for(i=i||ge(e),a=a||ge(l),r=0,o=i.length;r<o;r++)Le(i[r],a[r]);else Le(e,l);return(a=ge(l,"script")).length>0&&he(a,!s&&ge(e,"script")),l},cleanData:function(e){for(var t,n,r,o=S.event.special,i=0;void 0!==(n=e[i]);i++)if(G(n)){if(t=n[$.expando]){if(t.events)for(r in t.events)o[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[$.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return U(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||we(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=we(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ge(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return U(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ce.test(e)&&!ve[(fe.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ge(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(ge(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,r=[],o=S(e),i=o.length-1,l=0;l<=i;l++)n=l===i?this:this.clone(!0),S(o[l])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Be=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];for(o in r=n.call(e),t)e.style[o]=i[o];return r},je=new RegExp(te.join("|"),"i");function He(e,t,n){var r,o,i,a,l=e.style;return(n=n||Be(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||re(e)||(a=S.style(e,t)),!f.pixelBoxStyles()&&Me.test(a)&&je.test(t)&&(r=l.width,o=l.minWidth,i=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=o,l.maxWidth=i)),void 0!==a?a+"":a}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,s=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),o=36===n(t.width),c.style.position="absolute",i=12===n(c.offsetWidth/3),ne.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,o,i,a,l,s,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(f,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,n,r,o;return null==l&&(t=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",ne.appendChild(t).appendChild(n).appendChild(r),o=e.getComputedStyle(n),l=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),l}}))}();var ze=["Webkit","Moz","ms"],qe=g.createElement("div").style,We={};function Ve(e){return S.cssProps[e]||We[e]||(e in qe?e:We[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=ze.length;n--;)if((e=ze[n]+t)in qe)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,$e={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var r=ee.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,o,i){var a="width"===t?1:0,l=0,s=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(s+=S.css(e,n+te[a],!0,o)),r?("content"===n&&(s-=S.css(e,"padding"+te[a],!0,o)),"margin"!==n&&(s-=S.css(e,"border"+te[a]+"Width",!0,o))):(s+=S.css(e,"padding"+te[a],!0,o),"padding"!==n?s+=S.css(e,"border"+te[a]+"Width",!0,o):l+=S.css(e,"border"+te[a]+"Width",!0,o));return!r&&i>=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-s-l-.5))||0),s}function Je(e,t,n){var r=Be(e),o=(!f.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),i=o,a=He(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!f.boxSizingReliable()&&o||!f.reliableTrDimensions()&&C(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===S.css(e,"boxSizing",!1,r),(i=l in e)&&(a=e[l])),(a=parseFloat(a)||0)+Ze(e,t,n||(o?"border":"content"),i,r,a)+"px"}function Qe(e,t,n,r,o){return new Qe.prototype.init(e,t,n,r,o)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,l=V(t),s=Ke.test(t),u=e.style;if(s||(t=Ve(l)),a=S.cssHooks[t]||S.cssHooks[l],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:u[t];"string"==(i=typeof n)&&(o=ee.exec(n))&&o[1]&&(n=ae(e,t,o),i="number"),null!=n&&n==n&&("number"!==i||s||(n+=o&&o[3]||(S.cssNumber[l]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(s?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var o,i,a,l=V(t);return Ke.test(t)||(t=Ve(l)),(a=S.cssHooks[t]||S.cssHooks[l])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=He(e,t,r)),"normal"===o&&t in Ye&&(o=Ye[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,r):Fe(e,$e,function(){return Je(e,t,r)})},set:function(e,n,r){var o,i=Be(e),a=!f.scrollboxSize()&&"absolute"===i.position,l=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,i),s=r?Ze(e,t,r,l,i):0;return l&&a&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-Ze(e,t,"border",!1,i)-.5)),s&&(o=ee.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),Xe(0,n,s)}}}),S.cssHooks.marginLeft=Ue(f.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+te[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(S.cssHooks[e+t].set=Xe)}),S.fn.extend({css:function(e,t){return U(this,function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=Be(e),o=t.length;a<o;a++)i[t[a]]=S.css(e,t[a],!1,r);return i}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Qe.prototype.init,S.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;function ot(){tt&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(ot):e.setTimeout(ot,S.fx.interval),S.fx.tick())}function it(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function at(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=te[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function lt(e,t,n){for(var r,o=(st.tweeners[t]||[]).concat(st.tweeners["*"]),i=0,a=o.length;i<a;i++)if(r=o[i].call(n,t,e))return r}function st(e,t,n){var r,o,i=0,a=st.prefilters.length,l=S.Deferred().always(function(){delete s.elem}),s=function(){if(o)return!1;for(var t=et||it(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),i=0,a=u.tweens.length;i<a;i++)u.tweens[i].run(r);return l.notifyWith(e,[u,r,n]),r<1&&a?n:(a||l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u]),!1)},u=l.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||it(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)u.tweens[n].run(1);return t?(l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u,t])):l.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,o,i,a;for(n in e)if(o=t[r=V(n)],i=e[n],Array.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in i=a.expand(i),delete e[r],i)n in e||(e[n]=i[n],t[n]=o);else t[r]=o}(c,u.opts.specialEasing);i<a;i++)if(r=st.prefilters[i].call(u,e,c,u.opts))return m(r.stop)&&(S._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,lt,u),m(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),S.fx.timer(S.extend(s,{elem:e,anim:u,queue:u.opts.queue})),u}S.Animation=S.extend(st,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ae(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,o=e.length;r<o;r++)(st.tweeners[n=e[r]]=st.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var r,o,i,a,l,s,u,c,d="width"in t||"height"in t,p=this,f={},m=e.style,v=e.nodeType&&ie(e),g=$.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(nt.test(o=t[r])){if(delete t[r],i=i||"toggle"===o,o===(v?"hide":"show")){if("show"!==o||!g||void 0===g[r])continue;v=!0}f[r]=g&&g[r]||S.style(e,r)}if((s=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(r in d&&1===e.nodeType&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],null==(u=g&&g.display)&&(u=$.get(e,"display")),"none"===(c=S.css(e,"display"))&&(u?c=u:(ue([e],!0),u=e.style.display||u,c=S.css(e,"display"),ue([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===S.css(e,"float")&&(s||(p.done(function(){m.display=u}),null==u&&(u="none"===(c=m.display)?"":c)),m.display="inline-block")),n.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),s=!1,f)s||(g?"hidden"in g&&(v=g.hidden):g=$.access(e,"fxshow",{display:u}),i&&(g.hidden=!v),v&&ue([e],!0),p.done(function(){for(r in v||ue([e]),$.remove(e,"fxshow"),f)S.style(e,r,f[r])})),s=lt(v?g[r]:0,r,p),r in g||(g[r]=s.start,v&&(s.end=s.start,s.start=0))}],prefilter:function(e,t){t?st.prefilters.unshift(e):st.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration=r.duration in S.fx.speeds?S.fx.speeds[r.duration]:S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ie).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=S.isEmptyObject(e),i=S.speed(t,n,r),a=function(){var t=st(this,S.extend({},e),i);(o||$.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",i=S.timers,a=$.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&rt.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=e&&i[o].queue!==e||(i[o].anim.stop(n),t=!1,i.splice(o,1));!t&&n||S.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=$.get(this),r=n[e+"queue"],o=n[e+"queueHooks"],i=S.timers,a=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,r,o)}}),S.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),et=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){tt||(tt=!0,ot())},S.fx.stop=function(){tt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,r){var o=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(o)}})},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var ut,ct=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return U(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?S.prop(e,t,n):(1===i&&S.isXMLDoc(e)||(o=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(R);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||S.find.attr;ct[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=ct[a],ct[a]=o,o=null!=n(e,t,r)?a:null,ct[a]=i),o}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function ft(e){return(e.match(R)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return U(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(e)||(o=S.propHooks[t=S.propFix[t]||t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(S.propHooks.selected={get:function(e){return null},set:function(e){}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,r,o,i,a,l,s=0;if(m(e))return this.each(function(t){S(this).addClass(e.call(this,t,mt(this)))});if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,o,i,a,l,s=0;if(m(e))return this.each(function(t){S(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,o,i,a;if(r)for(o=0,i=S(this),a=vt(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&$.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":$.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+ft(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var gt=/\r/g;S.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=m(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,S(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=S.map(o,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=S.valHooks[o.type]||S.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(gt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ft(S.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,l=a?null:[],s=a?i+1:o.length;for(r=i<0?s:a?i:0;r<s;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;l.push(t)}return l},set:function(e,t){for(var n,r,o=e.options,i=S.makeArray(t),a=o.length;a--;)((r=o[a]).selected=S.inArray(S.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},f.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),f.focusin="onfocusin"in e;var ht=/^(?:focusinfocus|focusoutblur)$/,yt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,r,o){var i,a,l,s,u,d,p,f,h=[r||g],y=c.call(t,"type")?t.type:t,E=c.call(t,"namespace")?t.namespace.split("."):[];if(a=f=l=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!ht.test(y+S.event.triggered)&&(y.indexOf(".")>-1&&(E=y.split("."),y=E.shift(),E.sort()),u=y.indexOf(":")<0&&"on"+y,(t=t[S.expando]?t:new S.Event(y,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=E.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:S.makeArray(n,[t]),p=S.event.special[y]||{},o||!p.trigger||!1!==p.trigger.apply(r,n))){if(!o&&!p.noBubble&&!v(r)){for(ht.test((s=p.delegateType||y)+y)||(a=a.parentNode);a;a=a.parentNode)h.push(a),l=a;l===(r.ownerDocument||g)&&h.push(l.defaultView||l.parentWindow||e)}for(i=0;(a=h[i++])&&!t.isPropagationStopped();)f=a,t.type=i>1?s:p.bindType||y,(d=($.get(a,"events")||Object.create(null))[t.type]&&$.get(a,"handle"))&&d.apply(a,n),(d=u&&a[u])&&d.apply&&G(a)&&(t.result=d.apply(a,n),!1===t.result&&t.preventDefault());return t.type=y,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),n)||!G(r)||u&&m(r[y])&&!v(r)&&((l=r[u])&&(r[u]=null),S.event.triggered=y,t.isPropagationStopped()&&f.addEventListener(y,yt),r[y](),t.isPropagationStopped()&&f.removeEventListener(y,yt),S.event.triggered=void 0,l&&(r[u]=l)),t.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),f.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=$.access(r,t);o||r.addEventListener(e,n,!0),$.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=$.access(r,t)-1;o?$.access(r,t,o):(r.removeEventListener(e,n,!0),$.remove(r,t))}}});var Et=e.location,St={guid:Date.now()},bt=/\?/;S.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var Dt=/\[\]$/,_t=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;function Ct(e,t,n,r){var o;if(Array.isArray(t))S.each(t,function(t,o){n||Dt.test(e)?r(e,o):Ct(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==E(t))r(e,t);else for(o in t)Ct(e+"["+o+"]",t[o],n,r)}S.param=function(e,t){var n,r=[],o=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){o(this.name,this.value)});else for(n in e)Ct(n,e[n],t,o);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Tt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(_t,"\r\n")}}):{name:t.name,value:n.replace(_t,"\r\n")}}).get()}});var Nt=/%20/g,xt=/#.*$/,wt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,kt=/^(?:GET|HEAD)$/,Lt=/^\/\//,Ot={},Rt={},Pt="*/".concat("*"),Mt=g.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(R)||[];if(m(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var o={},i=e===Rt;function a(l){var s;return o[l]=!0,S.each(e[l]||[],function(e,l){var u=l(t,n,r);return"string"!=typeof u||i||o[u]?i?!(s=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),s}return a(t.dataTypes[0])||!o["*"]&&a("*")}function jt(e,t){var n,r,o=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=Et.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?jt(jt(e,S.ajaxSettings),t):jt(S.ajaxSettings,e)},ajaxPrefilter:Bt(Ot),ajaxTransport:Bt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var r,o,i,a,l,s,u,c,d,p,f=S.ajaxSetup({},n=n||{}),m=f.context||f,v=f.context&&(m.nodeType||m.jquery)?S(m):S.event,h=S.Deferred(),y=S.Callbacks("once memory"),E=f.statusCode||{},b={},D={},_="canceled",A={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=It.exec(i);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?i:null},setRequestHeader:function(e,t){return null==u&&(e=D[e.toLowerCase()]=D[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)A.always(e[A.status]);else for(t in e)E[t]=[E[t],e[t]];return this},abort:function(e){var t=e||_;return r&&r.abort(t),T(0,t),this}};if(h.promise(A),f.url=((t||f.url||Et.href)+"").replace(Lt,Et.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(R)||[""],null==f.crossDomain){s=g.createElement("a");try{s.href=f.url,s.href=s.href,f.crossDomain=Mt.protocol+"//"+Mt.host!=s.protocol+"//"+s.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Ft(Ot,f,n,A),u)return A;for(d in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!kt.test(f.type),o=f.url.replace(xt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Nt,"+")):(p=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(bt.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(wt,"$1"),p=(bt.test(o)?"&":"?")+"_="+St.guid+++p),f.url=o+p),f.ifModified&&(S.lastModified[o]&&A.setRequestHeader("If-Modified-Since",S.lastModified[o]),S.etag[o]&&A.setRequestHeader("If-None-Match",S.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&A.setRequestHeader("Content-Type",f.contentType),A.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Pt+"; q=0.01":""):f.accepts["*"]),f.headers)A.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(m,A,f)||u))return A.abort();if(_="abort",y.add(f.complete),A.done(f.success),A.fail(f.error),r=Ft(Rt,f,n,A)){if(A.readyState=1,c&&v.trigger("ajaxSend",[A,f]),u)return A;f.async&&f.timeout>0&&(l=e.setTimeout(function(){A.abort("timeout")},f.timeout));try{u=!1,r.send(b,T)}catch(e){if(u)throw e;T(-1,e)}}else T(-1,"No Transport");function T(t,n,a,s){var d,p,g,b,D,_=n;u||(u=!0,l&&e.clearTimeout(l),r=void 0,i=s||"",A.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(b=function(e,t,n){for(var r,o,i,a,l=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){s.unshift(o);break}if(s[0]in n)i=s[0];else{for(o in n){if(!s[0]||e.converters[o+" "+s[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==s[0]&&s.unshift(i),n[i]}(f,A,a)),!d&&S.inArray("script",f.dataTypes)>-1&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(e,t,n,r){var o,i,a,l,s,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(i=c.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=i,i=c.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(a=u[s+" "+i]||u["* "+i]))for(o in u)if((l=o.split(" "))[1]===i&&(a=u[s+" "+l[0]]||u["* "+l[0]])){!0===a?a=u[o]:!0!==u[o]&&(i=l[0],c.unshift(l[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+s+" to "+i}}}return{state:"success",data:t}}(f,b,A,d),d?(f.ifModified&&((D=A.getResponseHeader("Last-Modified"))&&(S.lastModified[o]=D),(D=A.getResponseHeader("etag"))&&(S.etag[o]=D)),204===t||"HEAD"===f.type?_="nocontent":304===t?_="notmodified":(_=b.state,p=b.data,d=!(g=b.error))):(g=_,!t&&_||(_="error",t<0&&(t=0))),A.status=t,A.statusText=(n||_)+"",d?h.resolveWith(m,[p,_,A]):h.rejectWith(m,[A,_,g]),A.statusCode(E),E=void 0,c&&v.trigger(d?"ajaxSuccess":"ajaxError",[A,f,d?p:g]),y.fireWith(m,[A,_]),c&&(v.trigger("ajaxComplete",[A,f]),--S.active||S.event.trigger("ajaxStop")))}return A},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,r,o){return m(n)&&(o=o||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:o,data:n,success:r},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Ut=S.ajaxSettings.xhr();f.cors=!!Ut&&"withCredentials"in Ut,f.ajax=Ut=!!Ut,S.ajaxTransport(function(t){var n,r;if(f.cors||Ut&&!t.crossDomain)return{send:function(o,i){var a,l=t.xhr();if(l.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)l[a]=t.xhrFields[a];for(a in t.mimeType&&l.overrideMimeType&&l.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)l.setRequestHeader(a,o[a]);n=function(e){return function(){n&&(n=r=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?i(0,"error"):i(l.status,l.statusText):i(Ht[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=n(),r=l.onerror=l.ontimeout=n("error"),void 0!==l.onabort?l.onabort=r:l.onreadystatechange=function(){4===l.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{l.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,qt=[],Wt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(t,n,r){var o,i,a,l=!1!==t.jsonp&&(Wt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wt.test(t.data)&&"data");if(l||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,l?t[l]=t[l].replace(Wt,"$1"+o):!1!==t.jsonp&&(t.url+=(bt.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return a||S.error(o+" was not called"),a[0]},t.dataTypes[0]="json",i=e[o],e[o]=function(){a=arguments},r.always(function(){void 0===i?S(e).removeProp(o):e[o]=i,t[o]&&(t.jsonpCallback=n.jsonpCallback,qt.push(o)),a&&m(i)&&i(a[0]),a=i=void 0}),"script"}),f.createHTMLDocument=((zt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===zt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),i=!n&&[],(o=N.exec(e))?[t.createElement(o[1])]:(o=Ee([e],t,i),i&&i.length&&S(i).remove(),S.merge([],o.childNodes)));var r,o,i},S.fn.load=function(e,t,n){var r,o,i,a=this,l=e.indexOf(" ");return l>-1&&(r=ft(e.slice(l)),e=e.slice(0,l)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&S.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var r,o,i,a,l,s,u=S.css(e,"position"),c=S(e),d={};"static"===u&&(e.style.position="relative"),l=c.offset(),i=S.css(e,"top"),s=S.css(e,"left"),("absolute"===u||"fixed"===u)&&(i+s).indexOf("auto")>-1?(a=(r=c.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(s)||0),m(t)&&(t=t.call(e,n,S.extend({},l))),null!=t.top&&(d.top=t.top-l.top+a),null!=t.left&&(d.left=t.left-l.left+o),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?{top:(t=r.getBoundingClientRect()).top+(n=r.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),o.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-S.css(r,"marginTop",!0),left:t.left-o.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ne})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return U(this,function(e,r,o){var i;if(v(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===o)return i?i[t]:e[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):e[r]=o},e,r,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=Ue(f.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){S.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),l=n||(!0===o||!0===i?"margin":"border");return U(this,function(t,n,o){var i;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?S.css(t,n,l):S.style(t,n,o,l)},t,a?o:void 0,a)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=o.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=C,S.isFunction=m,S.isWindow=v,S.camelCase=V,S.type=E,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var Gt=e.jQuery,Kt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Kt),t&&e.jQuery===S&&(e.jQuery=Gt),S},void 0===t&&(e.jQuery=e.$=S),S})});const O=e=>{let{className:t,onClick:n}=e;return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#1359C8",className:t,width:"24px",height:"24px",onClick:n},r.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))},R="__googleMapsScriptId";var P;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(P||(P={}));class M{constructor(e){let{apiKey:t,channel:n,client:r,id:o=R,libraries:i=[],language:a,region:l,version:s,mapIds:u,nonce:c,retries:d=3,url:p="https://maps.googleapis.com/maps/api/js"}=e;if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=s,this.apiKey=t,this.channel=n,this.client=r,this.id=o||R,this.libraries=i,this.language=a,this.region=l,this.mapIds=u,this.nonce=c,this.retries=d,this.url=p,M.instance){if(!function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}(this.options,M.instance.options))throw new Error("Loader must not be called again with different options. "+JSON.stringify(this.options)+" !== "+JSON.stringify(M.instance.options));return M.instance}M.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get status(){return this.errors.length?P.FAILURE:this.done?P.SUCCESS:this.loading?P.LOADING:P.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),this.libraries.length>0&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="®ion="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(n=>{n?t(n.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in "+e+" ms."),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}const B="undefined"!=typeof window&&window.google?window.google:null,F=e=>{let t={};console.log("setCode=======",e);const o=e=>{var t;let n=null;return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("postal_code");n=t?e.long_name:null}),n},i=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],a=function(e,t,n){void 0===n&&(n=!1),(new B.maps.Geocoder).geocode({location:e},function(r,i){if("OK"===i&&r[0]){let i=o(r[0]);const a=document.getElementById("pac-input");a.value=(e=>{var t;let n="";return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("sublocality_level_2")||e.types.includes("sublocality_level_1");t&&(n=t?e.long_name:null)}),n})(r[0]),t&&(n?t(i,{longitude:e.lng,latitude:e.lat},a.value):t(i,{longitude:e.lng,latitude:e.lat}))}})},l=function(e,t,n){if(!e)return;const{latLng:r}=e,o={lat:r.lat(),lng:r.lng()};console.log("Lat & Long",o),t("000000",{longitude:o.lng,latitude:o.lat})},s=function(e,n,r){void 0===r&&(r=!1);const s=new window.google.maps.Map(document.getElementById("map"),{center:n,zoom:15,mapTypeId:"roadmap",styles:i}),u=document.getElementById("pac-input");var c;u&&u.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}),(c=n).lat&&c.lng&&(t={north:c.lat+.1,south:c.lat-.1,east:c.lng+.1,west:c.lng-.1});const d=new window.google.maps.places.Autocomplete(u,{bounds:t,componentRestrictions:{country:"in"},fields:["address_components","geometry","icon","name"],origin:n,strictBounds:!1,types:["address"]});s.addListener("bounds_changed",()=>{d.setBounds(s.getBounds())});let p=[new window.google.maps.Marker({map:s,title:"a",position:n,draggable:!0,clickable:!0})];r?a(n,e,!0):a(n,e),p[0].addListener("dragend",t=>l(t,e)),console.log("In initAutoComplete, searbox: ",d),d.addListener("place_changed",()=>{const t=d.getPlace();if(console.log("Place: ",t),!t)return;let n=o(t);if(console.log("Pincode: ",n),n){const{geometry:o}=t,i={latitude:o.location.lat(),longitude:o.location.lng()};r?e(n,i,t.name):e(n,i)}p.forEach(e=>{e.setMap(null)}),p=[];const i=new window.google.maps.LatLngBounds;t.geometry&&(p.push(new window.google.maps.Marker({map:s,title:t.name,position:t.geometry.location,draggable:!0,clickable:!0})),p[0].addListener("dragend",t=>l(t,e)),t.geometry.viewport?i.union(t.geometry.viewport):i.extend(t.geometry.location),s.fitBounds(i))})};return n.useEffect(()=>{!function(){try{const t=t=>{s(e.onChange,{lat:t.coords.latitude,lng:t.coords.longitude},e.isPlaceRequired)},n=t=>{let n={};var r;n=null!=e&&e.isPTDefault&&(null==e||null===(r=e.PTdefaultcoord)||void 0===r?void 0:r.defaultConfig)||{lat:31.6160638,lng:74.8978579},s(e.onChange,n,e.isPlaceRequired)};(e=>{var t;const n=null===(t=window.globalConfigs)||void 0===t?void 0:t.getConfig("GMAPS_API_KEY");console.log("GMAPS_API_KEY: ",n),new M({apiKey:n,version:"weekly",libraries:["places"]}).load().then(()=>{e&&e()}).catch(e=>{})})(()=>{var r,o,i;null!==(r=e.position)&&void 0!==r&&r.latitude&&null!==(o=e.position)&&void 0!==o&&o.longitude?t({coords:e.position}):null!==(i=navigator)&&void 0!==i&&i.geolocation?navigator.geolocation.getCurrentPosition(t,n):n()}),Promise.resolve()}catch(e){return Promise.reject(e)}}()},[]),r.createElement("div",{className:"map-wrap"},r.createElement("div",{className:"map-search-bar-wrap"},r.createElement(O,{className:"map-search-bar-icon"}),r.createElement("input",{id:"pac-input",className:"map-search-bar",type:"text",placeholder:"Search Address",style:{backgroundPosition:"left",color:"#222",caretColor:"#222"},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}})),r.createElement("div",{id:"map",className:"map"}))};var j="function"==typeof Symbol&&Symbol.for,H=j?Symbol.for("react.element"):60103,U=j?Symbol.for("react.portal"):60106,z=j?Symbol.for("react.fragment"):60107,q=j?Symbol.for("react.strict_mode"):60108,W=j?Symbol.for("react.profiler"):60114,V=j?Symbol.for("react.provider"):60109,G=j?Symbol.for("react.context"):60110,K=j?Symbol.for("react.async_mode"):60111,$=j?Symbol.for("react.concurrent_mode"):60111,Y=j?Symbol.for("react.forward_ref"):60112,X=j?Symbol.for("react.suspense"):60113,Z=j?Symbol.for("react.suspense_list"):60120,J=j?Symbol.for("react.memo"):60115,Q=j?Symbol.for("react.lazy"):60116,ee=j?Symbol.for("react.block"):60121,te=j?Symbol.for("react.fundamental"):60117,ne=j?Symbol.for("react.responder"):60118,re=j?Symbol.for("react.scope"):60119;function oe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case H:switch(e=e.type){case K:case $:case z:case W:case q:case X:return e;default:switch(e=e&&e.$$typeof){case G:case Y:case Q:case J:case V:return e;default:return t}}case U:return t}}}function ie(e){return oe(e)===$}var ae={AsyncMode:K,ConcurrentMode:$,ContextConsumer:G,ContextProvider:V,Element:H,ForwardRef:Y,Fragment:z,Lazy:Q,Memo:J,Portal:U,Profiler:W,StrictMode:q,Suspense:X,isAsyncMode:function(e){return ie(e)||oe(e)===K},isConcurrentMode:ie,isContextConsumer:function(e){return oe(e)===G},isContextProvider:function(e){return oe(e)===V},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===H},isForwardRef:function(e){return oe(e)===Y},isFragment:function(e){return oe(e)===z},isLazy:function(e){return oe(e)===Q},isMemo:function(e){return oe(e)===J},isPortal:function(e){return oe(e)===U},isProfiler:function(e){return oe(e)===W},isStrictMode:function(e){return oe(e)===q},isSuspense:function(e){return oe(e)===X},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===z||e===$||e===W||e===q||e===X||e===Z||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===J||e.$$typeof===V||e.$$typeof===G||e.$$typeof===Y||e.$$typeof===te||e.$$typeof===ne||e.$$typeof===re||e.$$typeof===ee)},typeOf:oe},le=C(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case u:case c:case o:case a:case i:case p:return f;default:var g=f&&f.$$typeof;switch(g){case s:case d:case v:case m:case l:return g;default:return t}}case r:return t}}}var b=c,D=s,_=l,A=n,T=d,C=o,N=v,x=m,w=r,I=a,k=i,L=p,O=!1;function R(e){return S(e)===c}t.AsyncMode=u,t.ConcurrentMode=b,t.ContextConsumer=D,t.ContextProvider=_,t.Element=A,t.ForwardRef=T,t.Fragment=C,t.Lazy=N,t.Memo=x,t.Portal=w,t.Profiler=I,t.StrictMode=k,t.Suspense=L,t.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||S(e)===u},t.isConcurrentMode=R,t.isContextConsumer=function(e){return S(e)===s},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===d},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===v},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===r},t.isProfiler=function(e){return S(e)===a},t.isStrictMode=function(e){return S(e)===i},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===a||e===i||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===s||e.$$typeof===d||e.$$typeof===h||e.$$typeof===y||e.$$typeof===E||e.$$typeof===g)},t.typeOf=S}()}),se=C(function(e){e.exports="production"===process.env.NODE_ENV?ae:le}),ue=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;function pe(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var fe=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=pe(e),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))ce.call(n,a)&&(o[a]=n[a]);if(ue){r=ue(n);for(var l=0;l<r.length;l++)de.call(n,r[l])&&(o[r[l]]=n[r[l]])}}return o},me="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ve=Function.call.bind(Object.prototype.hasOwnProperty),ge=function(){};if("production"!==process.env.NODE_ENV){var he=me,ye={},Ee=ve;ge=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Se(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Ee(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,r,n,null,he)}catch(e){a=e}if(!a||a instanceof Error||ge((r||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in ye)){ye[a.message]=!0;var s=o?o():"";ge("Failed "+n+" type: "+a.message+(null!=s?s:""))}}}Se.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ye={})};var be=Se,De=function(){};function _e(){return null}function Ae(){}function Te(){}"production"!==process.env.NODE_ENV&&(De=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Te.resetWarningCache=Ae;var Ce=C(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(_e),arrayOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+c(l)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<l.length;s++){var u=e(l,s,r,o,a+"["+s+"]",me);if(u instanceof Error)return u}return null})},element:a(function(t,n,r,o,a){var l=t[n];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+c(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,o){var a=e[t];return se.isValidElementType(a)?null:new i("Invalid "+r+" `"+o+"` of type `"+c(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,o,a){var l;return t[n]instanceof e?null:new i("Invalid "+o+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,o){return u(e[t])?null:new i("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],s=c(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(ve(l,u)){var d=e(l,u,r,o,a+"."+u,me);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&De(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),_e;function t(t,n,r,a,l){for(var s=t[n],u=0;u<e.length;u++)if(o(s,e[u]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+c+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&De("Invalid argument supplied to oneOfType, expected an instance of array."),_e;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return De("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),_e}return a(function(t,n,r,o,a){for(var l=[],s=0;s<e.length;s++){var u=(0,e[s])(t,n,r,o,a,me);if(null==u)return null;u.data&&ve(u.data,"expectedType")&&l.push(u.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,o,a){var l=t[n],u=c(l);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var p in e){var f=e[p];if("function"!=typeof f)return s(r,o,a,p,d(f));var m=f(l,p,r,o,a+"."+p,me);if(m)return m}return null})},exact:function(e){return a(function(t,n,r,o,a){var l=t[n],u=c(l);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var p=fe({},t[n],e);for(var f in p){var m=e[f];if(ve(e,f)&&"function"!=typeof m)return s(r,o,a,f,d(m));if(!m)return new i("Invalid "+o+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=m(l,f,r,o,a+"."+f,me);if(v)return v}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,o,a,l,s){if(o=o||"<<anonymous>>",l=l||r,s!==me){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}return null==n[r]?t?new i(null===n[r]?"The "+a+" `"+l+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+a+" `"+l+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,a,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,n,r,o,a,l){var s=t[n];return c(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+d(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,r,o){return new i((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!u(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!u(a[1]))return!1}return!0;default:return!1}}function c(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=c(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,r.checkPropTypes=be,r.resetWarningCache=be.resetWarningCache,r.PropTypes=r,r}(se.isElement):function(){function e(e,t,n,r,o,i){if(i!==me){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Te,resetWarningCache:Ae};return n.PropTypes=n,n}()});const Ne=["onClick","style","children","className","ReactRef"],xe=e=>{var t;let{onClick:n,style:o,children:a,className:l,ReactRef:s}=e,u=d(e,Ne);const{pathname:p}=i.useLocation(),f=Digit.Hooks.fsm.useRouteSubscription(p),m=null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info;return r.createElement("div",c({className:("employee"===f||"EMPLOYEE"===(null==m?void 0:m.type)?"employeeCard":"card")+" "+(l||""),onClick:n,style:o},u,{ref:s}),a)},we=e=>r.createElement("div",{className:"card-header",style:e.styles?c({},e.styles,{marginBottom:"30px"}):{marginBottom:"30px"}},e.children,e.divider&&r.createElement("hr",{style:{border:"1px solid #DFE0E2",marginTop:"10px"}}));we.propTypes={styles:Ce.object,divider:Ce.bool,children:Ce.node.isRequired},we.defaultProps={styles:{},divider:!1};const Ie=e=>r.createElement("p",{className:"card-text "+(e.disable&&"disabled")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),ke=e=>r.createElement("h2",{className:"card-label-error "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),Le=e=>{let{header:t,cardText:o,nextText:i,t:a,forcedError:l,onSave:s,onChange:u,position:c,onSelect:d,disabled:p,cardBodyStyle:f={},isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:g,handleRemove:h,Webview:y=!1,isPopUp:E=!1}=e;const S=n.useRef(!0);n.useEffect(()=>()=>{S.current=!1},[]);const[b,D]=n.useState(Boolean(p||!1));n.useEffect(()=>{S.current&&D(Boolean(p||!1))},[p]);const[_,A]=n.useState({latitude:0,longitude:0}),[T,C]=n.useState(),[N,x]=n.useState(),w=e=>{S.current&&C(e)},I=e=>{S.current&&A(e)};return r.createElement(xe,{style:{position:"relative"}},r.createElement("div",{style:{display:"flex"}},r.createElement("svg",{style:{marginTop:y?"16px":"8px"},width:"24",height:"24",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M14.9999 9.66666C12.0533 9.66666 9.66658 12.0533 9.66658 15C9.66658 17.9467 12.0533 20.3333 14.9999 20.3333C17.9466 20.3333 20.3333 17.9467 20.3333 15C20.3333 12.0533 17.9466 9.66666 14.9999 9.66666ZM26.9199 13.6667C26.3066 8.10666 21.8933 3.69333 16.3333 3.07999V0.333328H13.6666V3.07999C8.10658 3.69333 3.69325 8.10666 3.07992 13.6667H0.333252V16.3333H3.07992C3.69325 21.8933 8.10658 26.3067 13.6666 26.92V29.6667H16.3333V26.92C21.8933 26.3067 26.3066 21.8933 26.9199 16.3333H29.6666V13.6667H26.9199ZM14.9999 24.3333C9.83992 24.3333 5.66658 20.16 5.66658 15C5.66658 9.83999 9.83992 5.66666 14.9999 5.66666C20.1599 5.66666 24.3333 9.83999 24.3333 15C24.3333 20.16 20.1599 24.3333 14.9999 24.3333Z",fill:"#505A5F"})),r.createElement(we,null,t)),r.createElement("div",{style:f},E&&r.createElement("button",{type:"button",onClick:()=>h&&h(),style:{position:"absolute",left:12,top:12,padding:"8px 10px",background:"#fff",color:"#0b74de",border:"none",borderRadius:6,cursor:"pointer",fontWeight:700,fontSize:13,lineHeight:"16px",zIndex:9999,appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"},"aria-label":"Close",title:"Close"},r.createElement("span",{style:{color:"red",display:"inline-block"}},"Close")),r.createElement(Ie,null,o),r.createElement(F,{onChange:g?(e,t,n)=>{w(e),I(t),(e=>{S.current&&x(e)})(n),S.current&&D(!e)}:(e,t)=>{w(e),I(t),S.current&&D(!e)},position:c,isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:g}),l&&r.createElement(ke,null,a(l))),r.createElement("div",{style:{padding:"12px"}},(()=>{const e=null!=i?i:a?a("ADS_PIN_LOCATION_LABEL"):null,t="string"==typeof e&&e.trim()?e:a&&a("ADS_PIN_LOCATION_LABEL")||"Pick";return r.createElement("button",{type:"button",onClick:e=>{e&&e.preventDefault(),e&&e.stopPropagation(),(()=>{const e={geoLocation:_};if("function"!=typeof d)if("function"!=typeof s)"function"!=typeof u?console.warn("LocationSearchCard: no submit callback provided by parent."):N&&Object.keys(N).length?u(T,_,N):u(T,_);else try{s(_,T,N)}catch(t){try{s(e)}catch(e){console.warn("LocationSearchCard: onSave call failed",e)}}else d("address",e)})()},disabled:b,"aria-disabled":b,style:{display:"inline-block",width:"100%",padding:"10px 12px",background:b?"#ddd":"#0b74de",color:b?"#666":"#fff",border:"none",borderRadius:6,cursor:b?"not-allowed":"pointer",textAlign:"center",fontWeight:700,fontSize:14,lineHeight:"20px",WebkitTextFillColor:b?"#666":"#fff",appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"}},t||"Pick"," ")})()))};Le.propTypes={header:Ce.string,cardText:Ce.string,nextText:Ce.string,t:Ce.func,skipAndContinueText:Ce.string,skip:Ce.func,onSave:Ce.func,onChange:Ce.func,position:Ce.any,onSelect:Ce.func,isPTDefault:Ce.any,PTdefaultcoord:Ce.any,isPlaceRequired:Ce.any,handleRemove:Ce.func,Webview:Ce.bool,isPopUp:Ce.bool},Le.defaultProps={header:"",cardText:"",nextText:"",skipAndContinueText:"",onSelect:null,skip:()=>{},onSave:null,onChange:()=>{},position:void 0,isPTDefault:!1,PTdefaultcoord:{},isPlaceRequired:!1,handleRemove:()=>{},Webview:!1,isPopUp:!1};const Oe=e=>{let{t:n,currentPage:o,columns:i,data:a,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:f,pageSizeLimit:m,sortParams:v,totalRecords:g}=e;return r.createElement(t.Table,{t:n,data:a,currentPage:o,columns:i,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:m,disableSort:s,isPaginationRequired:f,onPageSizeChange:p,onSort:u,sortParams:v,totalRecords:g})},Re=e=>{let{onSubmit:i,setExistingDataSet:a,Searchdata:l}=e;const{t:s}=o.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,p]=n.useState(null),[f,m]=n.useState(!1),v=Digit.UserService.getUser().info,g=Digit.Hooks.ads.useADSSlotSearch(),h={advertisementSlotSearchCriteria:l.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};n.useEffect(()=>{f&&(i(),m(!1))},[f,i]);let y,E=window.location.href.split("/").pop();isNaN(parseInt(E))||(y=E);let S=isNaN(parseInt(E))?{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:u,mobileNumber:null==v?void 0:v.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:y,tenantId:u};n.useEffect(()=>{p(S)},[E]);const{isLoading:b,data:D}=Digit.Hooks.ads.useADSSearch({filters:d});if(b)return r.createElement(t.Loader,null);const _=(null==D?void 0:D.bookingApplication)||[],A={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},T={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("div",null,_.length>0&&_.map((e,n)=>{var o;return r.createElement("div",{key:n},r.createElement(t.Card,{style:c({},A,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=T.backgroundColor,e.currentTarget.style.boxShadow=T.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{!function(e){try{Promise.resolve(g.mutateAsync(h)).then(function(t){var n,r,o,i,l,s,u,c,d,p,f;const v=null==t?void 0:t.advertisementSlotAvailabiltityDetails[0].timerValue,g={documents:{documents:null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>({documentDetailId:null==e?void 0:e.documentDetailId,documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.fileStoreId}))},address:{pincode:null==e||null===(r=e.address)||void 0===r?void 0:r.pincode,houseNo:null==e||null===(o=e.address)||void 0===o?void 0:o.houseNo,streetName:null==e||null===(i=e.address)||void 0===i?void 0:i.streetName,landmark:null==e||null===(l=e.address)||void 0===l?void 0:l.landmark,addressline1:null==e||null===(s=e.address)||void 0===s?void 0:s.addressLine1,addressline2:null==e||null===(u=e.address)||void 0===u?void 0:u.addressLine2},applicant:{applicantName:null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.applicantMobileNo,alternateNumber:null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.applicantAlternateMobileNo,emailId:null==e||null===(f=e.applicantDetail)||void 0===f?void 0:f.applicantEmailId},timervalue:{timervalue:v||0},draftId:(null==t?void 0:t.draftId)||""};a(g),m(!0)})}catch(e){return Promise.reject(e)}}(e)}},r.createElement(t.KeyNote,{keyValue:s("ADS_BOOKING_NO"),note:null==e?void 0:e.bookingNo}),r.createElement(t.KeyNote,{keyValue:s("ADS_APPLICANT_NAME"),note:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName}),r.createElement(t.KeyNote,{keyValue:s("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:s(""+(null==e?void 0:e.bookingStatus))})))}),0===_.length&&!b&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},s("ADS_NO_APPLICATION_FOUND_MSG"))))},Pe=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),Me=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(Pe,null)),Be=e=>{let{t:o,closeModal:i,onSubmit:a,setExistingDataSet:l,Searchdata:s}=e;const[u,c]=n.useState(!1),[d,p]=n.useState(!1),f=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),m=e=>u&&r.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),v=Digit.Hooks.ads.useADSSlotSearch(),g={advertisementSlotSearchCriteria:s.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:f,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{d&&(a(),p(!1))},[d,a]),r.createElement(r.Fragment,null,r.createElement(t.Modal,{headerBarMain:r.createElement(m,{t:o}),headerBarEnd:r.createElement(Me,{onClick:i}),actionCancelLabel:u&&o("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},u&&r.createElement(Re,{onSubmit:a,setExistingDataSet:l,Searchdata:s}),r.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&r.createElement(t.SubmitBar,{label:o("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!u&&r.createElement(t.SubmitBar,{label:o("FILL_NEW_DETAILS"),onSubmit:function(){try{return Promise.resolve(v.mutateAsync(g)).then(function(e){l({timervalue:{timervalue:(null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue)||10},draftId:(null==e?void 0:e.draftId)||""}),p(!0)})}catch(e){return Promise.reject(e)}}})))))},Fe=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),je=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(Fe,null)),He=e=>{let{onClose:n,cartDetails:a,setCartDetails:l}=e;const{t:s}=o.useTranslation(),u=(i.useLocation(),[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},s("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:s("ADD_TYPE"),accessor:"addType"},{Header:s("FACE_AREA"),accessor:"faceArea"},{Header:s("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,s(t?"Yes":"No"))}},{Header:s("BOOKING_DATE"),accessor:"bookingDate"},{Header:s("UNIT_PRICE"),accessor:"price"},{Header:s("ADS_STATUS"),accessor:"status",Cell:e=>{let{value:t}=e;return r.createElement("div",{className:"sla-cell-success"},t)}},{Header:s("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{const t=a.filter((t,n)=>n!==e);l(t)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}]);return r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(je,{onClick:n}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Oe,{t:s,data:a,columns:u,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:a.length}),r.createElement("div",{style:{position:"sticky",bottom:0,backgroundColor:"#fff",padding:"15px 20px",fontSize:"18px",fontWeight:"bold",boxShadow:"0 -2px 5px rgba(0,0,0,0.1)",zIndex:10}},"Total Price: ",a.reduce((e,t)=>e+Number(t.price),0)))},Ue=e=>{let{styles:t,className:n}=e;return r.createElement("svg",{width:"24",height:"24",className:n,style:c({},t),viewBox:"0 0 24 24",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M7 10H4V17H7V10Z"}),r.createElement("path",{d:"M13.5 10H10.5V17H13.5V10Z"}),r.createElement("path",{d:"M22 19H2V22H22V19Z"}),r.createElement("path",{d:"M20 10H17V17H20V10Z"}),r.createElement("path",{d:"M12 1L2 6V8H22V6L12 1Z"}))},ze=e=>{let{headComment:t,otherComment:n}=e;return r.createElement("div",{className:"checkpoint-comments-wrap"},r.createElement("h4",null,t),r.createElement("p",null,n))},qe=e=>{var n,i,a;let{data:l,OpenImage:s}=e;const{t:u}=o.useTranslation();return r.createElement("div",null,l.date&&r.createElement("p",null,l.date),r.createElement("p",null,l.name),l.mobileNumber&&r.createElement(t.TelePhone,{mobile:l.mobileNumber}),l.source&&r.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+l.source.toUpperCase())),l.comment&&r.createElement(ze,{otherComment:null==l?void 0:l.otherComment,headComment:null==l?void 0:l.comment}),null!=l&&l.wfComment?r.createElement("div",null,null==l||null===(n=l.wfComment)||void 0===n?void 0:n.map(e=>r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("WF_COMMON_COMMENTS")),r.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==l||null===(i=l.thumbnailsToShow)||void 0===i||null===(a=i.thumbs)||void 0===a?void 0:a.length)>0?r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),r.createElement(t.DisplayPhotos,{srcs:null==l?void 0:l.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==l?void 0:l.thumbnailsToShow)}})):null)};"undefined"!=typeof window&&void 0===window.process&&(window.process={env:{}});const We=e=>{var o,i;let{t:a,onSelect:l,formData:s={},handleRemove:u,onSave:c}=e;const[d,p]=n.useState((null==s||null===(o=s.address)||void 0===o?void 0:o.pincode)||""),[f,m]=n.useState((null==s||null===(i=s.address)||void 0===i?void 0:i.geoLocation)||{}),v=Digit.Hooks.obps.useTenants(),[g,h]=n.useState(null),[y,E]=n.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return r.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0",zIndex:9999},onClick:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onMouseDown:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onKeyDown:e=>{!e||"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation())}},r.createElement("div",{style:{position:"relative",marginTop:"60px"}},r.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},r.createElement(t.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a?a("ADS_GIS_LABEL"):"Pick location",nextText:a&&a("ADS_PIN_LOCATION_LABEL")||"Pick location",skip:()=>{if("function"==typeof l)try{return l()}catch(e){return void console.warn("GIS: onSelect threw",e)}if("function"==typeof c)try{return c(f||{},d||"",y||"")}catch(e){try{return c({geoLocation:f||{},pincode:d||"",placeName:y||""})}catch(e){console.warn("GIS: onSave also failed",e)}}console.warn("GIS: neither onSelect nor onSave provided for skip")},t:a,position:f,onSave:()=>{if("function"==typeof c)try{c(f,d,y)}catch(e){try{c({geoLocation:f,pincode:d,placeName:y})}catch(e){console.warn("GIS: onSave call failed",e)}}else console.warn("GIS: onSave not provided")},onChange:(e,t,n)=>{((e,t,n)=>{h(null),(null==v?void 0:v.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==e)}))?(p(e),m(t),E(n)):(h("BPA_COMMON_PINCODE_NOT_SERVICABLE"),p(""),m({}),E(""))})(e,t,n)},disabled:!1,forcedError:g?a(g):null,isPlaceRequired:!0,handleRemove:u,Webview:S,isPopUp:!0}))))},Ve=e=>{var n,i,a,l,s,u,c,d;const{t:p}=o.useTranslation(),f=null==e||null===(n=e.application)||void 0===n||null===(i=n.workflow)||void 0===i?void 0:i.businessService,{isLoading:m,data:v}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id||(null===(l=e.application)||void 0===l?void 0:l.applicationNumber)||(null===(s=e.application)||void 0===s?void 0:s.bookingNo),moduleCode:"advandhoarding-services"});function g(e,t,n){var r;window.open(null==n||null===(r=n.fullImage)||void 0===r?void 0:r[0],"_blank")}const h=t=>{if("OPEN"===t.state){var n,o;const i={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(o=e.application)||void 0===o?void 0:o.channel)||""};return r.createElement(qe,{data:i})}if(t.state){var i,a,l,s,u;const e={date:null==t||null===(i=t.auditDetails)||void 0===i?void 0:i.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.name,mobileNumber:null==t||null===(s=t.assignes)||void 0===s||null===(u=s[0])||void 0===u?void 0:u.mobileNumber,comment:p(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return r.createElement(qe,{data:e,OpenImage:g})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:p(null==t?void 0:t.comment)};return r.createElement(qe,{data:n})}};return m?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,(null==v||null===(u=v.timeline)||void 0===u?void 0:u.length)>0&&r.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=v&&v.timeline&&1===(null==v||null===(c=v.timeline)||void 0===c?void 0:c.length)?r.createElement(t.CheckPoint,{isCompleted:!0,label:p((null==v||null===(d=v.timeline[0])||void 0===d?void 0:d.state)&&"WF_"+f+"_"+v.timeline[0].state||"NA"),customChild:h(null==v?void 0:v.timeline[0])}):r.createElement(t.ConnectingCheckPoints,null,(null==v?void 0:v.timeline)&&(null==v?void 0:v.timeline.map((e,n)=>{var o;let i="";if(window.location.href.includes("/obps/")){var a,l;const t=null==v||null===(a=v.timeline)||void 0===a||null===(l=a[n-1])||void 0===l?void 0:l.state;i=t&&(t.includes("BACK_FROM")||t.includes("SEND_TO_CITIZEN"))?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===n?"":"_DONE"}return r.createElement(r.Fragment,{key:n},r.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:p("ES_ADS_COMMON_STATUS_"+(null==v||null===(o=v.processInstances[n].state)||void 0===o?void 0:o.state)+i),customChild:h(e)}))}))))};let Ge=[];const Ke=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:a}=o.useTranslation(),l=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":Ge=[];break;default:Ge=["ADS_APPLICANT_DETAILS","ADS_ADDRESS_DETAILS","ADS_UPLOAD_DOCUMENTS","ADS_SUMMARY"]}})(i),r.createElement("div",{className:"timeline-container",style:l?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},Ge.map((e,o,i)=>r.createElement("div",{className:"timeline-checkpoint",key:o},r.createElement("div",{className:"timeline-content"},r.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?r.createElement(t.TickMark,null):o+1),r.createElement("span",{className:"secondary-color"},a(e))),o<i.length-1&&r.createElement("span",{className:"line "+(o<n-1&&"active")}))))},$e=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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"})),Ye=e=>{let{onClick:t}=e;return r.createElement("div",{className:"icon-bg-secondary",onClick:t},r.createElement($e,null))},Xe=()=>{var e,i,a,l,s,u,d,p,f,m,v,g,h,y,E;const[S,b]=n.useState(!1),[D,_]=n.useState(!1),{t:A}=o.useTranslation(),[T,C]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),N=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[x,w]=n.useState(!1),[I,k]=n.useState(!1),L=[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},A("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:A("ADD_TYPE"),accessor:"addType"},{Header:A("FACE_AREA"),accessor:"faceArea"},{Header:A("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,A(t?"Yes":"No"))}},{Header:A("BOOKING_DATE"),accessor:"bookingDate"},{Header:A("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{var t;const n=c({},T);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),C(n)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}];let O={tenantId:N,cartDetails:null==T||null===(e=T.adslist)||void 0===e?void 0:e.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}))},R=Digit.Hooks.ads.useADSDemandEstimation();!1===x&&(R.mutate(O),w(!0));const P=()=>{_(e=>!e)},M=()=>{k(!I)},B=()=>{b(e=>!e)},F=(null===(i=R.data)||void 0===i?void 0:i.demands[0])&&(null===(a=R.data)||void 0===a||null===(l=a.demands[0])||void 0===l?void 0:l.additionalDetails);return r.createElement("div",null,r.createElement(t.CardSubHeader,{style:{color:"#a82227"}},"Cart Details"),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement("div",null,r.createElement("div",{onClick:P,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},r.createElement("div",{class:"container",style:{width:"1px"}}," ",r.createElement("div",{style:{width:"20px",position:"relative"}},r.createElement("div",{style:{position:"absolute",top:"-4px",right:"-93px",color:"#008000",padding:"5px",borderRadius:"30px",width:"30px",height:"30px",textAlign:"center"}},r.createElement("div",null," ",null==T||null===(s=T.adslist)||void 0===s?void 0:s.cartDetails.length)))),"View Cart"),r.createElement("div",{onClick:B,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},"Terms and Conditions")),r.createElement("div",{onClick:M,style:{cursor:"pointer",fontSize:"20px",color:"#a82227"}},"Total Booking Amount: ",r.createElement("strong",null,F," INR"))),S&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Terms and Conditions"),headerBarEnd:r.createElement(Ye,{onClick:B}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"80%",overflowY:"auto"},actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},popupModuleMianStyles:{padding:"10px"},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:S,onClose:B}),D&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(Ye,{onClick:P}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Oe,{t:A,data:null==T||null===(u=T.adslist)||void 0===u?void 0:u.cartDetails,columns:L,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:null==T||null===(d=T.adslist)||void 0===d?void 0:d.cartDetails.length})),I&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:r.createElement(Ye,{onClick:M}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"60%",overflowY:"auto"},children:r.createElement("div",null,r.createElement(t.CardLabelDesc,{style:{marginBottom:"15px"}},"Estimate Price Details"),r.createElement("ul",null,(null===(p=R.data)||void 0===p||null===(f=p.demands[0])||void 0===f?void 0:f.demandDetails)&&(null===(m=R.data)||void 0===m||null===(v=m.demands[0])||void 0===v?void 0:v.demandDetails.map((e,n)=>r.createElement("li",{key:n,style:{display:"flex",justifyContent:"space-between"}},r.createElement(t.CardText,null,A(""+e.taxHeadMasterCode)),r.createElement(t.CardText,null,"Rs ",e.taxAmount))))),r.createElement("hr",null),r.createElement("div",{style:{fontWeight:"bold",marginTop:"10px",display:"flex",justifyContent:"space-between"}},r.createElement(t.CardLabelDesc,null,"Total"),r.createElement(t.CardLabelDesc,null,"Rs ",(null===(g=R.data)||void 0===g||null===(h=g.demands[0])||void 0===h?void 0:h.demandDetails)&&(j=null===(y=R.data)||void 0===y||null===(E=y.demands[0])||void 0===E?void 0:E.demandDetails,j.reduce((e,t)=>e+t.taxAmount,0))))),actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:I,onClose:M}));var j};function Ze(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Je=e=>{let{t:o,SlotSearchData:i,draftId:a=""}=e;const[l,s]=n.useState(0),[u,c]=n.useState(null),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState(!1),m=Digit.Hooks.ads.useADSSlotSearch(),v={advertisementSlotSearchCriteria:i.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,draftId:a,isTimerRequired:!0}))};return n.useEffect(()=>{0!==l||p||(function(){try{const e=Ze(function(){return Promise.resolve(m.mutateAsync(v)).then(function(e){var t;const n=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),r=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;n?c({error:!0,label:o("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):s(r||0)})},function(){c({error:!0,label:o("CS_SOMETHING_WENT_WRONG")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),f(!0))},[o,l,p]),n.useEffect(()=>{if(l>0){const e=setInterval(()=>{s(t=>t<=0?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}},[l]),n.useEffect(()=>{if(u){const e=setTimeout(()=>{c(null)},2e3);return()=>clearTimeout(e)}},[u]),r.createElement("div",null,r.createElement("span",{className:"astericColor"},(e=>{const t=e%60;return Math.floor(e/60)+":"+(t<10?"0":"")+t})(l)),u&&r.createElement(t.Toast,{error:u.error,warning:u.warning,label:o(u.label),onClose:()=>{c(null)}}))};function Qe(e){var o;let{t:i,document:a,setDocuments:l,setError:s,documents:u,action:d,formData:p,id:f}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],v=Digit.UserService.getUser().info,[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(m?c({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:"ADS_"+(null==m?void 0:m.documentType.replaceAll(".","_"))}):(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)>0?null==a?void 0:a.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[D,_]=n.useState(!1),{dropdownData:A}=a;var T=A;const[C,N]=n.useState(!1),x=()=>r.createElement("div",{className:"loading-spinner"});return n.useEffect(()=>{null!=g&&g.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==S?void 0:S.length)||null===S?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==g?void 0:g.code,fileStoreId:S,documentUid:S}]})},[S,g]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],r=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(h(r),b(null==n?void 0:n.fileStoreId)):N(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Ze(function(){return b(null),_(!0),Promise.resolve(Digit.UploadServices.Filestorage("ADS",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){s(i("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(_(!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]),n.useEffect(()=>{C&&b(null)},[C]),r.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i("ADS_"+(null==a?void 0:a.code.replaceAll(".","_")))," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"EMPLOYEE"===v.type?"50%":"100%"},placeholder:"Select "+i("ADS_"+(null==a?void 0:a.code.replaceAll(".","_"))),option:T.map(e=>{var t;return c({},e,{i18nKey:"ADS_"+(null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_"))})}),select:e=>h(e),optionKey:"i18nKey",t:i})):null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{b(null)},id:f,message:D?r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(x,null),r.createElement("span",null,"Uploading...")):S?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function et(e){let{value:n={},Code:i,index:a,showFileName:l=!1}=e;o.useTranslation();const{isLoading:s,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},i,a),d=e=>{let{width:t=20,height:n=20,style:o}=e;return r.createElement("svg",{style:o,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},r.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))},p=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===i).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===i).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")}));return s?r.createElement(t.Loader,null):r.createElement("div",null,r.createElement(r.Fragment,null,r.createElement("div",null,p.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let r=e[t]||"",o=(null==r?void 0:r.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i}(u.pdfFiles,e.fileStoreId);return r.createElement("a",{target:"_",href:n,style:{minWidth:"160px"},key:t},r.createElement(d,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}))}))))}const tt=e=>{let{jumpTo:n}=e;const{t:a}=o.useTranslation(),l=i.useHistory();return r.createElement(t.LinkButton,{label:a("CS_COMMON_EDIT"),className:"check-page-link-button",onClick:function(){l.push(n)}})},nt=()=>{const{t:e}=o.useTranslation(),{data:i,isFetching:a,isSuccess:l}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"ADS",filters:{limit:10,offset:0,services:["ads"]},config:{select:e=>({tSotalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptAccess()}});n.useEffect(()=>{!a&&l&&u(i)},[a]);const[s,u]=n.useState("-");if(!Digit.Utils.adsAccess())return null;const c=[{label:e("ADS_BOOK"),link:"/digit-ui/employee/ads/bookad/searchads"},{label:e("ADS_SEARCH_BOOKINGS"),link:"/digit-ui/employee/ads/my-applications"}],d=Digit.UserService.hasAccess(["ADS_CEMP"])||!1,p={Icon:r.createElement(Ue,null),moduleName:e("ADS_ADVERTISEMENT_MODULE"),links:c.filter(e=>!(null!=e&&e.role)||d)};return r.createElement(t.EmployeeModuleCard,p)},rt=e=>{let{value:o,onChange:i,onBlur:a,t:l}=e;const[s,u]=n.useState(!1),[c,d]=n.useState("");return n.useEffect(()=>{d(o?"string"==typeof o?o:o.formattedAddress||(o.latitude&&o.longitude?o.latitude+", "+o.longitude:""):"")},[o]),r.createElement(n.Fragment,null,r.createElement("div",{style:{display:"flex",gap:8}},r.createElement(t.TextInput,{value:c,onChange:()=>{},onBlur:a,disabled:!0,placeholder:l?l("See location on map"):"See location on map"}),r.createElement("div",null,r.createElement("button",{type:"button",onClick:()=>u(!0),style:{padding:"8px 10px",background:"#0b74de",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:700,fontSize:10}},r.createElement("span",{style:{display:"inline-block",color:"#fff",textTransform:"none"}},l&&(l("VIEW_LOCATION_ON_MAP")||"View location on map")||"View location on map")))),s&&r.createElement(We,{t:l,formData:{address:{pincode:(null==o?void 0:o.pincode)||"",geoLocation:o||{}}},handleRemove:()=>u(!1),onSave:(e,t,n)=>((e,t,n)=>{const r=((e,t,n)=>{var r,o,i,a,l,s;return{formattedAddress:n||(null==e?void 0:e.formattedAddress)||(null==e?void 0:e.place_name)||"",latitude:null!=(r=null!=(o=null!=(i=null==e?void 0:e.latitude)?i:null==e?void 0:e.lat)?o:null==e?void 0:e.y)?r:null,longitude:null!=(a=null!=(l=null!=(s=null==e?void 0:e.longitude)?s:null==e?void 0:e.lng)?l:null==e?void 0:e.x)?a:null,placeId:(null==e?void 0:e.placeId)||(null==e?void 0:e.id)||null,raw:e||{},pincode:t||null}})(e,t,n);d(r.formattedAddress),i&&i(r),u(!1)})(e,t,n)}))},ot=e=>{let{t:n,currentPage:o,columns:i,data:a,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:f,sortParams:m,totalRecords:v}=e;return r.createElement(t.Table,{t:n,data:a,currentPage:o,columns:i,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:s,onPageSizeChange:p,onSort:u,sortParams:m,totalRecords:v})},it=e=>{const{t:a}=o.useTranslation(),l=[{text:a("ES_TITLE_NEW_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad",roles:[]},{text:a("ADS_MY_APPLICATION"),link:"/digit-ui/employee/ads/my-applications",roles:[]}],[s,u]=n.useState([]);return Digit.UserService.getUser(),n.useEffect(()=>{u(l)},[]),r.createElement(t.Card,{className:"employeeCard filter inboxLinks"},r.createElement("div",{className:"complaint-links-container"},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.PropertyHouse,null))," ",r.createElement("span",{className:"text"},a("ADS_SERVICE"))),r.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:o,hyperlink:l=!1,roles:s=[]}=e;return r.createElement("span",{className:"link",key:t},l?r.createElement("a",{href:n},o):r.createElement(i.Link,{to:n},a(o)))}))))},at=["pattern","name","maxLength","minLength","errorMessages"],lt={date:t.DatePicker,mobileNumber:t.MobileNumber,Locality:e=>r.createElement(t.Localities,{tenantId:Digit.ULBService.getCurrentTenantId(),selectLocality:e.onChange,keepNull:!1,boundaryType:"revenue",selected:e.value,disableLoader:!0,sortFn:(e,t)=>e.i18nkey<t.i18nkey?-1:1})},st=e=>{var i;let{onSearch:l,type:s,onClose:u,searchFields:p,searchParams:f,isInboxPage:m,clearSearch:v}=e;const{t:g}=o.useTranslation(),{handleSubmit:h,reset:y,watch:E,control:S,setError:b,clearErrors:D,formState:_,setValue:A}=a.useForm({defaultValues:m?f:c({locality:null,city:null},f)}),T=E(),C=innerWidth<=640;function N(){const e=p.reduce((e,t)=>c({},e,{[null==t?void 0:t.name]:""}),{});if(y(e),m){const e=c({},f);e.delete=[],p.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),l(c({},e))}else v()}n.useEffect(()=>{p.forEach(e=>{let{pattern:t,name:n,maxLength:r,minLength:o,errorMessages:i}=e;d(e,at);const a=T[n],l=_.errors[n];t&&(new RegExp(t).test(a)||l?new RegExp(t).test(a)&&"pattern"===(null==l?void 0:l.type)&&D([n]):b(n,{type:"pattern",message:g(null==i?void 0:i.pattern)||g("PATTERN_"+n.toUpperCase()+"_FAILED")})),o&&((null==a?void 0:a.length)<o&&!l?b(n,{type:"minLength",message:g((null==i?void 0:i.minLength)||"MINLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==a?void 0:a.length)>=o&&"minLength"===(null==l?void 0:l.type)&&D([n])),r&&((null==a?void 0:a.length)>r&&!l?b(n,{type:"maxLength",message:g((null==i?void 0:i.maxLength)||"MAXLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==a?void 0:a.length)<=r&&"maxLength"===(null==l?void 0:l.type)&&D([n]))})},[T,_,b,D]);const x=e=>r.createElement(t.LinkLabel,{style:c({display:"inline"},e?{margin:0}:{}),onClick:N},g("ES_COMMON_CLEAR_SEARCH"));return r.createElement("form",{onSubmit:h(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],p.forEach(t=>{e[t.name]||e.delete.push(t.name)}),l(e),"mobile"===s&&u()})},r.createElement(r.Fragment,null,r.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:m?"24px":"revert"}},r.createElement("div",{className:"search-complaint-container"},("mobile"===s||C)&&r.createElement("div",{className:"complaint-header"},r.createElement("h2",null,g("ES_COMMON_SEARCH_BY")),r.createElement("span",{onClick:u},r.createElement(t.CloseSvg,null))),r.createElement("div",{className:"complaint-input-container for-pt "+(m?"":"for-search"),style:{width:"100%",display:"grid"}},null==p||null===(i=p.filter(e=>!0))||void 0===i?void 0:i.map((e,n)=>{var o,i,l;return r.createElement("div",{key:e.name,className:"input-fields"},r.createElement("span",{className:"mobile-input"},r.createElement(t.Label,null,g(e.label)+" "+(e.isMendatory?"*":"")),r.createElement(a.Controller,e.type?{render:t=>r.createElement(null==lt?void 0:lt[e.type],{formValue:T,setValue:A,onChange:t.onChange,value:t.value}),name:e.name,control:S,defaultValue:""}:{render:e=>r.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:S,defaultValue:""})),null!=_&&null!==(o=_.dirtyFields)&&void 0!==o&&o[e.name]?r.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==_||null===(i=_.errors)||void 0===i||null===(l=i[e.name])||void 0===l?void 0:l.message):null)}),m&&r.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},r.createElement("div",null,x())),"desktop"===s&&!C&&r.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},r.createElement(t.SubmitBar,{className:"submit-bar-search",label:g("ES_COMMON_SEARCH"),disabled:!!Object.keys(_.errors).length||(()=>{var e;let t=!0;return Object.keys(T).forEach(e=>{!["locality","city"].includes(e)&&T[e]&&(t=!1)}),null==p||!p.find(e=>"locality"===e.name)||null!=T&&null!==(e=T.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!m&&r.createElement("div",null,x()))))),("mobile"===s||C)&&r.createElement(t.ActionBar,{className:"clear-search-container"},r.createElement("button",{className:"clear-search",style:{flex:1}},x(C)),r.createElement(t.SubmitBar,{disabled:!!Object.keys(_.errors).length,label:g("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},ut=["tableConfig","filterComponent"],ct=e=>{let{tableConfig:i,filterComponent:a}=e,l=d(e,ut);const{data:s,useNewInboxAPI:u}=l,{t:c}=o.useTranslation(),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(l.EmptyResultInboxComp)});console.log("props :>> ",l);const[g,h]=n.useState(!1),y=r.useMemo(()=>l.isSearch?i.searchColumns(l):i.inboxColumns(l)||[],[]);let E;return console.log("data is :>> ",s),l.isLoading?E=r.createElement(t.Loader,null):g?E=null:!s||0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?E=m&&r.createElement(m,{data:s})||(0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?r.createElement(t.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):r.createElement(t.Loader,null)):(null==s?void 0:s.length)>0&&(E=r.createElement(ot,{t:c,data:s,columns:y,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:l.onPageSizeChange,currentPage:l.currentPage,onNextPage:l.onNextPage,onPrevPage:l.onPrevPage,pageSizeLimit:l.pageSizeLimit,onSort:l.onSort,disableSort:l.disableSort,sortParams:l.sortParams,totalRecords:l.totalRecords})),r.createElement("div",{className:"inbox-container"},!l.isSearch&&r.createElement("div",{className:"filters-container"},r.createElement(it,{parentRoute:l.parentRoute,businessService:l.moduleCode}),r.createElement("div",null,r.createElement(p,{defaultSearchParams:l.defaultSearchParams,onFilterChange:l.onFilterChange,searchParams:l.searchParams,type:"desktop",useNewInboxAPI:u,statusMap:u?null==s?void 0:s[0].statusMap:null,moduleCode:l.moduleCode}))),r.createElement("div",{style:{flex:1}},r.createElement(st,{defaultSearchParams:l.defaultSearchParams,onSearch:e=>{l.onSearch(e),h(!1)},type:"desktop",searchFields:l.searchFields,isInboxPage:!(null!=l&&l.isSearch),searchParams:l.searchParams,clearSearch:()=>h(!0)}),r.createElement("div",{className:"result",style:{marginLeft:null!=l&&l.isSearch?"":"24px",flex:1}},E)))},dt=e=>{const{t:i}=o.useTranslation(),[a,l]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}});function s(){}return r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading"},r.createElement("div",{className:"filter-label"},i("SORT_BY"),":"),r.createElement("div",{className:"clearAll",onClick:s},i("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&r.createElement("span",{className:"clear-search",onClick:s},i("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&r.createElement("span",{onClick:e.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}]})))))},pt=e=>{let{t:o,data:i,onFilterChange:a,onSearch:l,onSort:s,serviceRequestIdKey:u,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:f,searchFields:m,sortParams:v,linkPrefix:g,filterComponent:h}=e;const[y,E]=n.useState(p?"SEARCH":""),[S,b]=n.useState(!!p),[D,_]=n.useState(v),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(h)});n.useEffect(()=>{y&&b(!0)},[y]);const T=()=>{b(!1),E(""),_(v)};if(d)return r.createElement(t.Loader,null);let C;return i&&0!==(null==i?void 0:i.length)?i&&(null==i?void 0:i.length)>0&&(C=r.createElement(t.DetailsCard,{data:i,serviceRequestIdKey:u,linkPrefix:g||"/digit-ui/employee/ptr/"})):C=r.createElement(t.Card,{style:{marginTop:20}},o("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))),r.createElement(r.Fragment,null,r.createElement("div",{className:"searchBox"},l&&r.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{E("SEARCH"),b(!0)}}),!p&&a&&r.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{E("FILTER"),b(!0)}}),r.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{E("SORT"),b(!0)}})),C,S&&r.createElement(t.PopUp,null,"FILTER"===y&&r.createElement("div",{className:"popup-module"},r.createElement(A,{onFilterChange:e=>{a(e),b(!1)},Close:T,type:"mobile",searchParams:f})),"SORT"===y&&r.createElement("div",{className:"popup-module"},r.createElement(dt,{type:"mobile",sortParams:v,onClose:T,onSort:s})),"SEARCH"===y&&r.createElement("div",{className:"popup-module"},r.createElement(st,{type:"mobile",onClose:T,onSearch:l,isFstpOperator:c,searchParams:f,searchFields:m}))))},ft=e=>{let{linkPrefix:a,classNameForMobileView:l=""}=e;const{t:s}=o.useTranslation(),u=[{text:s("ES_TITLE_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad"},{text:s("ES_TITILE_SEARCH_APPLICATION"),link:a+"/my-applications"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),r.createElement(t.Card,{className:"employeeCard filter"},r.createElement("div",{className:"complaint-links-container "+l},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.ShippingTruck,null))," ",r.createElement("span",{className:"text"},s("ES_TITLE_ADD_BOOKING"))),r.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:o}=e;return r.createElement("span",{className:"link",key:t},r.createElement(i.Link,{to:n},o))}))))},mt=e=>{let{data:t,isLoading:n,isSearch:i,searchFields:a,onFilterChange:l,onSearch:s,onSort:u,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:f,tableConfig:m,filterComponent:v}=e;const{t:g}=o.useTranslation();return r.createElement("div",{style:{padding:0}},r.createElement("div",{className:"inbox-container"},r.createElement("div",{className:"filters-container"},!i&&r.createElement(ft,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),r.createElement(pt,{t:g,data:null==t?void 0:t.map(e=>{const t={};return(i?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:l,isLoading:n,isSearch:i,onSearch:s,onSort:u,searchParams:d,searchFields:a,linkPrefix:f,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:v}))))},vt=["isFetching","isLoading","searchResponseKey","data","searchFields"],gt=e=>{var i,a,l,s,u;let{useNewInboxAPI:p,parentRoute:f,moduleCode:m="ADV",initialStates:v={},filterComponent:g,isInbox:h,rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:D,middlewaresWf:_,middlewareSearch:A,EmptyResultInboxComp:T}=e;const C=Digit.ULBService.getCurrentTenantId();console.log("here");const{t:N}=o.useTranslation(),[x,w]=n.useState(()=>h?{}:{enabled:!1}),[I,k]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("ADSInboxTableConfig")}),[L,O]=n.useState(v.pageOffset||0),[R,P]=n.useState(v.pageSize||10),[M,B]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[F,j]=n.useState(v.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),U=H?{limit:100,offset:0,sortBy:null==M||null===(i=M[0])||void 0===i?void 0:i.id,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:R,offset:L,sortBy:null==M||null===(l=M[0])||void 0===l?void 0:l.id,sortOrder:null!=M&&null!==(s=M[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const z=p?Digit.Hooks.useNewInboxGeneral({tenantId:C,ModuleCode:m,filters:c({},F,U,{sortParams:M},F.wfFilters||{})}):Digit.Hooks.useInboxGeneral({tenantId:C,businessService:m,isInbox:h,filters:c({},F,U,{sortParams:M},F.wfFilters||{}),rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:c({},x,D),middlewaresWf:_,middlewareSearch:A}),{isLoading:q,data:W,searchFields:V}=z,G=d(z,vt);n.useEffect(()=>{O(0)},[F]);const K=e=>{let t=e.delete,n=c({},F,e);t&&t.forEach(e=>delete n[e]),delete e.delete,j(c({},n)),w({enabled:!0})},$=n.useCallback(e=>{0!==e.length&&B(e)},[]);var Y;if(null!==(null==G||null===(u=G.data)||void 0===u?void 0:u.length))return H?r.createElement(mt,{data:W,isLoading:q,isSearch:!h,searchFields:V,onFilterChange:K,onSearch:K,onSort:$,parentRoute:f,searchParams:F,sortParams:M,linkPrefix:f+"/application-details/",tableConfig:null!=G&&G.tableConfig?null==G?void 0:G.tableConfig:I(N).ADS,filterComponent:g,EmptyResultInboxComp:T,useNewInboxAPI:p}):r.createElement("div",null,h&&r.createElement(t.Header,null,N("ES_COMMON_INBOX")),r.createElement(ct,{moduleCode:m,data:W,tableConfig:I(N).ADS,isLoading:q,defaultSearchParams:v.searchParams,isSearch:!h,onFilterChange:K,searchFields:V,onSearch:K,onSort:$,onNextPage:()=>{O(e=>e+R)},onPrevPage:()=>{O(e=>e-R)},currentPage:Math.floor(L/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{P(Number(e.target.value))},parentRoute:f,searchParams:F,sortParams:M,totalRecords:Number(null==W||null===(Y=W[0])||void 0===Y?void 0:Y.totalCount),filterComponent:g,EmptyResultInboxComp:T,useNewInboxAPI:p}))},ht=e=>{var n,a,l,s,u,d,p,f,m,v,g,h;let{path:y,userType:S}=e;o.useTranslation();const b=i.useLocation();sessionStorage.removeItem("revalidateddone"),window.Digit.Utils.browser.isMobile();const D=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("NewADSStepperForm"),_=(null===(l=Digit)||void 0===l||null===(s=l.ComponentRegistryService)||void 0===s||s.getComponent("NewSiteMasterStepperForm"),null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewSiteInspectionStepperForm")),A=(null===(p=Digit)||void 0===p||null===(f=p.ComponentRegistryService)||void 0===f||f.getComponent("ApplicationOverview"),null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("ADSResponseCitizen")),T=null===(g=Digit)||void 0===g||null===(h=g.ComponentRegistryService)||void 0===h?void 0:h.getComponent("ApplicationDetails"),C=window.location.href.includes("ads/response"),N=window.location.href.includes("searchad")||window.location.href.includes("modify-application")||window.location.href.includes("ads/application-details"),x={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ADV"],applicationStatus:[],locality:[]}};return r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,r.createElement(r.Fragment,null,r.createElement("div",{className:"ground-container"},C?null:r.createElement("div",{style:N?{marginLeft:"12px",display:"flex",alignItems:"center"}:{marginLeft:"-4px",display:"flex",alignItems:"center"}},r.createElement(t.BackButton,{location:b})),r.createElement(t.PrivateRoute,{path:y+"/bookad",component:e=>r.createElement(D,c({},e,{userType:S}))}),r.createElement(t.PrivateRoute,{path:y+"/my-applications",component:e=>r.createElement(E,c({},e,{userType:"employee",parentRoute:y}))}),r.createElement(t.PrivateRoute,{path:y+"/applicationsearch/application-details/:id",component:()=>r.createElement(T,{parentRoute:y})}),r.createElement(t.PrivateRoute,{path:y+"/adsservice/:response/:bookingNo",component:A}),r.createElement(t.PrivateRoute,{path:y+"/site-inspection-details",component:_}),r.createElement(t.PrivateRoute,{path:y+"/inbox",component:()=>r.createElement(gt,{useNewInboxAPI:!0,parentRoute:y,businessService:"ADV",filterComponent:"ADS_INBOX_FILTER",initialStates:x,isInbox:!0})}),r.createElement(t.PrivateRoute,{path:y+"/searchold",component:()=>r.createElement(gt,{parentRoute:y,businessService:"ads",middlewareSearch:searchMW,initialStates:x,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})})))))},yt=e=>{var a;let{application:l,tenantId:s,buttonLabel:u}=e;console.log("application :>> ",l);const{t:c}=o.useTranslation(),d=i.useHistory(),[p,f]=n.useState(null);return Digit.Hooks.ads.useADSSlotSearch(),null==l||l.cartDetails.map(e=>({bookingId:null==l?void 0:l.bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:s,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0})),n.useEffect(()=>{if(p){const e=setTimeout(()=>{f(null)},2e3);return()=>clearTimeout(e)}},[p]),console.log("56565application :>> ",l),r.createElement(t.Card,null,r.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_NO"),note:null==l?void 0:l.bookingNo}),r.createElement(t.KeyNote,{keyValue:c("ADS_APPLICANT_NAME"),note:null==l||null===(a=l.applicantDetail)||void 0===a?void 0:a.applicantName}),r.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_START_DATE"),note:(e=>{var t,n;if(!e||0===e.length)return c("CS_NA");const r=null===(t=e[0])||void 0===t?void 0:t.bookingDate,o=null===(n=e[e.length-1])||void 0===n?void 0:n.bookingDate;return r===o?r:r&&o?r+" - "+o:c("CS_NA")})(null==l?void 0:l.cartDetails)}),r.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==l?void 0:l.bookingStatus))}),r.createElement("div",null,r.createElement(i.Link,{to:"/digit-ui/citizen/ads/application/"+(null==l?void 0:l.bookingNo)+"/"+(null==l?void 0:l.tenantId)},r.createElement(t.SubmitBar,{label:u})),("BOOKING_CREATED"===l.bookingStatus||"/mybookingsPAYMENT_FAILED"===l.bookingStatus||"PENDING_FOR_PAYMENT"===l.bookingStatus)&&r.createElement(t.SubmitBar,{label:c("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{d.push("/digit-ui/citizen/payment/collect/adv-services/"+(null==l?void 0:l.bookingNo)+"/"+s+"?tenantId="+s)},style:{margin:"20px"}})),p&&r.createElement(t.Toast,{error:p.error,warning:p.warning,label:c(p.label),onClose:()=>{f(null)}}))},Et=e=>r.createElement("h1",{className:"heading-m"},e.label),St=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),bt=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(St,null)),Dt=e=>{var o,i,a;let{t:l,action:s,tenantId:u,closeModal:d,submitAction:p,applicationData:f,businessService:m,workflowActions:v,showToast:g,closeToast:h,errors:y}=e;const[E,S]=n.useState({}),[b,D]=n.useState({}),[_,A]=n.useState([]),[T,C]=n.useState({}),[N,x]=n.useState(null),[w,I]=n.useState(null),[k,L]=n.useState(null),[O,R]=n.useState([]),[P,M]=n.useState(null),B=new Set(["SUBMIT","INITIATE","PAY"]),F=(null==s?void 0:s.fromStateCode)||(null==s||null===(o=s._rawStateObj)||void 0===o?void 0:o.state)||null,j=(null==s?void 0:s.toStateCode)||null,H=(null==s?void 0:s.status)||(B.has(null==s?void 0:s.action)?j||F||(null==s?void 0:s.nextState):F||j||(null==s?void 0:s.nextState)),{data:U}=Digit.Hooks.useEmployeeSearch(u,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:z}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'ADV')]"}]}]}});n.useEffect(()=>{var e;z&&z["egf-master"]&&R(null===(e=z["egf-master"])||void 0===e?void 0:e.FinancialYear)},[z]);const{data:q}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function W(e){x(e.target.files[0])}return n.useEffect(()=>{if(U&&q){var e;const t=q["common-masters"].Department;A(null==U||null===(e=U.Employees)||void 0===e?void 0:e.map(e=>{var n,r,o;const i=null==e||null===(n=e.assignments)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===i);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[U]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)L(l("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ze(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):L(l("CS_FILE_UPLOAD_ERROR"))})},function(){L(l("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(()=>{v&&v.length>0&&v.find(e=>e.action===(null==s?void 0:s.action))},[v,s]),n.useEffect(()=>{s&&S((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:l,selectFile:s,uploadedFile:u,setUploadedFile:c}=e,d=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(d=!1),o.isTerminateState&&(d=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:""+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:d?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:d?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:d?r.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:l,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:r.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:l,action:s,approvers:_,selectedApprover:T,setSelectedApprover:C,selectFile:W,uploadedFile:w,setUploadedFile:I,businessService:m}))},[s,_,O,P,w]),s&&E.form?r.createElement(t.Modal,{headerBarMain:r.createElement(Et,{label:l(E.label.heading)}),headerBarEnd:r.createElement(bt,{onClick:d}),actionCancelLabel:l(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:l(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},r.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){f=c({},f,{action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,status:H,wfDocuments:w?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:w}]:null}),p({Licenses:[f]})},defaultValues:b,formId:"modal-action"}),g&&r.createElement(t.Toast,{error:"error"===g.key,label:y,onClose:h})):r.createElement(t.Loader,null)};var _t,At=Array.isArray,Tt="object"==typeof T&&T&&T.Object===Object&&T,Ct="object"==typeof self&&self&&self.Object===Object&&self,Nt=Tt||Ct||Function("return this")(),xt=Nt.Symbol,wt=Object.prototype,It=wt.hasOwnProperty,kt=wt.toString,Lt=xt?xt.toStringTag:void 0,Ot=Object.prototype.toString,Rt=xt?xt.toStringTag:void 0,Pt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Rt&&Rt in Object(e)?function(e){var t=It.call(e,Lt),n=e[Lt];try{e[Lt]=void 0;var r=!0}catch(e){}var o=kt.call(e);return r&&(t?e[Lt]=n:delete e[Lt]),o}(e):function(e){return Ot.call(e)}(e)},Mt=function(e){return null!=e&&"object"==typeof e},Bt=function(e){return"symbol"==typeof e||Mt(e)&&"[object Symbol]"==Pt(e)},Ft=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jt=/^\w*$/,Ht=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ut=Nt["__core-js_shared__"],zt=(_t=/[^.]+$/.exec(Ut&&Ut.keys&&Ut.keys.IE_PROTO||""))?"Symbol(src)_1."+_t:"",qt=Function.prototype.toString,Wt=function(e){if(null!=e){try{return qt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Vt=/^\[object .+?Constructor\]$/,Gt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ht(e)||(t=e,zt&&zt in t))&&(function(e){if(!Ht(e))return!1;var t=Pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?Gt:Vt).test(Wt(e));var t}(n)?n:void 0},$t=Kt(Object,"create"),Yt=Object.prototype.hasOwnProperty,Xt=Object.prototype.hasOwnProperty;function Zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zt.prototype.clear=function(){this.__data__=$t?$t(null):{},this.size=0},Zt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zt.prototype.get=function(e){var t=this.__data__;if($t){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Yt.call(t,e)?t[e]:void 0},Zt.prototype.has=function(e){var t=this.__data__;return $t?void 0!==t[e]:Xt.call(t,e)},Zt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$t&&void 0===t?"__lodash_hash_undefined__":t,this};var Jt=Zt,Qt=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(o=t)||r!=r&&o!=o)return n;var r,o;return-1},en=Array.prototype.splice;function tn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tn.prototype.clear=function(){this.__data__=[],this.size=0},tn.prototype.delete=function(e){var t=this.__data__,n=Qt(t,e);return!(n<0||(n==t.length-1?t.pop():en.call(t,n,1),--this.size,0))},tn.prototype.get=function(e){var t=this.__data__,n=Qt(t,e);return n<0?void 0:t[n][1]},tn.prototype.has=function(e){return Qt(this.__data__,e)>-1},tn.prototype.set=function(e,t){var n=this.__data__,r=Qt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var nn=tn,rn=Kt(Nt,"Map"),on=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function an(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}an.prototype.clear=function(){this.size=0,this.__data__={hash:new Jt,map:new(rn||nn),string:new Jt}},an.prototype.delete=function(e){var t=on(this,e).delete(e);return this.size-=t?1:0,t},an.prototype.get=function(e){return on(this,e).get(e)},an.prototype.has=function(e){return on(this,e).has(e)},an.prototype.set=function(e,t){var n=on(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var ln=an;function sn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(sn.Cache||ln),n}sn.Cache=ln;var un,cn,dn,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/\\(\\)?/g,mn=(un=sn(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pn,function(e,n,r,o){t.push(r?o.replace(fn,"$1"):n||e)}),t},function(e){return 500===cn.size&&cn.clear(),e}),cn=un.cache,un),vn=xt?xt.prototype:void 0,gn=vn?vn.toString:void 0,hn=function(e){if("string"==typeof e||Bt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},yn=function(e,t,n){var r=null==e?void 0:function(e,t){for(var n=0,r=(t=function(e,t){return At(e)?e:function(e,t){if(At(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Bt(e))||jt.test(e)||!Ft.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:mn(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(At(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,e)+"";if(Bt(t))return gn?gn.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<r;)e=e[hn(t[n++])];return n&&n==r?e:void 0}(e,t);return void 0===r?n:r};!function(){try{Kt(Object,"defineProperty")({},"",{})}catch(e){}}(),dn=function(){return arguments}(),Mt(dn)&&Pt(dn);var En=function(){return!1},Sn=(C(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?Nt.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||En}),C(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n&&Tt.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),C(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?Nt.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=i?i(n):new e.constructor(n);return e.copy(r),r}}),Kt(Nt,"DataView")),bn=Kt(Nt,"Promise"),Dn=Kt(Nt,"Set"),_n=Kt(Nt,"WeakMap"),An=Wt(Sn),Tn=Wt(rn),Cn=Wt(bn),Nn=Wt(Dn),xn=Wt(_n),wn=Pt;(Sn&&"[object DataView]"!=wn(new Sn(new ArrayBuffer(1)))||rn&&"[object Map]"!=wn(new rn)||bn&&"[object Promise]"!=wn(bn.resolve())||Dn&&"[object Set]"!=wn(new Dn)||_n&&"[object WeakMap]"!=wn(new _n))&&(wn=function(e){var t=Pt(e),n="[object Object]"==t?e.constructor:void 0,r=n?Wt(n):"";if(r)switch(r){case An:return"[object DataView]";case Tn:return"[object Map]";case Cn:return"[object Promise]";case Nn:return"[object Set]";case xn:return"[object WeakMap]"}return t});const In=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),l=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},s={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},u={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),i.length);return r.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},r.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return r.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},r.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:r.createElement("div",{className:"step-number",style:u}),r.createElement("div",{className:"step-label",style:s},a(i[t].stepLabel))),r.createElement("div",{className:"step-circle",style:l(t+1)},t+1,t<d-1&&r.createElement("div",{style:c})));var o})),r.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},kn=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const l=t.filter(e=>e.isStepEnabled),{t:s}=o.useTranslation();function u(){i<l.length?d():i===l.length&&n()}function c(){i>1&&p()}const d=()=>a(i+1),p=()=>a(i-1);return r.createElement(In,{currentStep:i,nextStep:d,prevStep:p,stepsList:l},(()=>{var e,t;const n=l[i-1],{component:o,key:a,texts:d,currStepConfig:p}=n,f=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return r.createElement(r.Fragment,null,r.createElement(f,{config:{key:a,texts:d,component:o,currStepNumber:i,currStepConfig:p},onGoNext:u,onBackClick:c,t:s}))})())},Ln=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInCitizen:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:"penalty"}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],On=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Rn=(e,t)=>({type:"UPDATE_ADSNewApplication_FORM",payload:{key:e,value:t}}),Pn=e=>({type:"SET_ADSNewApplication_STEP",payload:e}),Mn=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_TITILE_APPLICANT_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}]),Bn=[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_APPLICANT_DETAILA",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}],Fn=e=>{var o,i,l,u;let{t:c,goNext:d,currentStepData:p,onGoBack:f,onChange:m=(()=>{})}=e;const v="ads_form_"+("undefined"!=typeof window&&(null===(o=window.location)||void 0===o||null===(i=o.pathname)||void 0===i?void 0:i.includes("/employee"))?"employee":"citizen"),g=s.useDispatch(),h=Digit.UserService.getUser(),{mobileNumber:y,emailId:E,name:S}=null==h?void 0:h.info,b=window.location.href.includes("citizen"),[D,_]=[(S||"").trim().split(" ").slice(0,-1).join(" "),(S||"").trim().split(" ").slice(-1).join(" ")],[A,T]=n.useState(null),{control:C,handleSubmit:N,setValue:x,reset:w,getValues:I,formState:{errors:k},trigger:L}=a.useForm({mode:"onChange",defaultValues:{firstName:b&&D||"",lastName:b&&_||"",emailId:b&&E||"",mobileNumber:b&&y||"",address:"",pincode:""}});"undefined"!=typeof window&&(window.__ADS_FORM_DRAFT=window.__ADS_FORM_DRAFT||{}),n.useEffect(()=>{const e=null==p?void 0:p.ownerDetails;if(!e)return;const t=I("address"),n=e.address;JSON.stringify(t)!==JSON.stringify(n)&&(Object.entries(e).forEach(e=>{let[t,n]=e;"address"!==t&&"addressdetails"!==t&&x(t,n)}),n&&x("address",n))},[p,x,I]),n.useEffect(()=>{try{var e;const t=null===(e=window.__ADS_FORM_DRAFT)||void 0===e?void 0:e[v];if(t&&"object"==typeof t)return w(t),void console.info("[ADS] rehydrated form from in-memory draft")}catch(e){console.warn("[ADS] failed to rehydrate from in-memory",e)}},[]);const O=a.useWatch({control:C});n.useEffect(()=>{const e=setTimeout(()=>{try{JSON.stringify(O).length<307200?window.__ADS_FORM_DRAFT[v]=O:console.warn("[ADS] draft too large, skipping in-memory persist")}catch(e){console.warn("[ADS] failed to persist form to in-memory",e)}},250);return()=>clearTimeout(e)},[O,v]);const R={marginTop:"-18px",color:"red"};return r.createElement("form",{onSubmit:N(function(e){try{var t,n,r,o,i,a,l,s,u,c,f,m,h;try{window.__ADS_FORM_DRAFT&&delete window.__ADS_FORM_DRAFT[v]}catch(e){}const y=(null==p||null===(t=p.pets)||void 0===t?void 0:t.cartDetails)||(null==p?void 0:p.cartDetails)||(null==p||null===(n=p.siteDetails)||void 0===n?void 0:n.cartDetails)||(null==p?void 0:p.siteDetails)||[],E=null!=(r=null!=(o=null==p||null===(i=p.pets)||void 0===i?void 0:i.bookingFromTime)?o:null==p?void 0:p.bookingFromTime)?r:"",S=null!=(a=null!=(l=null==p||null===(s=p.pets)||void 0===s?void 0:s.bookingToTime)?l:null==p?void 0:p.bookingToTime)?a:"",b=null!=(u=null!=(c=null==p||null===(f=p.pets)||void 0===f?void 0:f.cartAddress)?c:null==p?void 0:p.cartAddress)?u:"",A="undefined"!=typeof window&&(null===(m=window.location)||void 0===m||null===(h=m.href)||void 0===h?void 0:h.includes("citizen"))?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),C=Date.now(),N={tenantId:A,applicationDate:C,bookingStatus:"BOOKING_CREATED",businessService:"ADV",address:{pincode:e.pincode||"",addressId:e.address||""},applicantDetail:{applicantName:((e.firstName||"")+" "+(e.lastName||"")).trim(),applicantEmailId:e.emailId||"",applicantMobileNo:e.mobileNumber||"",applicantDetailId:""},owners:[{name:D+" "+_,mobileNumber:e.mobileNumber||"",tenantId:A,type:"CITIZEN"}],additional_details:"sgst, endDate, selfDeclaration",cartDetails:Array.isArray(y)?y:[],bookingFromTime:E,bookingToTime:S,cartAddress:b,documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}},x=Ze(function(){return Promise.resolve(Digit.ADSServices.create({bookingApplication:N},A)).then(function(e){var t;const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;g(Rn("CreatedResponse",t||e)),d(N)}else console.error("ADS create failed (ADSCitizenDetailsNew) - saving draft",e),g(Rn("CreatedResponse",{draft:!0,bookingApplication:N})),T({key:!0,label:"Something Went Wrong!"})})},function(){g(Rn("CreatedResponse",{draft:!0,bookingApplication:N})),T({key:!0,label:"Something Went Wrong!"})});return Promise.resolve(x&&x.then?x.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",null,r.createElement(t.CardLabel,null,c("NDC_FIRST_NAME"),r.createElement("span",{style:{color:"red"}},"*")," "),r.createElement(a.Controller,{control:C,name:"firstName",rules:{required:c("PTR_FIRST_NAME_REQUIRED"),pattern:{value:/^(?=.*[A-Za-z])[A-Za-z\s'-]+$/,message:"Only letters, spaces, apostrophes and hyphens allowed, must include at least one letter"},minLength:{value:2,message:"Minimum 2 characters"},maxLength:{value:100,message:"Maximum 100 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:i,t:c})}}),k.firstName&&r.createElement(t.CardLabelError,{style:R},k.firstName.message),r.createElement(t.CardLabel,null,c("NDC_LAST_NAME"),r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:C,name:"lastName",rules:{required:c("PTR_LAST_NAME_REQUIRED"),pattern:{value:/^(?=.*[A-Za-z])[A-Za-z\s'-]+$/,message:"Only letters, spaces, apostrophes and hyphens allowed, must include at least one letter"},minLength:{value:2,message:"Minimum 2 characters"},maxLength:{value:100,message:"Maximum 100 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:i,t:c})}}),k.lastName&&r.createElement(t.CardLabelError,{style:R},k.lastName.message),r.createElement(t.CardLabel,null,c("NOC_APPLICANT_EMAIL_LABEL"),r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:C,name:"emailId",rules:{required:c("PTR_EMAIL_REQUIRED"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Enter a valid email"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:i,t:c})}}),k.emailId&&r.createElement(t.CardLabelError,{style:R},k.emailId.message),r.createElement(t.CardLabel,null,c("NOC_APPLICANT_MOBILE_NO_LABEL"),r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:C,name:"mobileNumber",rules:{required:c("PTR_MOBILE_REQUIRED"),minLength:{value:10,message:"Enter at least 10 digits"},pattern:{value:/^[6-9]\d{9}$/,message:"Must start with 9, 8, 7, or 6 and be 10 digits long"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.MobileNumber,{value:n,onChange:o,onBlur:i,t:c})}}),k.mobileNumber&&r.createElement(t.CardLabelError,{style:R},k.mobileNumber.message),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("PT_COMMON_COL_ADDRESS")," *"),r.createElement("div",{className:"field"},r.createElement(a.Controller,{control:C,name:"address",rules:{required:c("NDC_MESSAGE_ADDRESS"),pattern:{value:/^[A-Za-z0-9\s.,'/-]+$/,message:c("PTR_ADDRESS_INVALID")},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextArea,{value:n,onChange:e=>o(e.target.value),onBlur:e=>{i(e),L("address")},t:c})}}))),(null==k?void 0:k.address)&&r.createElement(t.CardLabelError,{style:R},null==k||null===(l=k.address)||void 0===l?void 0:l.message),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},""+c("CORE_COMMON_PINCODE")," *"),r.createElement("div",{className:"field"},r.createElement(a.Controller,{control:C,name:"pincode",rules:{required:c("PTR_PINCODE_REQUIRED"),pattern:{value:/^[1-9][0-9]{5}$/,message:c("PTR_PINCODE_INVALID")},minLength:{value:6,message:c("PTR_PINCODE_MIN_LENGTH")},maxLength:{value:6,message:c("PTR_PINCODE_MAX_LENGTH")}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value.replace(/\D/g,"")),onBlur:e=>{i(e),L("pincode")},t:c,maxLength:6})}}))),k.pincode&&r.createElement(t.CardLabelError,{style:R},null==k||null===(u=k.pincode)||void 0===u?void 0:u.message)),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:f}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})),A&&r.createElement(t.Toast,{error:A.key,label:c(A.label),onClose:()=>{T(null)},isDleteBtn:!0}))},jn=e=>{var o;let{goNext:i,currentStepData:l,t:u}=e;const d=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.ads.useADSLocationMDMS(d),{data:f=[],isLoading:m}=Digit.Hooks.ads.useADSAllMDMS(d),[v,g]=n.useState([]),[h,y]=n.useState([]),[E,S]=n.useState(6),[b,D]=n.useState({}),_=s.useDispatch(),[A,T]=n.useState(""),[C,N]=n.useState([]),[x,w]=n.useState({}),[I,k]=n.useState(null),[L,O]=n.useState(null),R=e=>e&&Array.isArray(p)&&p.find(t=>String(t.locationCode)===String(e)||String(t.code)===String(e))||null,[P,M]=n.useState(!1),B=n.useRef(null),F=n.useRef(!1),j=e=>e&&e.geo_tag&&e.geo_tag.latitude&&e.geo_tag.longitude?{formattedAddress:e.name||e.label||"",latitude:e.geo_tag.latitude,longitude:e.geo_tag.longitude,lat:e.geo_tag.latitude,lng:e.geo_tag.longitude,placeId:e.locationCode||e.code||"",raw:e}:null,H=e=>{if(!e)return"";const[t,n]=String(e).split("T");if(!t)return"";const[r,o,i]=t.split("-");return o+"/"+i+"/"+r+(n?" "+n:"")};n.useEffect(()=>S(6),[h]);const U=Array.from(new Map(f.filter(e=>e.locationCode).map(e=>[e.locationCode,{code:e.locationCode,label:e.locationCode}])).values()),z=new Date;z.setMinutes(z.getMinutes()-z.getTimezoneOffset());const q=z.toISOString().slice(11,16),[W,V]=(window.location.href.includes("citizen"),n.useState(0)),G=(e,t)=>{if(e)try{localStorage.setItem("ADS:site:"+e,JSON.stringify(c({},t,{savedAt:Date.now()})))}catch(e){console.warn("ADS persistence failed",e)}},K=e=>{if(!e)return null;try{const t=localStorage.getItem("ADS:site:"+e);return t?JSON.parse(t):null}catch(e){return console.warn("ADS load failed",e),null}},$=(e,t)=>{const n=t||b&&(b[e]||b[String(e)])||{},r=n.startDate||"",o=n.startTime||"",i=n.endDate||"",a=n.endTime||"";if(!(r&&o&&i&&a))return w(t=>{if(!t[e])return t;const n=c({},t);return delete n[e],n}),!0;if(r<Se||i<Se)return w(t=>c({},t,{[e]:"Dates must be from "+Se+" or later."})),!1;const l=new Date(r+"T"+o);return new Date(i+"T"+a)<=l?(w(t=>c({},t,{[e]:"End date/time must be after start date/time."})),!1):(w(t=>{if(!t[e])return t;const n=c({},t);return delete n[e],n}),!0)},Y=()=>{const e=[];try{for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(!n||!n.startsWith("ADS:site:"))continue;const r=n.slice("ADS:site:".length),o=localStorage.getItem(n);if(o)try{const t=JSON.parse(o);e.push(c({siteId:r},t))}catch(e){console.warn("ADS: parse saved site failed for",n,e)}}}catch(e){console.warn("ADS: loadAllSavedSites failed",e)}return e},X=function(e,t){void 0===t&&(t={});try{(Y()||[]).forEach(n=>{if(!n||!n.siteId)return;const r=String(n.siteId),o={mdmsCards:Array.isArray(n.mdmsCards)?n.mdmsCards:n.mdmsCards||[],adsList:Array.isArray(n.adsList)?n.adsList:n.adsList||[],adsScheduleMap:n.adsScheduleMap?c({},n.adsScheduleMap):{},placeNameState:n.placeNameState||"",globalScheduleEnabled:!!e,startDate:n.startDate||"",endDate:n.endDate||"",bookingFromTime:n.bookingFromTime||"",bookingToTime:n.bookingToTime||""};if(e){const{startDate:e="",startTime:n="",endDate:r="",endTime:i=""}=t;(o.mdmsCards||[]).forEach(t=>{var a;const l=null!=(a=t.mdmsId)?a:t.id;l&&(o.adsScheduleMap[l]={startDate:e,startTime:n,endDate:r,endTime:i})})}else{const{startDate:e="",startTime:n="",endDate:r="",endTime:i=""}=t;Object.keys(o.adsScheduleMap||{}).forEach(t=>{const a=o.adsScheduleMap[t]||{};e&&n&&r&&i?a.startDate===e&&a.startTime===n&&a.endDate===r&&a.endTime===i&&delete o.adsScheduleMap[t]:a.startDate||a.startTime||a.endDate||a.endTime||delete o.adsScheduleMap[t]})}try{localStorage.setItem("ADS:site:"+r,JSON.stringify(c({},o,{savedAt:Date.now()})))}catch(e){try{sessionStorage.setItem("ADS:session:"+r,JSON.stringify(c({},o,{savedAt:Date.now()})))}catch(e){console.warn("updateAllSavedSitesForGlobal persist failed for",r,e)}}})}catch(e){console.warn("updateAllSavedSitesForGlobal failed",e)}},Z=e=>{try{const t=c({},e||{},{savedAt:Date.now()});localStorage.setItem("ADS:global",JSON.stringify(t))}catch(e){console.warn("saveGlobal failed",e)}},J=()=>{try{const e=localStorage.getItem("ADS:global");return e?JSON.parse(e):null}catch(e){return null}},Q=()=>{const e=le("startDate")||Se,t=le("endDate")||e,n=le("bookingFromTime")||q,r=le("bookingToTime")||q,o=c({},b||{});(h||[]).forEach(i=>{o[i.id]=c({},o[i.id]||{},{startDate:e,startTime:n,endDate:t,endTime:r})}),D(o)},ee={siteId:"",geoLocation:null,cartAddress:"",size:"",advertisementType:"",startDate:"",endDate:"",bookingFromTime:q,bookingToTime:q,availabilityStatus:"",amount:""},{control:te,handleSubmit:ne,setValue:re,watch:oe,reset:ie,formState:{errors:ae},getValues:le,trigger:se,setError:ue,clearErrors:ce}=a.useForm({defaultValues:ee}),de=n.useCallback(e=>{const t=le("startDate")||"",n=le("endDate")||t||"",r=le("bookingFromTime")||q||"",o=le("bookingToTime")||q||"";if(e)B.current=b||{},D(e=>{const i=c({},e||{});return(h||[]).forEach(e=>{var a;const l=null!=(a=e.mdmsId)?a:e.id;i[l]={startDate:t,startTime:r,endDate:n,endTime:o}}),i}),M(!0),Z({globalScheduleEnabled:!0,startDate:t,endDate:n,bookingFromTime:r,bookingToTime:o}),X(!0,{startDate:t,startTime:r,endDate:n,endTime:o});else{M(!1),D(B.current||{}),B.current=null;const e=J()||{};Z(c({},e,{globalScheduleEnabled:!1})),X(!1,{startDate:t,startTime:r,endDate:n,endTime:o})}try{_(Rn("savedUI",{mdmsCards:v,adsList:C,adsScheduleMap:e?(()=>{const e=c({},b||{});return(h||[]).forEach(i=>{var a;const l=null!=(a=i.mdmsId)?a:i.id;e[l]={startDate:t,startTime:r,endDate:n,endTime:o}}),e})():B.current||b||{},placeNameState:A,globalScheduleEnabled:!!e,startDate:t,endDate:n,bookingFromTime:r,bookingToTime:o,siteId:le("siteId"),geolocation:le("geoLocation")}))}catch(e){console.warn("dispatch update on setGlobalSchedule failed",e)}},[h,b,v,C,A,_,le]);n.useEffect(()=>{const e=null==l?void 0:l.savedUI;var t;if(e)return Array.isArray(e.mdmsCards)&&g(e.mdmsCards),Array.isArray(e.adsList)&&N(e.adsList),e.adsScheduleMap&&D(e.adsScheduleMap),"string"==typeof e.placeNameState&&T(e.placeNameState||""),void 0!==e.globalScheduleEnabled&&(M(!!e.globalScheduleEnabled),e.startDate&&re("startDate",e.startDate,{shouldValidate:!1}),e.endDate&&re("endDate",e.endDate,{shouldValidate:!1}),e.bookingFromTime&&re("bookingFromTime",e.bookingFromTime,{shouldValidate:!1}),e.bookingToTime&&re("bookingToTime",e.bookingToTime,{shouldValidate:!1}),e.globalScheduleEnabled&&Q()),e.siteId&&(re("siteId",e.siteId,{shouldValidate:!1,shouldDirty:!0}),y(f.filter(t=>String(t.locationCode)===String(e.siteId)))),void(e.geoLocation&&(re("geoLocation",e.geoLocation,{shouldValidate:!1,shouldDirty:!0}),T((null===(t=e.geoLocation)||void 0===t?void 0:t.formattedAddress)||"")));const n=J();if(n&&n.globalScheduleEnabled)return M(!0),n.startDate&&re("startDate",n.startDate,{shouldValidate:!1}),n.endDate&&re("endDate",n.endDate,{shouldValidate:!1}),n.bookingFromTime&&re("bookingFromTime",n.bookingFromTime,{shouldValidate:!1}),n.bookingToTime&&re("bookingToTime",n.bookingToTime,{shouldValidate:!1}),void Q();const r=Y();if(r&&r.length){r.sort((e,t)=>(t.savedAt||0)-(e.savedAt||0));const e=r[0];if(e){const t=String(e.siteId||"");re("siteId",t,{shouldValidate:!1,shouldDirty:!0}),V(e=>e+1),y(f.filter(e=>String(e.locationCode)===t)),g(Array.isArray(e.mdmsCards)?e.mdmsCards:[]),N(Array.isArray(e.adsList)?e.adsList:[]),D(e.adsScheduleMap||{}),T(e.placeNameState||""),e.geoLocation&&re("geoLocation",e.geoLocation,{shouldValidate:!1,shouldDirty:!0})}}},[]);const pe=oe("siteId"),fe=n.useCallback(()=>{const e=(null==le?void 0:le("siteId"))||oe&&oe("siteId");try{ie(ee)}catch(e){console.warn("form reset failed",e)}try{g([]),N([]),D({}),T(""),M(!1),B.current=null,V(e=>e+1)}catch(e){console.warn("local state clear failed",e)}try{if(e)try{localStorage.removeItem("ADS:site:"+String(e))}catch(e){}try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith("ADS:site:")&&e.push(n)}e.forEach(e=>localStorage.removeItem(e))}catch(e){}try{localStorage.removeItem("ADS:global")}catch(e){}}catch(e){console.warn("persistence clear failed",e)}try{_(Rn("savedUI",{mdmsCards:[],adsList:[],adsScheduleMap:{},placeNameState:"",globalScheduleEnabled:!1,startDate:"",endDate:"",bookingFromTime:"",bookingToTime:"",siteId:"",geoLocation:null}))}catch(e){console.warn("redux notify failed",e)}try{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}catch(e){}},[ie,_,V,le,oe]);n.useEffect(()=>{const e=()=>{F.current=!0;try{for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&String(t).toUpperCase().startsWith("ADS:")&&localStorage.removeItem(t)}}catch(e){console.warn("clear ADS localStorage failed",e)}try{for(let e=sessionStorage.length-1;e>=0;e--){const t=sessionStorage.key(e);t&&String(t).startsWith("ADS:session:")&&sessionStorage.removeItem(t)}sessionStorage.removeItem("ADS:session:last")}catch(e){console.warn("clear ADS sessionStorage failed",e)}try{_({type:"RESET_ADS_NEW_APPLICATION_FORM"})}catch(e){console.warn("dispatch reset failed",e)}try{fe()}catch(e){console.warn("globalReset threw",e)}},t=t=>{(!t.ctrlKey&&!t.metaKey||"r"!==t.key&&"R"!==t.key&&"KeyR"!==t.code)&&"F5"!==t.code||(t.preventDefault(),e(),setTimeout(()=>{F.current=!1,window.location.reload()},60))},n=()=>{e()};return window.addEventListener("keydown",t,!0),window.addEventListener("beforeunload",n),()=>{window.removeEventListener("keydown",t,!0),window.removeEventListener("beforeunload",n)}},[_,fe]),n.useEffect(()=>{const e=pe;if(!e)return;y(f.filter(t=>String(t.locationCode)===String(e)));const t=J(),n=t&&t.globalScheduleEnabled;n&&(M(!0),t.startDate&&re("startDate",t.startDate,{shouldValidate:!1}),t.endDate&&re("endDate",t.endDate,{shouldValidate:!1}),t.bookingFromTime&&re("bookingFromTime",t.bookingFromTime,{shouldValidate:!1}),t.bookingToTime&&re("bookingToTime",t.bookingToTime,{shouldValidate:!1}),Q());let r=K(String(e));if(!r)try{const t="ADS:session:"+String(e),n="ADS:session:last",o=sessionStorage.getItem(t)||sessionStorage.getItem(n);o&&(r=JSON.parse(o))}catch(e){}if(r){const e=Array.isArray(r.mdmsCards)?r.mdmsCards:[],o=Array.isArray(r.adsList)?r.adsList:[];let i=e;if(n){const n=le("startDate")||t&&t.startDate||"",r=le("bookingFromTime")||t&&t.bookingFromTime||"",o=le("endDate")||t&&t.endDate||"",a=le("bookingToTime")||t&&t.bookingToTime||"";i=e.map(e=>{var t,i,l,s;return c({},e,{schedules:[{startDatetime:n&&r?n+"T"+r:(null===(t=e.schedules)||void 0===t||null===(i=t[0])||void 0===i?void 0:i.startDatetime)||"",endDatetime:o&&a?o+"T"+a:(null===(l=e.schedules)||void 0===l||null===(s=l[0])||void 0===s?void 0:s.endDatetime)||""}]})});const l=c({},b||{});(i||[]).forEach(e=>{var t;const i=null!=(t=e.mdmsId)?t:e.id;l[i]={startDate:n,startTime:r,endDate:o,endTime:a}}),D(e=>c({},e||{},l||{}))}else r.adsScheduleMap&&D(r.adsScheduleMap||{});g(i),N(o),T(r.placeNameState||""),r.startDate&&re("startDate",r.startDate,{shouldValidate:!1}),r.endDate&&re("endDate",r.endDate,{shouldValidate:!1}),r.bookingFromTime&&re("bookingFromTime",r.bookingFromTime,{shouldValidate:!1}),r.bookingToTime&&re("bookingToTime",r.bookingToTime,{shouldValidate:!1}),void 0!==r.globalScheduleEnabled&&(n?(t.startDate&&re("startDate",t.startDate,{shouldValidate:!1}),t.endDate&&re("endDate",t.endDate,{shouldValidate:!1}),t.bookingFromTime&&re("bookingFromTime",t.bookingFromTime,{shouldValidate:!1}),t.bookingToTime&&re("bookingToTime",t.bookingToTime,{shouldValidate:!1}),M(!0),Q()):(M(!!r.globalScheduleEnabled),r.globalScheduleEnabled&&Q()))}else g([]),N([]),D({}),T("");const o=R(e),i=j(o);i?(re("geoLocation",i,{shouldValidate:!1,shouldDirty:!0}),T(i.formattedAddress),oe("cartAddress")||re("cartAddress",i.formattedAddress)):(re("geoLocation",null,{shouldValidate:!1}),T(""))},[pe,f]),n.useEffect(()=>{let e=null;return e=setTimeout(()=>{try{const e={mdmsCards:v,adsList:C,adsScheduleMap:b,placeNameState:A,globalScheduleEnabled:!!P,startDate:le("startDate")||"",endDate:le("endDate")||"",bookingFromTime:le("bookingFromTime")||"",bookingToTime:le("bookingToTime")||"",siteId:le("siteId")||"",geoLocation:le("geoLocation")||null};_(Rn("savedUI",e));try{sessionStorage.setItem("ADS:session:"+(le("siteId")||"last"),JSON.stringify(e))}catch(e){}}catch(e){console.warn("sync savedUI failed",e)}},120),()=>{e&&clearTimeout(e)}},[v,C,b,A,P,_,le]),n.useEffect(()=>()=>{try{const e={mdmsCards:v,adsList:C,adsScheduleMap:b,placeNameState:A,globalScheduleEnabled:!!P,startDate:le("startDate")||"",endDate:le("endDate")||"",bookingFromTime:le("bookingFromTime")||"",bookingToTime:le("bookingToTime")||"",siteId:le("siteId")||"",geoLocation:le("geoLocation")||null};_(Rn("savedUI",e));try{sessionStorage.setItem("ADS:session:"+(le("siteId")||"last"),JSON.stringify(e))}catch(e){}}catch(e){}},[]);const me=oe("startDate"),ve=oe("endDate"),ge=oe("bookingFromTime"),he=oe("bookingToTime"),ye=oe("siteId");n.useEffect(()=>{F.current||(ye&&G(ye,{mdmsCards:v,adsList:C,adsScheduleMap:b,placeNameState:A,globalScheduleEnabled:!!P,startDate:me||"",endDate:ve||"",bookingFromTime:ge||"",bookingToTime:he||""}),P&&Z({globalScheduleEnabled:!!P,startDate:me||"",endDate:ve||"",bookingFromTime:ge||"",bookingToTime:he||""}))},[v,C,b,A,ye,P,me,ve,ge,he]);const Ee=new Date;Ee.getTime(),Ee.setMinutes(Ee.getMinutes()-Ee.getTimezoneOffset()),Ee.setDate(Ee.getDate()+1);const Se=(()=>{const e=new Date;return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e.setDate(e.getDate()+1),e.toISOString().slice(0,10)})();let be;if(me){const e=new Date(me);e.setDate(e.getDate()),be=e.toISOString().slice(0,10)}ne(e=>{null!==L&&L>=0?(N(t=>t.map((t,n)=>n===L?e:t)),O(null)):N(t=>[...t,e]),ie(c({},ee,{bookingFromTime:q,bookingToTime:q})),T("")});const De=ne(e=>{if(Object.keys(x).length>0)return void k({key:!0,label:"Please fix all schedule errors before proceeding."});if(0===((null==v?void 0:v.length)||0)&&0===((null==C?void 0:C.length)||0))return void ue("siteSelection",{type:"manual",message:"Please select at least one site before proceeding."});const t=v.flatMap(e=>(e.schedules||[]).map(t=>{var n,r;const[o,i=q]=(t.startDatetime||"").split("T"),[a,l=q]=(t.endDatetime||"").split("T");return{addType:e.adType||"",bookingDate:o||"",endDate:a||"",bookingFromTime:i||q,bookingToTime:l||q,advertisementId:(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.name||"",geoLocation:e.geoLocation||j(R(e.locationCode))||"",faceArea:(e.width||"")+"x"+(e.height||""),location:e.locationCode||"",status:"BOOKING_CREATED",availabilityStatus:!1===e.available?"UNAVAILABLE":"AVAILABLE",amount:e.amount||"",nightLight:e.light}})),n=[...C,...t];console.log("adsToSubmit",n);const r=n.map(e=>{var t,n,r,o,i,a;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType||e.addType||"",bookingDate:e.bookingDate||e.startDate||"",endDate:e.endDate||e.endDate||"",bookingFromTime:e.bookingFromTime||"",bookingToTime:e.bookingToTime||"",advertisementId:e.advertisementId||e.siteId||(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:e.cartId||e.cartId||e.siteId||(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.cartAddress||e.name||"",geoLocation:e.geoLocation||(null!==(o=e.geoLocation)&&void 0!==o&&o.code?e.geoLocation.code:"")||"",faceArea:e.faceArea||(null!==(i=e.size)&&void 0!==i&&i.code?e.size.code:"")||"",location:e.location||e.locationCode||e.siteId||(null!==(a=e.siteName)&&void 0!==a&&a.code?e.siteName.code:"")||"",status:"BOOKING_CREATED",availabilityStatus:e.availabilityStatus||(!1===e.available?"UNAVAILABLE":"AVAILABLE")||"",rate:e.amount||"",light:e.light}}),o=Y();let a=[];const l=oe("siteId")||le("siteId");o.forEach(e=>{e&&e.siteId&&String(e.siteId)!==String(l)&&(a=a.concat((e=>{if(!e)return[];const{mdmsCards:t=[],adsList:n=[]}=e,r=t.flatMap(e=>(e.schedules||[]).map(t=>{var n,r;const[o,i=q]=(t.startDatetime||"").split("T"),[a,l=q]=(t.endDatetime||"").split("T");return{addType:e.adType||"",bookingDate:o||"",endDate:a||"",bookingFromTime:i||q,bookingToTime:l||q,advertisementId:(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.name||"",geoLocation:e.geoLocation||e.geoLocation||"",faceArea:(e.width||"")+"x"+(e.height||""),location:e.locationCode||"",status:"BOOKING_CREATED",availabilityStatus:!1===e.available?"UNAVAILABLE":"AVAILABLE",amount:e.amount||""}}));return[...(n||[]).map(e=>{var t,n,r,o,i,a;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType||e.addType||"",bookingDate:e.bookingDate||e.startDate||"",endDate:e.endDate||e.endDate||"",bookingFromTime:e.bookingFromTime||"",bookingToTime:e.bookingToTime||"",advertisementId:e.advertisementId||e.siteId||(null===(n=e.mdmsId)||void 0===n?void 0:n.toString())||"",cartId:e.cartId||e.siteId||(null===(r=e.mdmsId)||void 0===r?void 0:r.toString())||"",cartAddress:e.cartAddress||e.name||"",geoLocation:e.geoLocation||(null!==(o=e.geoLocation)&&void 0!==o&&o.code?e.geoLocation.code:"")||"",faceArea:e.faceArea||(null!==(i=e.size)&&void 0!==i&&i.code?e.size.code:"")||"",location:e.location||e.locationCode||e.siteId||(null!==(a=e.siteName)&&void 0!==a&&a.code?e.siteName.code:"")||"",status:"BOOKING_CREATED",availabilityStatus:e.availabilityStatus||(!1===e.available?"UNAVAILABLE":"AVAILABLE")||"",rate:e.amount||""}}),...r]})(e)))});const s=new Map,u=e=>{const t=(e.advertisementId||"")+"::"+(e.cartId||"")+"::"+(e.bookingDate||"");return!s.has(t)&&(s.set(t,!0),!0)},c=[];r.forEach(e=>{u(e)&&c.push(e)}),a.forEach(e=>{u(e)&&c.push(e)});const d={cartDetails:c,cartAddress:e.cartAddress,savedUI:{mdmsCards:v,adsList:C,adsScheduleMap:b,placeNameState:A,globalScheduleEnabled:P,startDate:le("startDate")||"",endDate:le("endDate")||"",bookingFromTime:le("bookingFromTime")||"",bookingToTime:le("bookingToTime")||"",siteId:le("siteId")||"",geoLocation:le("geoLocation")||null}};l&&G(l,{mdmsCards:v,adsList:C,adsScheduleMap:b,placeNameState:A,globalScheduleEnabled:!!P,startDate:le("startDate")||"",endDate:le("endDate")||"",bookingFromTime:le("bookingFromTime")||"",bookingToTime:le("bookingToTime")||"",geoLocation:le("geoLocation")}),_(Rn("savedUI",d.savedUI)),i(d)});return n.useEffect(()=>{b&&0!==v.length&&g(e=>e.map(e=>{var t,n,r,o,i,a,l,s,u;const d=null!=(t=e.mdmsId)?t:e.id,p=b[d]||b[String(d)];if(!p)return e;const f=p.startDate&&p.startTime?p.startDate+"T"+p.startTime:(null===(n=e.schedules)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.startDatetime)||"",m=p.endDate&&p.endTime?p.endDate+"T"+p.endTime:(null===(o=e.schedules)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.endDatetime)||"",v=(null===(a=e.schedules)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.startDatetime)||"",g=(null===(s=e.schedules)||void 0===s||null===(u=s[0])||void 0===u?void 0:u.endDatetime)||"";return v===f&&g===m?e:c({},e,{schedules:[{startDatetime:f,endDatetime:m}]})}))},[b]),console.log("errors",ae),n.useEffect(()=>{(((null==v?void 0:v.length)||0)>0||((null==C?void 0:C.length)||0)>0)&&ce("siteSelection")},[v,C,ce]),n.useEffect(()=>{ie(ee),g([]),N([]),D({}),T(""),M(!1),y([]),_({type:"RESET_ADS_NEW_APPLICATION_FORM"}),localStorage.removeItem("ADS:global");for(let e=localStorage.length-1;e>=0;e--){const t=localStorage.key(e);t&&t.startsWith("ADS:site:")&&localStorage.removeItem(t)}sessionStorage.removeItem("ADS:session:last"),_({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement(r.Fragment,null,r.createElement("form",{onSubmit:ne(De)},r.createElement("div",null,r.createElement(t.CardLabel,null,"Search By site id ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:te,name:"siteId",rules:{validate:e=>0!==((null==v?void 0:v.length)||0)||0!==((null==C?void 0:C.length)||0)||e&&""!==String(e).trim()?!(e&&String(e).length>100)||"Maximum 100 characters":"This field is required"},render:e=>{if(m)return r.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur});const n=U.map(e=>c({},e,{label:e.label})),o=n.find(t=>String(t.code)===String(e.value))||null;return r.createElement(t.Dropdown,{key:W,className:"form-field",option:n,optionKey:"label",selected:o,select:t=>{if(!t)return;const n=String(t.code||"");e.onChange(n);const r=f.filter(e=>String(e.locationCode)===String(t.code));y(r||[]);const o=K(n),i=J(),a=i&&i.globalScheduleEnabled;o?(g(Array.isArray(o.mdmsCards)?o.mdmsCards:[]),N(Array.isArray(o.adsList)?o.adsList:[]),D(o.adsScheduleMap||{}),o&&void 0!==o.globalScheduleEnabled&&(a?(i.startDate&&re("startDate",i.startDate,{shouldValidate:!1}),i.endDate&&re("endDate",i.endDate,{shouldValidate:!1}),i.bookingFromTime&&re("bookingFromTime",i.bookingFromTime,{shouldValidate:!1}),i.bookingToTime&&re("bookingToTime",i.bookingToTime,{shouldValidate:!1}),M(!0),Q()):(M(!!o.globalScheduleEnabled),o.startDate&&re("startDate",o.startDate,{shouldValidate:!1}),o.endDate&&re("endDate",o.endDate,{shouldValidate:!1}),o.bookingFromTime&&re("bookingFromTime",o.bookingFromTime,{shouldValidate:!1}),o.bookingToTime&&re("bookingToTime",o.bookingToTime,{shouldValidate:!1}),o.globalScheduleEnabled&&Q()))):(g([]),N([]),D({}));const l=R(t.code),s=j(l);s?(re("geoLocation",s,{shouldValidate:!0,shouldDirty:!0}),T(s.formattedAddress),oe("cartAddress")||re("cartAddress",s.formattedAddress)):(re("geoLocation",null,{shouldValidate:!1}),T(""))}})}}),(null==ae?void 0:ae.siteId)&&r.createElement("p",{style:{color:"red",marginTop:"-18px"}},null==ae?void 0:ae.siteId.message),(null==ae?void 0:ae.siteSelection)&&r.createElement("p",{style:{color:"red",marginTop:"-18px"}},null==ae||null===(o=ae.siteSelection)||void 0===o?void 0:o.message),r.createElement("div",{style:{margin:"12px 0",padding:8,border:"1px solid #eee",borderRadius:6}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8}},r.createElement("label",{style:{fontWeight:600,marginRight:8}},r.createElement("input",{type:"checkbox",checked:P,onChange:e=>de(e.target.checked)})," ",u?u("USE_SAME_BOOKING_DATETIME_FOR_ALL_ADS"):"Use same booking date/time for all ads"),P&&r.createElement("div",{style:{color:"#666",fontSize:12}},"Global schedule applied — individual times disabled")),r.createElement(t.CardLabel,null,"Global Start Date & Time"),r.createElement(a.Controller,{control:te,name:"startDate",rules:{required:!!P&&"This field is required"},render:e=>{const t=oe("bookingFromTime")||q,n=e.value?e.value+"T"+t:"",o=H("");return r.createElement("input",{type:"datetime-local",min:Se+"T00:00",value:n,placeholder:o,onChange:t=>{const n=t.target.value;if(!n)return e.onChange(""),void re("bookingFromTime","");const[r,o]=n.split("T");e.onChange(r),re("bookingFromTime",o),P&&Q()},onBlur:t=>e.onBlur(t)})}}),ae.startDate&&r.createElement("p",{style:{color:"red"}},ae.startDate.message),r.createElement(t.CardLabel,null,"Global End Date & Time"),r.createElement(a.Controller,{control:te,name:"endDate",rules:{required:!!P&&"This field is required"},render:e=>{const t=oe("bookingToTime")||q,n=oe("startDate")||Se,o=e.value?e.value+"T"+t:"",i=H("");return r.createElement("input",{type:"datetime-local",min:n+"T00:00",value:o,placeholder:i,onChange:t=>{const n=t.target.value;if(!n)return e.onChange(""),void re("bookingToTime","");const[r,o]=n.split("T");e.onChange(r),re("bookingToTime",o),P&&Q()},onBlur:t=>e.onBlur(t)})}}),ae.endDate&&r.createElement("p",{style:{color:"red"}},ae.endDate.message),r.createElement(a.Controller,{control:te,name:"bookingFromTime",rules:{required:!!P&&"Start time is required"},render:e=>r.createElement("input",{type:"hidden",value:e.value||"",onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur})}),r.createElement(a.Controller,{control:te,name:"bookingToTime",rules:{required:!!P&&"End time is required",validate:e=>{if(!P)return!0;const t=le("startDate")||"",n=le("endDate")||"",r=le("bookingFromTime")||"";return((e,t)=>{if(!e||!t)return"Please choose both start and end date/time.";const[n,r=""]=e.split("T"),[o,i=""]=t.split("T");return n<Se||o<Se?"Dates must be "+Se+" (tomorrow) or later.":n===o&&i<=r?"End time must be later than start time when same day.":null})(t&&r?t+"T"+r:"",n&&e?n+"T"+e:"")||!0}},render:e=>r.createElement("input",{type:"hidden",value:e.value||"",onChange:t=>e.onChange(t.target.value),onBlur:t=>{e.onBlur(t),P&&se("bookingToTime")}})})),h.length>0&&r.createElement("div",{style:{margin:"12px 0"}},ae.bookingToTime&&r.createElement("p",{style:{color:"red"}},ae.bookingToTime.message),ae.scheduleValidation&&r.createElement("p",{style:{color:"red",marginTop:"4px"}},ae.scheduleValidation.message),r.createElement("div",{style:{fontWeight:600,marginBottom:8}},u?u("ADS_IN_SELECTED_LOCATION"):"Advertisements in selected location"),r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:12}},h.slice(0,E).map((e,t)=>{var n,o,i,a,l,s,d,p;return r.createElement("div",{key:t,style:{width:280,border:"1px solid #eee",borderRadius:8,padding:8,boxShadow:"0 1px 3px rgba(0,0,0,0.04)",background:"#fff",display:"flex",flexDirection:"column",gap:8}},r.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},e.imageSrc?r.createElement("img",{src:e.imageSrc,alt:e.name,loading:"lazy",style:{width:"100%",height:140,objectFit:"cover",borderRadius:6}}):r.createElement("div",{style:{width:"100%",height:140,background:"#f5f5f5",borderRadius:6}})),r.createElement("div",{style:{paddingTop:4}},r.createElement("div",{style:{fontSize:14,fontWeight:700,lineHeight:"1.1"}},e.name||"Ad "+e.id),r.createElement("div",{style:{marginTop:6,fontSize:12,color:"#666",display:"grid",gridTemplateColumns:"auto 1fr",gap:"4px 8px"}},r.createElement("div",{style:{fontWeight:600}},"ID:"),r.createElement("div",null,e.id),r.createElement("div",{style:{fontWeight:600}},"Pole No:"),r.createElement("div",null,e.poleNo),r.createElement("div",{style:{fontWeight:600}},"Type:"),r.createElement("div",null,e.adType),r.createElement("div",{style:{fontWeight:600}},"Size:"),r.createElement("div",null,e.width," x ",e.height),r.createElement("div",{style:{fontWeight:600}},"Amount:"),r.createElement("div",null,"₹",e.amount),r.createElement("div",{style:{fontWeight:600}},"Available:"),r.createElement("div",null,String(e.available)))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:6}},r.createElement("div",{style:{fontSize:11,color:"#666"}},"Start"),r.createElement("div",{style:{display:"flex",gap:6}},r.createElement("input",{type:"date",min:Se,value:(null===(n=b[e.id])||void 0===n?void 0:n.startDate)||P&&le("startDate")||"",onChange:t=>{if(P)return;const n=t.target.value,r=b[e.id]||{},o=r.endDate,i=c({},r||{},{startDate:n,endDate:o&&o<n?n:o});D(t=>c({},t,{[e.id]:i})),$(e.id,i)},disabled:P,style:{flex:1,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}}),r.createElement("input",{type:"time",value:(null===(o=b[e.id])||void 0===o?void 0:o.startTime)||P&&le("bookingFromTime")||"",onChange:t=>{if(P)return;const n=c({},b[e.id]||{}||{},{startTime:t.target.value});D(t=>c({},t,{[e.id]:n})),$(e.id,n)},disabled:P,style:{width:100,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}})),r.createElement("div",{style:{height:8}}),r.createElement("div",{style:{fontSize:11,color:"#666"}},"End"),r.createElement("div",{style:{display:"flex",gap:6}},r.createElement("input",{type:"date",min:P?le("startDate")||Se:(null===(i=b[e.id])||void 0===i?void 0:i.startDate)||Se,value:(null===(a=b[e.id])||void 0===a?void 0:a.endDate)||P&&le("endDate")||"",onChange:t=>{if(P)return;const n=t.target.value,r=b[e.id]||{},o=c({},r||{},{endDate:r.startDate&&n<r.startDate?r.startDate:n});D(t=>c({},t,{[e.id]:o})),$(e.id,o)},disabled:P,style:{flex:1,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}}),r.createElement("input",{type:"time",value:(null===(l=b[e.id])||void 0===l?void 0:l.endTime)||P&&le("bookingToTime")||"",onChange:t=>{if(P)return;const n=c({},b[e.id]||{}||{},{endTime:t.target.value});D(t=>c({},t,{[e.id]:n})),$(e.id,n)},disabled:P,style:{width:100,padding:"6px 8px",fontSize:12,borderRadius:4,border:"1px solid #ddd"}})),r.createElement("div",{style:{fontSize:11,color:"#666",marginTop:4}},"Hint: pick date & time (min: tomorrow)"),x[e.id]&&r.createElement("div",{style:{color:"red",fontSize:12,marginTop:6}},x[e.id])),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:6}},r.createElement("div",null,v.find(t=>String(t.mdmsId)===String(e.id))?r.createElement("button",{type:"button",onClick:()=>g(t=>t.filter(t=>String(t.mdmsId)!==String(e.id))),style:{padding:"6px 10px",borderRadius:6,border:"1px solid #d0d0d0",background:"#fff",cursor:"pointer"}},u?u("Remove"):"Remove"):r.createElement("button",{type:"button",onClick:()=>{const t=P?{startDate:le("startDate")||"",startTime:le("bookingFromTime")||"",endDate:le("endDate")||"",endTime:le("bookingToTime")||""}:b[e.id]||{},n=t.startDate&&t.startTime?t.startDate+"T"+t.startTime:"",r=t.endDate&&t.endTime?t.endDate+"T"+t.endTime:"";if(!n||!r)return ue("scheduleValidation",{type:"manual",message:"Please fill both start and end date & time before adding."}),!1;if(void 0!==Se&&(t.startDate<Se||t.endDate<Se))return ue("scheduleValidation",{type:"manual",message:"Dates must be from "+Se+" or later."}),!1;const o=new Date(n);if(new Date(r)<=o)return void k({key:!0,label:"End date/time must be after start date/time."});if(x[e.id])return void k({key:!0,label:x[e.id]});ce("scheduleValidation");const i=R?R(e.locationCode):null,a=i?j(i):e.locationCode,l={mdmsId:e.id,poleNo:e.poleNo,name:e.name,adType:e.adType,width:e.width,height:e.height,amount:e.amount,light:null==e?void 0:e.light,available:e.available,locationCode:e.locationCode,geoLocation:a,schedules:[{startDatetime:n,endDatetime:r}],addedByUser:!0};g(e=>[...e,l])},disabled:!!x[e.id],style:{padding:"6px 10px",borderRadius:6,border:"none",background:x[e.id]?"#ccc":"#0b74de",color:"#fff",cursor:x[e.id]?"not-allowed":"pointer"}},u?u("Add"):"Add")),r.createElement("div",null,v.find(t=>String(t.mdmsId)===String(e.id))&&r.createElement("span",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"green",fontWeight:700}},r.createElement("span",{style:{fontSize:14}},"✔"),r.createElement("span",null,u?u("Added"):"Added")))),(null===(s=v.find(t=>String(t.mdmsId)===String(e.id)))||void 0===s||null===(d=s.schedules)||void 0===d?void 0:d.length)>0&&r.createElement("div",{style:{marginTop:8,fontSize:12,color:"#333"}},((null===(p=v.find(t=>String(t.mdmsId)===String(e.id)))||void 0===p?void 0:p.schedules)||[]).map((e,t)=>r.createElement("div",{key:t,style:{color:"#666"}},r.createElement("strong",null,0===t?"Schedule":"Schedule "+(t+1)),": ",H(e.startDatetime)," →"," ",H(e.endDatetime)))))})),E<h.length&&r.createElement("div",{style:{marginTop:12,textAlign:"center"}},r.createElement("button",{onClick:()=>S(e=>e+6),type:"button",style:{padding:"8px 12px",borderRadius:6,border:"1px solid #ccc",background:"#fff",cursor:"pointer"}},u?u("Show more"):"Show more"))),r.createElement(t.CardLabel,null,"Geo Location ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:te,name:"geoLocation",rules:{required:"This field is required",validate:e=>e&&(e.latitude||e.lat)&&(e.longitude||e.lng)||"Please pick a location"},render:e=>r.createElement(rt,{value:e.value,onChange:t=>{e.onChange(t),T((null==t?void 0:t.formattedAddress)||"")},onBlur:e.onBlur,t:u})}),ae.geoLocation&&r.createElement("p",{style:{color:"red",marginTop:"-18px"}},ae.geoLocation.message)),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})),I&&r.createElement(t.Toast,{error:I.key,label:u(I.label),style:{bottom:"0px"},onClose:()=>{k(null)},isDleteBtn:!0})))},Hn=e=>{let{t:o,goNext:i,currentStepData:l,onGoBack:s}=e;const{control:u,handleSubmit:c,setValue:d,watch:p,formState:{errors:f}}=a.useForm({defaultValues:{penalty:"No",penaltyAmount:"",referenceId:""}}),m=p("penalty");return n.useEffect(()=>{l&&Object.entries(l).forEach(e=>{let[t,n]=e;d(t,null!=n?n:"")})},[l,d]),r.createElement("form",{onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),i(e)})},r.createElement(t.CardLabel,null,o("Penalty")),r.createElement(a.Controller,{name:"penalty",control:u,render:e=>r.createElement("div",{style:{display:"flex",gap:"20px"}},r.createElement("label",null,r.createElement("input",{type:"radio",value:"Yes",checked:"Yes"===e.value,onChange:()=>e.onChange("Yes")})," ","Yes"),r.createElement("label",null,r.createElement("input",{type:"radio",value:"No",checked:"No"===e.value,onChange:()=>e.onChange("No")})," ","No"))}),r.createElement(t.CardLabel,null,o("Penalty Amount")),r.createElement(a.Controller,{name:"penaltyAmount",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.penaltyAmount&&r.createElement("p",{style:{color:"red"}},f.penaltyAmount.message),r.createElement(t.CardLabel,null,o("Reference ID")),r.createElement(a.Controller,{name:"referenceId",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.referenceId&&r.createElement("p",{style:{color:"red"}},f.referenceId.message),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:"white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),s(e)})}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))},Un=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSSiteMaster",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"null"}]}],zn=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"SITE_MASTER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteMasterFormStepOne",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]),qn=[{i18nKey:"ADS_AVAILABLE",code:"AVAILABLE",name:"Available"},{i18nKey:"ADS_UNAVAILABLE",code:"UNAVAILABLE",name:"Unavailable"}],Wn=e=>{let{goNext:o,currentStepData:i,t:l}=e;const u=Digit.ULBService.getStateId(),{data:d=[]}=Digit.Hooks.ads.useADSAllMDMS(u);console.log("mdmsdata is :>> ",d);const p=new Date;p.setMinutes(p.getMinutes()-p.getTimezoneOffset());const f=p.toISOString().slice(11,16),m=window.location.href.includes("citizen");console.log("isCitizen",m);const v={siteId:"",siteName:"",geoLocation:null,cartAddress:"",size:"",advertisementType:"",availabilityStatus:"",gstApplicable:!1,cowCessApplicable:!1,rate:""},{control:g,handleSubmit:h,setValue:y,watch:E,reset:S,formState:{errors:b}}=a.useForm({defaultValues:v}),D=(new Date).getTime(),_=e=>{var t;const n=N[e];n&&(S(c({},v,n,{bookingFromTime:n.bookingFromTime||f,bookingToTime:n.bookingToTime||f})),I(e),C((null===(t=n.geoLocation)||void 0===t?void 0:t.formattedAddress)||""))},A=s.useDispatch(),[T,C]=n.useState(""),[N,x]=n.useState([]),[w,I]=n.useState(null),k=h(e=>{null!==w&&w>=0?(x(t=>t.map((t,n)=>n===w?e:t)),I(null)):x(t=>[...t,e]),S(c({},v,{bookingFromTime:f,bookingToTime:f})),C("")});return n.useEffect(()=>{console.log("currentStepData",i);const e=(null==i?void 0:i.siteDetails)||i;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;y(t,n)}),e.bookingFromTime||y("bookingFromTime",f),e.bookingToTime||y("bookingToTime",f))},[i,y]),n.useEffect(()=>{var e;const t=E("siteName");!t||!t.geo_tag||E("geoLocation")&&null!==(e=E("geoLocation"))&&void 0!==e&&e.latitude||(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!1}),C(t.name))},[E("siteName")]),r.createElement(r.Fragment,null,N.length>0&&r.createElement("div",{style:{margin:"12px 0",padding:8,border:"1px dashed #ddd",borderRadius:6}},r.createElement("div",{style:{fontWeight:600,marginBottom:8}},l?l("Added Advertisements"):"Added Advertisements"),N.map((e,t)=>{var n,o,i;return r.createElement("div",{key:t,style:{display:"flex",justifyContent:"space-between",gap:8,alignItems:"center",padding:"6px 0",borderBottom:t<N.length-1?"1px solid #eee":"none",cursor:"pointer",background:w===t?"#fafafa":"transparent",paddingRight:12}},r.createElement("div",{onClick:()=>_(t),style:{flex:1}},r.createElement("div",{style:{fontSize:13,fontWeight:500}},(null===(n=e.siteName)||void 0===n?void 0:n.name)||e.siteId||"Ad "+(t+1)),r.createElement("div",{style:{fontSize:12,color:"#666"}},e.cartAddress||(null===(o=e.geoLocation)||void 0===o?void 0:o.formattedAddress)||(null!==(i=e.geoLocation)&&void 0!==i&&i.latitude?e.geoLocation.latitude+", "+e.geoLocation.longitude:""))),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement("button",{type:"button",onClick:()=>_(t),style:{background:"#fff",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Edit"):"Edit"),r.createElement("button",{type:"button",onClick:()=>{return e=t,x(t=>t.filter((t,n)=>n!==e)),void(w===e?(I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),C("")):null!==w&&w>e&&I(e=>null!==e?e-1:null));var e},style:{background:"transparent",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Remove"):"Remove")))})),r.createElement("form",{onSubmit:h(function(e){try{var t,n,r,a,l,s,u,d,p,g,h;const y=m?"pb.amritsar":"pb.testing",E=(null==i||null===(t=i.ownerDetails)||void 0===t?void 0:t.address)||{},b=[...N,e],_={addressLine1:E.addressline1||E.addressLine1||"",city:(null===(n=E.city)||void 0===n?void 0:n.name)||E.city||"",cityCode:E.cityCode||(null===(r=E.city)||void 0===r?void 0:r.code)||"",houseNo:E.houseNo||"",landmark:E.landmark||"",locality:(null===(a=E.locality)||void 0===a?void 0:a.code)||E.locality||"",localityCode:E.localityCode||(null===(l=E.locality)||void 0===l?void 0:l.code)||"",pincode:E.pincode||"",streetName:E.streetName||""},T={tenantId:y,applicationDate:D,bookingStatus:"BOOKING_CREATED",address:_,applicantDetail:{applicantName:((null==i||null===(s=i.ownerDetails)||void 0===s?void 0:s.firstName)||"")+" "+((null==i||null===(u=i.ownerDetails)||void 0===u?void 0:u.lastName)||""),applicantEmailId:(null==i||null===(d=i.ownerDetails)||void 0===d?void 0:d.emailId)||"",applicantMobileNo:(null==i||null===(p=i.ownerDetails)||void 0===p?void 0:p.mobileNumber)||"",selfDeclaration:(null==i||null===(g=i.ownerDetails)||void 0===g?void 0:g.selfDeclaration)||!0,applicantDetailId:"",SGST:(null==i||null===(h=i.ownerDetails)||void 0===h?void 0:h.SGST)||""}||{},additional_details:"geolocation , siteName, SGST, selfDeclaration , endDate ,",cartDetails:b.map(e=>{var t,n,r,o,i;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType,bookingDate:e.startDate,endDate:e.endDate,bookingFromTime:e.bookingFromTime,bookingToTime:e.bookingToTime,advertisementId:e.siteId||"",cartId:e.siteId||"",cartAddress:e.cartAddress||"",geoLocation:(null===(n=e.geoLocation)||void 0===n?void 0:n.code)||e.geoLocation,faceArea:(null===(r=e.size)||void 0===r?void 0:r.code)||e.size,location:(null===(o=e.siteName)||void 0===o?void 0:o.code)||e.siteName||"",status:"BOOKING_CREATED",availabilityStatus:(null===(i=e.availabilityStatus)||void 0===i?void 0:i.code)||e.availabilityStatus||"",rate:e.rate||""}}),documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}};console.log("formData",T),A(Rn("applicantDetail",T.applicantDetail)),A(Rn("cartDetails",T.cartDetails)),A(Rn("cartAddress",e.cartAddress)),A(Rn("siteDetails",e)),A(Rn("siteId",e.siteId)),A(Rn("siteName",e.siteName)),A(Rn("bookingFromTime",e.bookingFromTime)),A(Rn("bookingToTime",e.bookingToTime));const C={draft:!0,bookingApplication:T};console.log("ADS Create payload:",{bookingApplication:T});const w=Ze(function(){const e={bookingApplication:T};return console.log("Sending payload:",JSON.stringify(e,null,2)),Promise.resolve(Digit.ADSServices.create(e,y)).then(function(e){var t;console.log("Received response:",JSON.stringify(e,null,2));const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){console.log("ADS create successfull");const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;A(Rn("CreatedResponse",t||e)),x([]),I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),o(e)}else console.error("ADS create failed:",e),A(Rn("CreatedResponse",{draft:!0,bookingApplication:T})),o(c({},C,{draft:!0}))})},function(e){console.error("ADS create error:",e),A(Rn("CreatedResponse",{draft:!0,bookingApplication:T})),o(c({},C,{draft:!0}))});return Promise.resolve(w&&w.then?w.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",null,r.createElement(t.CardLabel,null,"Enter site id ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"siteId",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteId&&r.createElement("p",{style:{color:"red"}},b.siteId.message),r.createElement(t.CardLabel,null,"Site Name ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"siteName",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{className:"form-field",select:t=>{e.onChange(t),t&&t.geo_tag&&t.geo_tag.latitude&&t.geo_tag.longitude&&(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!0,shouldDirty:!0}),C(t.name),E("cartAddress")||y("cartAddress",t.name))},onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteName&&r.createElement("p",{style:{color:"red"}},b.siteName.message),r.createElement(t.CardLabel,null,"Geo Location ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"geoLocation",rules:{required:"This field is required",validate:e=>e&&(e.latitude||e.lat)&&(e.longitude||e.lng)||"Please pick a location"},render:e=>r.createElement(rt,{value:e.value,onChange:t=>{e.onChange(t),C((null==t?void 0:t.formattedAddress)||"")},onBlur:e.onBlur,t:l})}),b.geoLocation&&r.createElement("p",{style:{color:"red"}},b.geoLocation.message),r.createElement(t.CardLabel,null,"Address ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"cartAddress",rules:{required:"This field is required",pattern:{value:/^(?=.*[a-zA-Z]).*$/,message:"Enter valid address , atleast one letter must be present"},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>r.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.cartAddress&&r.createElement("p",{style:{color:"red"}},b.cartAddress.message),r.createElement(t.CardLabel,null,"Size ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"height",rules:{required:"Height is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"height"})}}),b.height&&r.createElement("p",{style:{color:"red"}},b.height.message),r.createElement(a.Controller,{control:g,name:"width",rules:{required:"Width is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"width"})}}),b.width&&r.createElement("p",{style:{color:"red"}},b.width.message),r.createElement(t.CardLabel,null,"Advertisement Type ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"advertisementType",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:d,optionKey:"adType"})}),b.advertisementType&&r.createElement("p",{style:{color:"red"}},b.advertisementType.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Rate / Price of the site (₹) ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"rate",rules:{pattern:{value:/^(?!.*[eE])[0-9]+(\.[0-9]{1,2})?$/,message:"Enter a valid amount"},maxLength:{value:12,message:"Maximum 12 characters"},required:"This field is required"},render:e=>r.createElement(t.TextInput,{type:"number",step:"0.01",min:"0",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t)})}),b.rate&&r.createElement("p",{style:{color:"red"}},b.rate.message),r.createElement(t.CardLabel,null,"Availability Status ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"availabilityStatus",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:qn,optionKey:"i18nKey"})}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.availabilityStatus.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"GST Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"gstApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"gstApplicable"}),r.createElement("label",{htmlFor:"gstApplicable",style:{marginLeft:8}},"Yes"))}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.gstApplicable.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Cow Cess Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:g,name:"cowCessApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"cowCessApplicable"}),r.createElement("label",{htmlFor:"cowCessApplicable",style:{marginLeft:8}},"Yes"))}),b.cowCessApplicable&&r.createElement("p",{style:{color:"red"}},b.cowCessApplicable.message)),r.createElement("div",{style:{margin:"12px 0"}},r.createElement("button",{type:"button",onClick:k,style:{background:"#f1f1f1",border:"1px solid #ccc",padding:"8px 12px",borderRadius:4,cursor:"pointer"}},null!==w?l?l("Save Site"):"Save Site":l?l("Add Site"):"Add Site")),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},Vn=[{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:1,body:[{route:"documents",component:"ADSSiteInspection",withoutLabel:!0,key:"documents",type:"component",nextStep:"null"}]}],Gn=(window.location.href.includes("employee"),[{head:"ES_TITILE_DOCUMENT_DETAILS",stepLabel:"ES_TITILE_SITE_INSPECTION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteInspectionStepperFormOne",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]);function Kn(e){var o;let{t:i,document:a,setDocuments:l,setError:s,documents:u,action:d,formData:p,handleSubmit:f,id:m}=e;const v=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?c({},v,{active:!0===(null==a?void 0:a.active),code:null==v?void 0:v.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[D,_]=n.useState(()=>(null==v?void 0:v.fileName)||null),{dropdownData:A}=a;var T=A;const[C,N]=n.useState(!1);C&&_(null);const[x,w]=n.useState(!1),I=["image/jpeg","image/png","application/pdf"],k=[".jpeg",".jpg",".png",".pdf"];return n.useEffect(()=>{null!=g&&g.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==S?void 0:S.length)||null===S?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S))||[],{documentType:null==g?void 0:g.code,fileStoreId:S,documentDetailId:S,fileName:D||(null==v?void 0:v.fileName)||null,mimeType:(null==y?void 0:y.type)||null,size:(null==y?void 0:y.size)||null}]})},[S,D,g]),n.useEffect(()=>{(null==u?void 0:u.length)>0&&f()},[u]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],r=null==T?void 0:T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(h(r),b(null==n?void 0:n.fileStoreId),_((null==n?void 0:n.fileName)||null)):N(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||h({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{s(null),function(){if(y){if(w(!0),!(y.type&&I.includes(y.type)||k.some(e=>{var t;return null===(t=y.name)||void 0===t?void 0:t.toLowerCase().endsWith(e)})))return w(!1),b(null),void s(i("CS_FILE_TYPE_NOT_ALLOWED")||"Only PDF, JPG, JPEG, and PNG files are allowed.");if(y.size>=5242880)return w(!1),b(null),void s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));const e=Ze(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),s(i("CS_FILE_UPLOAD_ERROR"))});e&&e.then&&e.then(function(){})}}()}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{C&&b(null)},[C]),r.createElement("div",{style:{marginBottom:"24px"}},x&&r.createElement(t.Loader,null),(null==a?void 0:a.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *")),r.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"100%"},option:T.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:i})),!(null!=a&&a.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *"))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];E(n),_((null==n?void 0:n.name)||null)},onDelete:()=>{b(null),_(null),s&&s(null)},id:m,message:S?""+(D||(null==v?void 0:v.fileName)||"1 "+i("CS_ACTION_FILEUPLOADED")):i("CS_ACTION_NO_FILEUPLOADED")+" ("+(i("CS_ALLOWED_TYPES")||"PDF, JPG, JPEG, PNG")+"; ≤ 5MB)",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function $n(e){let{t:o,document:i,setDocuments:a,documents:l,validateFile:s,makeDocumentsValidator:u,mdms:c,setFormErrors:d}=e;const[p,f]=n.useState(null),[m,v]=n.useState((null==i?void 0:i.fileStoreId)||null),[g,h]=n.useState(null),[y,E]=n.useState(!1);n.useEffect(()=>{p&&function(){try{E(!0);const e=Ze(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",p,Digit.ULBService.getStateId())).then(function(e){var t,n;if(E(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var r,i;const t=null==e||null===(r=e.data)||void 0===r||null===(i=r.files[0])||void 0===i?void 0:i.fileStoreId;v(t),S(t)}else h(o("CS_FILE_UPLOAD_ERROR")),S(null)})},function(){E(!1),h(o("CS_FILE_UPLOAD_ERROR")),S(null)});e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]);const S=e=>{const t=[...l.filter(e=>e.documentType!==(null==i?void 0:i.code)),...e?[{documentType:null==i?void 0:i.code,fileStoreId:e,documentUid:e}]:[]];if(!N.isEqual(t,l)){a(t);const e=u(c)(t);d(e)}};return r.createElement("div",{style:{marginBottom:"24px"}},y&&r.createElement(t.Loader,null),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==i?void 0:i.code.replaceAll(".","_"))+(null!=i&&i.required?" *":""))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){const t=e.target.files&&e.target.files[0];if(!t)return;const n=s(t,null==i?void 0:i.code);if(n)return h(o(n)),void S(null);h(null),f(t)},onDelete:()=>{v(null),h(null),S(null)},message:m?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:"OWNER.OWNERPHOTO"===(null==i?void 0:i.code)||"PET.PETPHOTO"===(null==i?void 0:i.code)?".jpeg, .jpg, .png":".pdf, .jpeg, .jpg, .png",buttonType:"button",error:Boolean(g)}),g&&r.createElement("div",{style:{color:"#d4351c",fontSize:"12px",marginTop:"4px",marginBottom:"10px"}},g))))}const Yn={step:1,isValid:!1,formData:{}},Xn=function(e,t){switch(void 0===e&&(e=Yn),t.type){case"UPDATE_ADSNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_ADSNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_ADS_NEW_APPLICATION_FORM":return Yn;default:return e}},Zn={ADSCreate:e=>{var n,a,s,u;const d=l.useQueryClient(),p=i.useRouteMatch(),{t:f}=o.useTranslation(),{pathname:m}=i.useLocation(),v=i.useHistory(),g=Digit.ULBService.getStateId();let h=[];const[y,E,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:D}=Digit.Hooks.ads.useMDMS(g,"PropertyTax","CommonFieldsConfig");function _(e,t,n,r,o){if(void 0===o&&(o=!1),"owners"===e){let n=y.owners||[];n[r]=t,E(c({},y,{[e]:[...n]}))}else if("units"===e){let e=y.units||[];e=t,E(c({},y,{units:e}))}else E(c({},y,{[e]:c({},y[e],t)}));((e,t,n,r)=>{let o,i=m.split("/").pop(),a=i.charAt(i.length-1),l=!1;Number(parseInt(i))||"0"==i||"-1"==i?"-1"==i||"-2"==i?(i=m.slice(0,-3),i=i.split("/").pop(),l=!0):(i=m.slice(0,-2),i=i.split("/").pop(),l=!0):l=!1,isNaN(a)||(l=!0);let{nextStep:s={}}=h.find(e=>e.route===(i||"0")),u=v.push;if(e&&(u=v.replace),n&&(s=r),null===s)return u(p.path+"/check");o=isNaN(s.split("/").pop())&&l&&"map"!==s?p.path+"/"+s+"/"+t:p.path+"/"+s,u(o)})(n,r,o,e)}const A=()=>{},T=()=>{};if(D)return r.createElement(t.Loader,null);b=L,b.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="searchads";const C=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ADSCheckPage"),N=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSAcknowledgement");return r.createElement(i.Switch,null,h.map((e,t)=>{const{component:n,texts:o,inputs:a,key:l}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return r.createElement(i.Route,{path:p.path+"/"+e.route,key:t},r.createElement(s,{config:{texts:o,inputs:a,key:l},onSelect:_,onSkip:A,t:f,formData:y,onAdd:T}))}),r.createElement(i.Route,{path:p.path+"/check"},r.createElement(C,{onSubmit:function(){try{return v.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),r.createElement(i.Route,{path:p.path+"/acknowledgement"},r.createElement(N,{data:y,onSuccess:()=>{S(),d.invalidateQueries("ADS_CREATE")}})),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:p.path+"/"+h.indexRoute})))},ADSSearch:e=>{var o,l;let{t:s,onSelect:u,config:d,userType:p,formData:f}=e;i.useLocation();const m=Digit.UserService.getUser().info,[v,g]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].cartDetails||(null==f||null===(o=f.adslist)||void 0===o?void 0:o.cartDetails)||[]),[h,y]=n.useState(null==f?void 0:f.adType),[E,S]=n.useState(null==f?void 0:f.location),[b,D]=n.useState(null==f?void 0:f.faceArea),[_,A]=n.useState(!0),[T,C]=n.useState(null==f?void 0:f.fromDate),[N,x]=n.useState([]),[w,I]=n.useState(null==f?void 0:f.toDate),[k,L]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].Searchdata||(null==f||null===(l=f.adslist)||void 0===l?void 0:l.Searchdata)||[]),[O,R]=n.useState(null),[P,M]=n.useState(!1),[B,F]=n.useState(""),[j,H]=n.useState((null==f?void 0:f.nightLight)||{i18nKey:"Yes",code:"Yes",value:"true"}),U=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[z,q]=n.useState(!1);let W=[],V=[],G=[];const{data:K}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"AdType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.AdType.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:$}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"Location"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.Location.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Y}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:X}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"CalculationType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.CalculationType}});K&&K.map(e=>{W.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),$&&$.map(e=>{V.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Y&&Y.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Z=Digit.Hooks.ads.useADSSlotSearch();let J={advertisementSlotSearchCriteria:[{bookingId:"",addType:k.addType,bookingStartDate:k.bookingStartDate,bookingEndDate:k.bookingEndDate,faceArea:k.faceArea,tenantId:U,location:k.location,nightLight:k.nightLight,isTimerRequired:!1}]};n.useEffect(()=>{var e;if(Z.data&&null!==(e=Z.data)&&void 0!==e&&e.advertisementSlotAvailabiltityDetails){var t;const e=null===(t=Z.data)||void 0===t?void 0:t.advertisementSlotAvailabiltityDetails.map((e,t)=>({slotId:t+1,addType:""+s(e.addType),addTypeCode:e.addType,faceAreaCode:e.faceArea,faceArea:""+s(e.faceArea),locationCode:e.location,location:""+s(e.location),nightLight:!1===e.nightLight?"No":"Yes",bookingDate:e.bookingDate,price:k.unitPrice,status:"AVAILABLE"===e.slotStaus?r.createElement("div",{className:"sla-cell-success"},"Available"):r.createElement("div",{className:"sla-cell-error"},"Booked")}));ee(t=>JSON.stringify(t)!==JSON.stringify(e)?e:t),ne(e=>e||!0)}},[Z.data,k]);const[Q,ee]=n.useState(""),[te,ne]=n.useState(!1),re=[{Header:""+s("ADS_TYPE"),accessor:"addType"},{Header:""+s("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+s("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+s("ADS_DATE"),accessor:"bookingDate"},{Header:""+s("ADS_STATUS"),accessor:"status"}],{control:oe}=a.useForm(),ie=()=>{let e,t=f.adslist&&f.adslist[0];"citizen"===p?(e=c({},t,{Searchdata:k,cartDetails:v,adsType:h,selectedLocation:E,selectedFace:b,selectNight:j,fromDate:T,toDate:w,existingDataSet:B}),u(d.key,c({},f[d.key],e),!1,0)):(e=c({},t,{Searchdata:k,cartDetails:v,adsType:h,selectNight:j,selectedLocation:E,selectedFace:b,fromDate:T,toDate:w,existingDataSet:B}),u(d.key,e,!1,0)),console.log("ownerStep",e)};n.useEffect(()=>{"citizen"===p&&ie()},[v,h,j,b,E,k]);const ae=[{id:"selection",Header:e=>r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:N.length===Q.length,onChange:()=>{if(N.length===Q.length)x([]);else{const e=Q.filter(e=>"Available"===e.status.props.children).map(e=>e.slotId);x(e)}}})),Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:N.includes(t.original.slotId),onChange:()=>(e=>{const t=Q[e].slotId;x(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(t.index),disabled:"Available"!==t.original.status.props.children}))}},...re];return n.useEffect(()=>{if(null!=f&&f.adType&&null!=f&&f.faceArea&&null!=f&&f.fromDate&&null!=f&&f.toDate&&null!=f&&f.nightLight&&null!=f&&f.location&&X){var e,t,n,r,o;let s,u=null==f||null===(e=f.location)||void 0===e?void 0:e.value;const c=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===u);if(c){var i,a,l;const e="CalculationType_"+(null==f||null===(i=f.faceArea)||void 0===i?void 0:i.code);s=null==c||null===(a=c[e])||void 0===a||null===(l=a[0])||void 0===l?void 0:l.amount}const d={addType:null==f||null===(t=f.adType)||void 0===t?void 0:t.code,faceArea:null==f||null===(n=f.faceArea)||void 0===n?void 0:n.code,location:null==f||null===(r=f.location)||void 0===r?void 0:r.code,nightLight:null==f||null===(o=f.nightLight)||void 0===o?void 0:o.value,bookingStartDate:null==f?void 0:f.fromDate,bookingEndDate:null==f?void 0:f.toDate,unitPrice:s};JSON.stringify(d)!==JSON.stringify(k)&&L(d)}},[f,X]),n.useEffect(()=>{if(O){const e=setTimeout(()=>{R(null)},1500);return()=>clearTimeout(e)}},[O]),n.useEffect(()=>{k.addType&&Z.mutate(J)},[k]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen"),r.createElement(t.FormStep,{config:d,onSelect:ie,onSkip:()=>u(),t:s},r.createElement(t.CardHeader,null,s("ADS_SEARCH_HEADER")),r.createElement(t.CardLabel,null,""+s("ADS_TYPE")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"adsType",defaultValue:h,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:h,select:e=>{y(e)},placeholder:"Select Advertisement Type",option:W,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_LOCATION")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"selectedLocation",defaultValue:E,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:E,select:e=>{S(e)},placeholder:"Select Ad Type",option:V,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FACE_AREA")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"adsType",defaultValue:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{D(e)},placeholder:"Select Ad Type",option:G,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FROM_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"fromDate",value:T,onChange:function(e){C(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).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")}}),r.createElement(t.CardLabel,null,""+s("ADS_TO_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"toDate",value:w,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).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")}}),r.createElement(t.CardLabel,null,""+s("ADS_NIGHT_LIGHT")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.RadioButtons,{t:s,options:[{i18nKey:"Yes",code:"Yes",value:"true"},{i18nKey:"No",code:"No",value:"false"}],optionsKey:"code",name:"selectNight",value:j,selectedOption:j,innerStyles:{display:"inline-block",marginLeft:"10px",paddingBottom:"2px",marginBottom:"2px"},onSelect:H,isDependent:!0}),r.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"15px"}},r.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),onSubmit:()=>{const e=null==h?void 0:h.code,t=T,n=w,r=null==b?void 0:b.code,o=null==E?void 0:E.value,i=null==j?void 0:j.value;let a;const l=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===o);if(l){var u,c;const e="CalculationType_"+r;a=null==l||null===(u=l[e])||void 0===u||null===(c=u[0])||void 0===c?void 0:c.amount}if(h&&t&&n&&r&&o&&i){if(new Date(t)>new Date(n))return void R({error:!0,label:s("ADS_INVALID_DATE_RANGE")});L({addType:e,faceArea:r,location:o,nightLight:i,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else R({error:!0,label:s("PLEASE_FILL_ALL_FIELDS_TO_SEARCH")})}}),r.createElement(t.SubmitBar,{label:s("ADS_ADD_TO_CART"),onSubmit:()=>{if(0===N.length)return void R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=Q.filter(e=>N.includes(e.slotId)),t=v.map(e=>({slotId:e.slotId,addType:e.addType,location:e.location,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})),n=e.map(e=>({slotId:e.slotId,addTypeCode:e.addTypeCode,faceAreaCode:e.faceAreaCode,locationCode:e.locationCode,addType:e.addType,location:e.location,faceArea:e.faceArea,price:e.price,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,status:e.status.props.children}));if(n.some(e=>t.some(t=>t.addType===e.addType&&t.location===e.location&&t.faceArea===e.faceArea&&t.nightLight===e.nightLight&&t.bookingDate===e.bookingDate)))return R({error:!0,label:s("ADS_ITEM_ALREADY_IN_CART")}),void x([]);const r={};[...t,...n].forEach(e=>{const t=e.addType+"-"+e.location+"-"+e.faceArea+"-"+e.nightLight;r[t]||(r[t]=[]),r[t].push(e)});for(let e in r){const t=r[e].sort((e,t)=>e.slotId-t.slotId);for(let e=1;e<t.length;e++)if(t[e].slotId-t[e-1].slotId>1)return R({error:!0,label:s("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void x([])}g(e=>[...e,...n]),R({success:!0,label:n.length+" item(s) added to cart."}),x([])}}),r.createElement("div",null,r.createElement(t.SubmitBar,{label:s("ADS_VIEW_CART"),onSubmit:()=>{v.length>0?q(!0):R({error:!0,label:s("ADS_NO_ITEMS_IN_CART")})}})),r.createElement("div",{class:"container",style:{width:"1px"}},r.createElement("div",{style:{width:"1px",position:"relative"}},r.createElement("div",{style:{position:"absolute",right:"83px",backgroundColor:"#FFFFFF",color:"#008000",padding:"4px",borderRadius:"30px",margin:"1px 0 1px 0",width:"31px",height:"30px",textAlign:"center",transform:"translateX(100%)"}},r.createElement("div",null," ",v.length)))),z&&r.createElement(He,{onClose:()=>{q(!1)},cartDetails:v,setCartDetails:g}),r.createElement(t.SubmitBar,{label:s("ADS_BOOK_NOW"),onSubmit:()=>{0===v.length?R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")}):_?M(!0):ie()}}))),te&&r.createElement(t.Card,{style:{overflowX:"auto"}},r.createElement(Oe,{t:s,data:Q,columns:ae,getCellProps:e=>({style:{minWidth:"140px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:Q.length,style:{width:"100%",overflowX:"auto"}})),O&&r.createElement(t.Toast,{error:O.error,warning:O.warning,label:s(O.label),onClose:()=>{R(null)}}),P&&r.createElement(Be,{t:s,closeModal:()=>M(!1),actionCancelOnSubmit:()=>M(!1),onSubmit:()=>{ie(),M(!1)},setExistingDataSet:F,Searchdata:v}))},ADSCitizenDetails:e=>{var o,a,l,s,u,d,p,f,m,v,g,h,y,E,S;let{t:b,config:D,onSelect:_,userType:A,formData:T,value:C=T.adslist}=e;i.useLocation();let N=window.location.href.charAt(window.location.href.length-1),x={};const w=Digit.UserService.getUser().info,I=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),k=Digit.Hooks.ads.useADSCreateAPI(),[L,O]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].applicantName||(null==T||null===(o=T.applicant)||void 0===o?void 0:o.applicantName)||(null==C||null===(a=C.existingDataSet)||void 0===a||null===(l=a.applicant)||void 0===l?void 0:l.applicantName)||""),[R,P]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].emailId||(null==T||null===(s=T.applicant)||void 0===s?void 0:s.emailId)||(null==C||null===(u=C.existingDataSet)||void 0===u||null===(d=u.applicant)||void 0===d?void 0:d.emailId)||""),[M,B]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].mobileNumber||(null==C||null===(p=C.existingDataSet)||void 0===p||null===(f=p.applicant)||void 0===f?void 0:f.mobileNumber)||(null==T||null===(m=T.applicant)||void 0===m?void 0:m.mobileNumber)||(null==w?void 0:w.mobileNumber)),[F,j]=n.useState(T.applicant&&T.applicant[N]&&T.applicant[N].alternateNumber||(null==T||null===(v=T.applicant)||void 0===v?void 0:v.alternateNumber)||(null==C||null===(g=C.existingDataSet)||void 0===g||null===(h=g.applicant)||void 0===h?void 0:h.alternateNumber)||""),H=()=>{let e=T.applicant&&T.applicant[N],t=null==C?void 0:C.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));k.mutate({bookingApplication:{tenantId:I,applicantDetail:{applicantName:L,applicantMobileNo:M,applicantAlternateMobileNo:F,applicantEmailId:R},cartDetails:t,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0},{onSuccess:t=>{var n;const r=null==t||null===(n=t.bookingApplication[0])||void 0===n?void 0:n.draftId;let o;"citizen"===A?(o=c({},e,{applicantName:L,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),_(D.key,c({},T[D.key],o),!1,N)):(o=c({},e,{applicantName:L,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),_(D.key,o,!1,N))}})};return n.useEffect(()=>{"citizen"===A&&H()},[]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ke,{currentStep:1}):null,r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(Je,{timerValues:null==C||null===(y=C.existingDataSet)||void 0===y||null===(E=y.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==C?void 0:C.cartDetails,draftId:null==C||null===(S=C.existingDataSet)||void 0===S?void 0:S.draftId})),r.createElement(Xe,null))),r.createElement(t.FormStep,{config:D,onSelect:H,onSkip:()=>_(),t:b,isDisabled:!L||!M||!R},r.createElement("div",null,r.createElement(t.CardLabel,null,""+b("ADS_APPLICANT_NAME")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",placeholder:"Enter Applicant Name",value:L,onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t)},style:{width:"EMPLOYEE"===w.type?"51.6%":null},ValidationRequired:!0},x={pattern:"^[a-zA-Z ]+$",type:"tel",title:b("CHB_NAME_ERROR_MESSAGE")})),r.createElement(t.CardLabel,null,""+b("ADS_MOBILE_NUMBER")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.MobileNumber,{value:M,name:"mobileNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Applicant Register Mobile Number",onChange:e=>function(e){B(e.target.value)}({target:{value:e}}),pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_ALT_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{value:F,name:"alternateNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Alternate Mobile Number",onChange:e=>function(e){j(e.target.value)}({target:{value:e}}),required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_EMAIL_ID")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:R,placeholder:"Enter Applicant Email Id",style:{width:"EMPLOYEE"===w.type?"51.6%":null},onChange:function(e){P(e.target.value)},ValidationRequired:!0},x={required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:b("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var o;let i,{t:a,value:l={},onChange:s=(()=>{}),onBlur:u=(()=>{}),errorsP:d}=e;i="CITIZEN"===(null===(o=JSON.parse(window.localStorage.getItem("user-info")))||void 0===o?void 0:o.type)?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentPermanentCity();const[p,f]=n.useState((null==l?void 0:l.addressId)||""),[m,v]=n.useState((null==l?void 0:l.doorNo)||""),[g,h]=n.useState((null==l?void 0:l.houseNo)||""),[y,E]=n.useState((null==l?void 0:l.houseName)||""),[S,b]=n.useState((null==l?void 0:l.streetName)||""),[D,_]=n.useState((null==l?void 0:l.addressline1)||""),[A,T]=n.useState((null==l?void 0:l.addressline2)||""),[C,N]=n.useState((null==l?void 0:l.landmark)||""),[x,w]=n.useState((null==l?void 0:l.pincode)||""),[I,k]=n.useState((null==l?void 0:l.city)||""),[L,O]=n.useState((null==l?void 0:l.locality)||""),[R,P]=n.useState({});n.useEffect(()=>{f((null==l?void 0:l.addressId)||""),v((null==l?void 0:l.doorNo)||""),h((null==l?void 0:l.houseNo)||""),E((null==l?void 0:l.houseName)||""),b((null==l?void 0:l.streetName)||""),_((null==l?void 0:l.addressline1)||""),T((null==l?void 0:l.addressline2)||""),N((null==l?void 0:l.landmark)||""),w((null==l?void 0:l.pincode)||""),k((null==l?void 0:l.city)||""),O((null==l?void 0:l.locality)||"")},[l]),n.useEffect(()=>{null!=l&&l.city&&k(l.city)},[l]);const M=n.useRef(s);n.useEffect(()=>{M.current=s},[s]);const B=n.useRef(u);n.useEffect(()=>{B.current=u},[u]);const F=function(e){var t,n,r,o,i;void 0===e&&(e={});const a=null!=(t=null!=(n=e.city)?n:I)?t:(null==l?void 0:l.city)||"",s=null!=(r=null!=(o=e.locality)?o:L)?r:(null==l?void 0:l.locality)||"",u=c({addressId:p,doorNo:m,houseNo:g,houseName:y,streetName:S,addressline1:D,addressline2:A,landmark:C,pincode:x,city:a,cityCode:"object"==typeof a?a.code||a.city&&a.city.code||"":a||"",locality:s,localityCode:"object"==typeof s?s.code||s:s||""},e);null===(i=M.current)||void 0===i||i.call(M,u)},j=(e,t)=>{const n=["doorNo","addressId","addressline2"],r=(null==t?void 0:t.trim())||"";n.includes(e)||t&&""!==r?"city"===e||"locality"===e?!/^[a-zA-Z\s]{2,}$/.test(r)||r.length<2?P(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 letters and can only contain letters and spaces"})):P(t=>c({},t,{[e]:""})):n.includes(e)?P(t=>c({},t,{[e]:""})):P(r.length<2?t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 characters"}):t=>c({},t,{[e]:""})):P(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" is required"}))};n.useEffect(()=>{var e;if(null!=d&&null!==(e=d.address)&&void 0!==e&&e.message){const e=d.address.message.replace("Address missing:","").split(",").map(e=>e.trim()),t={};e.forEach(e=>{t[e]="This field is required"}),P(e=>c({},e,t))}},[d]);const H={marginTop:"-18px",color:"red"};return r.createElement("div",null,r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_ID"):"Address ID"),r.createElement(t.TextInput,{value:p,onChange:e=>{const t=e.target.value;f(t),F({addressId:t}),j("addressId",t)},onBlur:()=>B.current&&B.current()}),(R.addressId||d)&&r.createElement(t.CardLabelError,{style:H},R.addressId),r.createElement(t.CardLabel,null,a?a("ADS_DOOR_NO"):"Door No"),r.createElement(t.TextInput,{value:m,onChange:e=>{const t=e.target.value;v(t),F({doorNo:t}),j("doorNo",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.doorNo)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.doorNo),r.createElement(t.CardLabel,null,a?a("ADS_HOUSE_NO"):"House No"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:g,onChange:e=>{const t=e.target.value;h(t),F({houseNo:t}),j("houseNo",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.houseNo)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.houseNo),r.createElement(t.CardLabel,null,a?a("ADS_HOUSE_NAME"):"House Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:y,onChange:e=>{const t=e.target.value;E(t),F({houseName:t}),j("houseName",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.houseName)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.houseName),r.createElement(t.CardLabel,null,a?a("ADS_STREET_NAME"):"Street Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:S,onChange:e=>{const t=e.target.value;b(t),F({streetName:t}),j("streetName",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.streetName)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.streetName),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_LINE1"):"Address Line 1"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:D,onChange:e=>{const t=e.target.value;_(t),F({addressline1:t}),j("addressline1",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.addressline1)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.addressline1),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_LINE2"):"Address Line 2"),r.createElement(t.TextInput,{value:A,onChange:e=>{const t=e.target.value;T(t),F({addressline2:t}),j("addressline2",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.addressline2)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.addressline2),r.createElement(t.CardLabel,null,a?a("ADS_LANDMARK"):"Landmark"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextArea,{value:C,onChange:e=>{const t=e.target.value;N(t),F({landmark:t}),j("landmark",t)},onBlur:()=>B.current&&B.current(),style:{width:"50%"}}),(null==R?void 0:R.landmark)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.landmark),R.locality&&r.createElement("div",{style:{color:"red"}},R.locality),r.createElement(t.CardLabel,null,a?a("ADS_CITY"):"City"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:I,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");k(t),F({city:t}),j("city",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.city)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.city),r.createElement(t.CardLabel,null,a?a("ADS_LOCALITY"):"Locality"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:L,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t),F({locality:t}),j("locality",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.locality)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.locality),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_PINCODE"):"Pincode"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:x,onChange:e=>{const t=String(e.target.value||"").replace(/\D/g,"").slice(0,6);w(t),F({pincode:t}),P(t?e=>c({},e,{pincode:""}):e=>c({},e,{pincode:"Pincode is required"}))},maxLength:6}),(null==R?void 0:R.pincode)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.pincode))},ADSWFCaption:qe,LocationSearchCard:Le,NewSiteInspectionStepperForm:e=>{const a=Gn.map(e=>c({},e,{currStepConfig:Vn.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(i.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement(kn,{stepsList:a,onSubmit:e=>{console.log("dataGet===",e)},step:f,setStep:e=>{u(Pn(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},NewSiteInspectionStepperFormOne:e=>{let{config:o,onGoNext:i,onBackClick:a,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.ads.useADSDocumentsMDMS(m,"Advertisements",["Documents"]),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){var t;console.log("goNext data in NewADSStepFormThree: ",e);const n=(e=>{var t;const n=((null==e||null===(t=e.NDC)||void 0===t?void 0:t.Documents)||[]).filter(e=>null==e?void 0:e.required).map(e=>e.code);return function(e){void 0===e&&(e=[]);const t={};if(null==n||!n.length)return t;for(const o of n){var r;if(!(null===(r=e)||void 0===r?void 0:r.some(e=>{var t,n;return(null==e||null===(t=e.documentType)||void 0===t||null===(n=t.includes)||void 0===n?void 0:n.call(t,o))&&((null==e?void 0:e.filestoreId)||(null==e?void 0:e.fileStoreId))}))){t.missingRequired="ADS_MISSING_REQUIRED_DOCUMENTS";break}}return t}})(v)((null==g||null===(t=g.documents)||void 0===t?void 0:t.documents)||[]);if(null!=n&&n.missingRequired)return f("Please upload all required documents"),void d(!0);i()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!N.isEqual(t,g)),N.isEqual(t,g)||u(Rn(o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},ADSSiteInspection:e=>{var o,i,a;let{t:l,config:s,onSelect:u,formData:d}=e;Digit.ULBService.getStateId();const[p,f]=n.useState((null==d||null===(o=d.documents)||void 0===o?void 0:o.documents)||[]),[m,v]=n.useState(null),[g,h]=n.useState(!0),[y,E]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:D}=Digit.Hooks.pt.usePropertyMDMS(S,"NDC",["Documents"]),_=()=>{let e;e=c({},d.documents,{documents:p}),u(s.key,e)};return n.useEffect(()=>{var e,t;const n=(null==D||null===(e=D.NDC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>null==e?void 0:e.required))||[],r=p||[],o=n.every(e=>r.some(t=>{var n;return(null==t||null===(n=t.documentType)||void 0===n?void 0:n.includes(e.code))&&(null==t?void 0:t.fileStoreId)}));h(!(o&&!m))},[p,D,m]),r.createElement("div",null,b?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:l,config:s,onSelect:_,onSkip:()=>u(),isDisabled:g,onAdd:function(){}},null==D||null===(i=D.NDC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>r.createElement(Kn,{key:t,document:e,t:l,error:m,setError:v,setDocuments:f,documents:p,setCheckRequiredFields:E,handleSubmit:_})),m&&r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(t.Toast,{label:m,onClose:()=>v(null),error:!0}),r.createElement("button",{type:"button","aria-label":"Dismiss",onClick:()=>v(null),style:{background:"transparent",border:"none",fontSize:"18px",cursor:"pointer",lineHeight:1},title:l("CS_ACTION_CLOSE")||"Close"},"×"))))},ADSSiteMaster:Wn,NewSiteMasterFormStepOne:e=>{let{config:i,onGoNext:a}=e;const{t:l}=o.useTranslation(),u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement(Wn,{goNext:function(e){u(Rn(i.key,e)),a()},currentStepData:m,t:l}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewSiteMasterStepperForm:e=>{const a=zn.map(e=>c({},e,{currStepConfig:Un.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(i.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement(kn,{stepsList:a,onSubmit:e=>{console.log("dataGet===",e)},step:f,setStep:e=>{u(Pn(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},ADSWFReason:ze,ADSWFApplicationTimeline:Ve,ADSDocumentDetails:e=>{var o,i,a,l,s,u,d,p;let{t:f,config:m,onSelect:v,formData:g,value:h=g.adslist}=e;const[y,E]=n.useState((null==g||null===(o=g.documents)||void 0===o?void 0:o.documents)||(null==h||null===(i=h.existingDataSet)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.documents)||[]),[S,b]=n.useState(null),[D,_]=n.useState(!0),[A,T]=n.useState(!1),C=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),N=Digit.Hooks.ads.useADSCreateAPI(),x=Digit.ULBService.getStateId(),{isLoading:w,data:I}=Digit.Hooks.ads.useADSDocumentsMDMS(x,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==I||null===(e=I.Advertisement)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;y.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),_("0"!=t&&0!=t||!(y.length>0))},[y,A]),r.createElement("div",null,r.createElement(Ke,{currentStep:3}),r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(Je,{timerValues:null==h||null===(l=h.existingDataSet)||void 0===l||null===(s=l.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==h?void 0:h.cartDetails,draftId:null==h||null===(u=h.existingDataSet)||void 0===u?void 0:u.draftId})),r.createElement(Xe,null))),w?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:f,config:m,onSelect:()=>{var e,t,n,r,o,i,a,l,s,u,d,p,f,E,S,b,D,_,A,T,x;let w=null==h?void 0:h.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const I={bookingApplication:{tenantId:C,draftId:null==g||null===(e=g.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==g||null===(t=g.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==g||null===(n=g.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==g||null===(r=g.applicant)||void 0===r?void 0:r.alternateNumber,applicantEmailId:null==g||null===(o=g.applicant)||void 0===o?void 0:o.emailId},addressdetails:{pincode:null==g||null===(i=g.address)||void 0===i?void 0:i.pincode,city:null==g||null===(a=g.address)||void 0===a||null===(l=a.city)||void 0===l||null===(s=l.city)||void 0===s?void 0:s.name,cityCode:null==g||null===(u=g.address)||void 0===u||null===(d=u.city)||void 0===d||null===(p=d.city)||void 0===p?void 0:p.code,locality:null==g||null===(f=g.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==g||null===(S=g.address)||void 0===S||null===(b=S.locality)||void 0===b?void 0:b.code,streetName:null==g||null===(D=g.address)||void 0===D?void 0:D.streetName,addressLine1:null==g||null===(_=g.address)||void 0===_?void 0:_.addressline1,addressLine2:null==g||null===(A=g.address)||void 0===A?void 0:A.addressline2,houseNo:null==g||null===(T=g.address)||void 0===T?void 0:T.houseNo,landmark:null==g||null===(x=g.address)||void 0===x?void 0:x.landmark},documents:y,cartDetails:w,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let k;N.mutate(I),k=c({},g.documents,{documents:y}),v(m.key,k)},onSkip:()=>v(),isDisabled:D,onAdd:function(){}},r.createElement(t.CardSubHeader,null,f("ADS_PROOF_OF_DOCUMENTS")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_SIZE")),null==I||null===(d=I.Advertisement)||void 0===d||null===(p=d.Documents)||void 0===p?void 0:p.map((e,t)=>r.createElement(Qe,{key:t,document:e,t:f,error:S,setError:b,setDocuments:E,documents:y,setCheckRequiredFields:T})),S&&r.createElement(t.Toast,{label:S,onClose:()=>b(null),error:!0})))},ADSCheckPage:e=>{var a,l,s,u,d,f,m,v,g,h,y;let{onSubmit:E,value:S={}}=e;const{t:b}=o.useTranslation(),[D,_]=(i.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:A,isEditADS:T,isUpdateADS:C,documents:N,address:x}=S,w=T||C?"editbookad":"bookad",I=[{Header:""+b("ADS_TYPE"),accessor:"addType"},{Header:""+b("ADS_FACE_AREA"),accessor:"faceArea"},{Header:b("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,b(t?"Yes":"No"))}},{Header:""+b("ADS_DATE"),accessor:"bookingDate"},{Header:b("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>k(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],k=e=>{var t;const n=c({},D);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),_(n)},L=(null==D||null===(a=D.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[O,R]=n.useState(!1);return r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ke,{currentStep:4}):null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,b("ADS_SUMMARY")),r.createElement(t.CardSubHeader,null,r.createElement(Je,{timerValues:null==D||null===(l=D.adslist)||void 0===l||null===(s=l.existingDataSet)||void 0===s||null===(u=s.timervalue)||void 0===u?void 0:u.timervalue,SlotSearchData:null==D||null===(d=D.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==D||null===(f=D.adslist)||void 0===f||null===(m=f.existingDataSet)||void 0===m?void 0:m.draftId}))),r.createElement("div",null,r.createElement(t.CardText,null,b("ADS_CHECK_CHECK_YOUR_ANSWERS_TEXT")),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_APPLICANT_NAME"),text:""+b(p(null==A?void 0:A.applicantName)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(p(null==A?void 0:A.mobileNumber)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(p(null==A?void 0:A.alternateNumber)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(p(null==A?void 0:A.emailId)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_ADDRESS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_HOUSE_NO"),text:""+b(p(null==x?void 0:x.houseNo)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(p(null==x?void 0:x.houseName)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(p(null==x?void 0:x.streetName)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(p(null==x?void 0:x.addressline1)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(p(null==x?void 0:x.addressline2)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(p(null==x?void 0:x.landmark)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(p(null==x||null===(v=x.city)||void 0===v||null===(g=v.city)||void 0===g?void 0:g.name)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(p(null==x||null===(h=x.locality)||void 0===h?void 0:h.i18nKey)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(p(null==x?void 0:x.pincode)),actionButton:r.createElement(tt,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),r.createElement(Oe,{t:b,data:L,columns:I,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==D||null===(y=D.adslist)||void 0===y?void 0:y.cartDetails.length}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Card,null,N&&(null==N?void 0:N.documents.map((e,t)=>r.createElement(et,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),r.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{R(!O)},styles:{height:"auto"}})),r.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:E,disabled:!O})))},ADSAcknowledgement:e=>{var n;const{state:a}=e.location,{t:l}=o.useTranslation(),s=i.useHistory(),u=null==a?void 0:a.applicationData,c=(window.localStorage.getItem("Citizen.tenant-id"),((null==s||null===(n=s.location)||void 0===n?void 0:n.pathname)||"").split("/").pop());return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:l("ADS_"+(null==u?void 0:u.applicationStatus)+"_HEADER"),applicationNumber:c,info:"REJECTED"===(null==u?void 0:u.applicationStatus)?"":l("ADS_BOOKING_NUMBER"),successful:"REJECTED"!==(null==u?void 0:u.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==u?void 0:u.applicationStatus)?r.createElement(t.CardText,null,l("ADS_"+(null==u?void 0:u.applicationStatus)+"_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/citizen")}}),r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{s.push("/digit-ui/citizen/ads-home")}}),"PENDINGPAYMENT"===(null==u?void 0:u.applicationStatus)&&r.createElement(t.SubmitBar,{label:l("COMMON_MAKE_PAYMENT"),onSubmit:()=>{s.push("/digit-ui/citizen/payment/my-bills/ADV/"+c)}}))))},ADSAddressField:rt,ADSCard:nt,ADSMyApplications:()=>{const{t:e}=o.useTranslation(),[a,l]=(Digit.UserService.getUser(),n.useState(null));let s,u,c=window.location.href.split("/").pop();isNaN(parseInt(c))?s=4:(u=c,s=parseInt(c)+50);let d=isNaN(parseInt(c))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:"pb.testing"}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:"pb.testing"};n.useEffect(()=>{l(d)},[c]);const{isLoading:p,data:f}=Digit.Hooks.ads.useADSSearch({filters:a});if(console.log("data being returned:>> ",f),p)return r.createElement(t.Loader,null);const m=(null==f?void 0:f.bookingApplication)||[];return r.createElement(n.Fragment,null,r.createElement(t.Header,null,e("ADS_MY_BOOKINGS_HEADER")+" "+(m?"("+m.length+")":"")),r.createElement("div",null,(null==m?void 0:m.length)>0&&m.map((t,n)=>r.createElement("div",{key:n},r.createElement(yt,{application:t,tenantId:"pb.testing",buttonLabel:e("ADS_SUMMARY")}))),!(null!=m&&m.length)>0&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),0!==(null==m?void 0:m.length)&&(null==f?void 0:f.count)>s&&r.createElement("div",null,r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},r.createElement("span",{className:"link"},r.createElement(i.Link,{to:"/digit-ui/citizen/ads/myBookings/"+s},e("ADS_LOAD_MORE_MSG")))))),r.createElement("div",{style:{marginLeft:"16px",marginTop:"16px"}},r.createElement(i.Link,{to:"/digit-ui/citizen/ads/bookad/searchads"},r.createElement("button",{style:{borderRadius:"30px",padding:"8px 16px"}},e("ADS_NEW_BOOKING")+" +"))))},ApplicationDetails:()=>{var e,a,l,s,u,d,p,f,m,v,g,h,y,E,S;const{bookingNo:b}=i.useParams(),{t:D}=o.useTranslation(),_=i.useHistory(),A=Digit.ULBService.getCurrentTenantId(),[T,C]=n.useState({}),N=null==A?void 0:A.split(".")[0],[x,w]=n.useState(null),[I,k]=n.useState(null),[L,O]=n.useState({}),R=Array.isArray(null==L?void 0:L.Documents)?L.Documents:Array.isArray(null==L?void 0:L.documents)?L.documents:[],[P,M]=n.useState({}),[B,F]=n.useState(!1),[j,H]=n.useState(!1);n.useEffect(()=>{var e,t,n;const r=(R||[]).map(e=>{var t;return e?e.fileStoreId?e.fileStoreId:e.fileStoreIds&&Array.isArray(e.fileStoreIds)?e.fileStoreIds[0]:e.fileId?e.fileId:e.documentDetailId?e.documentDetailId:null!=e&&null!==(t=e.file)&&void 0!==t&&t.fileStoreId?e.file.fileStoreId:null:null}).filter(Boolean);if(!r.length)return M({}),void F(!1);F(!0);const o=(null===(e=Digit)||void 0===e||null===(t=e.ULBService)||void 0===t||null===(n=t.getStateId)||void 0===n?void 0:n.call(t))||null;Digit.UploadServices.Filefetch(r,o||A).then(e=>{var t,n;let r=null!=(t=null!=(n=null==e?void 0:e.data)?n:null==e?void 0:e.files)?t:e;if(Array.isArray(r)){const e={};r.forEach(t=>{if(!t)return;if("string"==typeof t)return;const n=t.fileStoreId||t.fileId||t.documentDetailId,r=t.url||t.fileUrl||("string"==typeof t?t:null);n&&r&&(e[n]=r)}),r=e}M(r||{})}).catch(e=>{console.error("Filefetch error:",e),M({})}).finally(()=>F(!1))},[JSON.stringify(R)]);const{isLoading:U,data:z}=Digit.Hooks.ads.useADSSearchApplication({bookingNo:b},A),q=null!=(e=null!=(a=null==z||null===(l=z.data)||void 0===l?void 0:l[0])?a:null==z?void 0:z[0])?e:null,W=q,V=W||q||T||null,G=n.useRef(),[K,$]=n.useState(!1),[Y,X]=n.useState(null),[Z,J]=n.useState(!1),[Q,ee]=n.useState(!1),te=null===(s=Digit.Hooks.ads)||void 0===s||null===(u=s.useADSCreateAPI)||void 0===u?void 0:u.call(s,A,!1),{data:ne,isLoading:re}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"ADV",consumerCodes:(null==L||null===(d=L.applicantData)||void 0===d?void 0:d.applicationNo)||b,isEmployee:!1},{enabled:!!(null!=L&&null!==(p=L.applicantData)&&void 0!==p&&p.applicationNo||b)});Digit.Hooks.useClickOutside(G,()=>{$(!1)},K);const oe=Digit.Hooks.useWorkflowDetails({tenantId:A,id:null==W?void 0:W.bookingNo,moduleCode:"advandhoarding"}),ie=(null==oe||null===(f=oe.data)||void 0===f||null===(m=f.nextActions)||void 0===m?void 0:m.map(e=>({action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase()})))||[];n.useEffect(()=>{const e=W;if(e){var t,n,r,o,i,a;const l={address:null==e||null===(t=e.address)||void 0===t?void 0:t.addressId,email:null==e||null===(n=e.applicantDetail)||void 0===n?void 0:n.applicantEmailId,mobile:null==e||null===(r=e.applicantDetail)||void 0===r?void 0:r.applicantMobileNo,name:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName,applicationNo:null==e?void 0:e.bookingNo,bookingStatus:null==e?void 0:e.bookingStatus,pincode:null==e||null===(i=e.address)||void 0===i?void 0:i.pincode,paymentDate:null!=e&&e.paymentDate?new Date(e.paymentDate).toLocaleDateString():"",receiptNo:null==e?void 0:e.receiptNo},s=(e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))})((null==e?void 0:e.documents)||[]),u=(null==e||null===(a=e.cartDetails)||void 0===a?void 0:a.map(e=>({adType:null==e?void 0:e.addType,location:null==e?void 0:e.location,faceArea:null==e?void 0:e.faceArea,bookingDate:null==e?void 0:e.bookingDate,bookingTime:(null==e?void 0:e.bookingFromTime)+" - "+(null==e?void 0:e.bookingToTime),nightLight:D(null!=e&&e.nightLight?"YES":"NO"),status:null==e?void 0:e.status})))||[];O({applicantData:l,Documents:s,AdsDetails:u})}else O({})},[W,D]),n.useEffect(()=>{H(U||!W),C(W?c({},W,{applicationDetails:[{title:"ADS_DETAILS_SUMMARY_LABEL"}]}):{}),console.debug("bookingObj (normalized):",W,"isLoading:",U)},[U,W]);const ae=function(e){try{var t,n,r,o,i,a,l;const s=null!=(t=null!=(n=null!=(r=null==z||null===(o=z.Applications)||void 0===o?void 0:o[0])?r:null==z||null===(i=z.data)||void 0===i?void 0:i[0])?n:null==z?void 0:z[0])?t:W;if(!s)return w({key:"error",message:"Application data not loaded. Try reloading the page."}),k("Application data not loaded"),Promise.resolve();const u=(null==e||null===(a=e.Licenses)||void 0===a?void 0:a[0])||e;if(!u||!u.action)return w({key:"error",message:"No workflow action provided"}),k("No workflow action provided"),Promise.resolve();const d=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==u?void 0:u.assignee)||(null==u?void 0:u.assignees)||(null==u?void 0:u.assigneeUuid)),p=(null==oe||null===(l=oe.data)||void 0===l?void 0:l.applicationBusinessService)||"ADV",f=c({tenantId:A},s,{documents:(null==s?void 0:s.documents)||(null==s?void 0:s.Documents)||[],workflow:c({businessService:p,action:u.action,comments:u.comment||u.action||"",documents:null!=u&&u.wfDocuments?null==u?void 0:u.wfDocuments:null},d?{assignes:d}:{})});return null!=u&&u.assignee||"FORWARD"!==u.action?Promise.resolve(Ze(function(){var e;if(null===(e=Digit)||void 0===e||!e.ADSServices||"function"!=typeof Digit.ADSServices.update)throw new Error("Digit.ADSServices.update is not available in this runtime");return Promise.resolve(Digit.ADSServices.update({bookingApplication:f},A)).then(function(e){var t,n;"SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)?(w({key:"success",message:"Successfully updated the status"}),k("Successfully updated the status"),null==oe||null===(n=oe.revalidate)||void 0===n||n.call(oe),setTimeout(()=>{_.push("/digit-ui/employee/ads/inbox")},1200),X(null),J(!1)):(w({key:"error",message:(null==D?void 0:D("SOMETHING_WENT_WRONG"))||"Failed to update"}),k("Failed to update"))})},function(e){console.error("submitAction error:",e),w({key:"error",message:"Something went wrong"}),k("Something went wrong")})):(w({key:"error",message:"Assignee is mandatory"}),k("Assignee is mandatory"),Promise.resolve())}catch(e){return Promise.reject(e)}};let le=[];return ne&&(null==ne||null===(v=ne.Payments)||void 0===v?void 0:v.length)>0&&!1===re&&(le.push({label:D("ADS_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;try{const e=Ze(function(){var e;function r(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let o=(null==ne||null===(e=ne.bookingApplication)||void 0===e?void 0:e[0])||{},i=null==o?void 0:o.paymentReceiptFilestoreId;const a=function(){if(!i)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n)]},"advservice-receipt")).then(function(e){var t;function n(){var t;i=null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}const r=c({},o,{paymentReceiptFilestoreId:null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}),a=function(){if(null!=te&&te.mutateAsync)return Promise.resolve(te.mutateAsync({bookingApplication:r})).then(function(){})}();return a&&a.then?a.then(n):n()})}();return a&&a.then?a.then(r):r()},function(e){console.error("getRecieptSearch error",e),w({key:"error",message:"Unable to fetch receipt"})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}({tenantId:null==ne||null===(e=ne.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ne?void 0:ne.Payments[0]})}}),le.push({label:D("ADS_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t}=e;try{const e=Ze(function(){var e;function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let r=(null==ne||null===(e=ne.bookingApplication)||void 0===e?void 0:e[0])||{},o=null==r?void 0:r.permissionLetterFilestoreId;const i=function(){if(!o)return Promise.resolve(Digit.PaymentService.generatePdf(t,{bookingApplication:[r]},"advpermissionletter")).then(function(e){var t;function n(){var t;o=null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}const i=c({},r,{permissionLetterFilestoreId:null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0]}),a=function(){if(null!=te&&te.mutateAsync)return Promise.resolve(te.mutateAsync({bookingApplication:i})).then(function(){})}();return a&&a.then?a.then(n):n()})}();return i&&i.then?i.then(n):n()},function(e){console.error("getPermissionLetter error",e),w({key:"error",message:"Unable to fetch permission letter"})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}({tenantId:null==ne||null===(e=ne.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ne?void 0:ne.Payments[0]})}})),U||j?r.createElement(t.Loader,null):r.createElement("div",{className:"employee-main-application-details"},r.createElement("div",{style:{marginBottom:"15px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},D("ADS_APP_OVER_VIEW_HEADER")),r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},le&&le.length>0&&r.createElement("div",{style:{position:"relative",zIndex:10}},r.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>ee(!Q),displayOptions:Q,options:le,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"}))))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,D("ADS_APPLICATION_DETAILS_OVERVIEW")),r.createElement(t.StatusTable,null,(null==L?void 0:L.applicantData)&&(null===(g=Object.entries(null==L?void 0:L.applicantData))||void 0===g?void 0:g.map(e=>{let[n,o]=e;return r.createElement(t.Row,{key:n,label:D(""+(null==n?void 0:n.toUpperCase())),text:Array.isArray(o)?o.map(e=>D("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):D("object"==typeof o?(null==o?void 0:o.code)||"N/A":o||"N/A")})})))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,D("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")),null==L||null===(h=L.AdsDetails)||void 0===h?void 0:h.map((e,n)=>r.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:D("ADS_AD_TYPE"),text:D(e.adType)||e.adType}),r.createElement(t.Row,{label:D("ADS_LOCATION"),text:e.location||"N/A"}),r.createElement(t.Row,{label:D("ADS_FACE_AREA"),text:e.faceArea||"N/A"}),r.createElement(t.Row,{label:D("ADS_BOOKING_START_DATE"),text:e.bookingDate||"N/A"}),r.createElement(t.Row,{label:D("ADS_BOOKING_TIME"),text:e.bookingTime||"N/A"}),r.createElement(t.Row,{label:D("ADS_NIGHT_LIGHT"),text:e.nightLight}),r.createElement(t.Row,{label:D("ADS_STATUS"),text:D(e.status)||e.status}))))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,D("ADS_APPLICATION_DOCUMENTS_OVERVIEW")),r.createElement(n.Fragment,null,(null==V?void 0:V.documents.length)>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"30px"}},null==V?void 0:V.documents.map((e,t)=>r.createElement("div",{key:t},D(null==e?void 0:e.documentType),r.createElement(et,{value:null==V?void 0:V.documents,Code:null==e?void 0:e.documentType,index:t})))):r.createElement("div",{style:{padding:"0 1.5rem"}},D("TL_NO_DOCUMENTS_MSG"))),r.createElement(Ve,{application:V,id:(null==L||null===(y=L.applicantData)||void 0===y?void 0:y.applicationNo)||b,userType:"employee"}),x&&r.createElement(t.Toast,{error:"error"===x.key,label:x.label?D(x.label):x.message||x,style:{bottom:"0px"},onClose:()=>{w(null)}})),!(null!=oe&&oe.isLoading)&&Array.isArray(ie)&&ie.length>0&&r.createElement(t.ActionBar,null,K&&r.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_ADS",options:ie,optionKey:"buttonLabel",t:D,onSelect:e=>{!function(e){if(e){if("PAY"===e.action){var t;const e=(null==L||null===(t=L.applicantData)||void 0===t?void 0:t.applicationNo)||b;return _.push("/digit-ui/employee/payment/collect/adv-services/"+e+"/"+A+"?tenantId="+A)}if("SUBMIT"===e.action||"INITIATE"===e.action)return ae({Licenses:[{action:e.action,comment:e.action||""}]});X({action:e.action,comment:""}),J(!0)}}(e),$(!1)}}),r.createElement(t.SubmitBar,{ref:G,label:D("WF_TAKE_ACTION"),onSubmit:()=>$(!K)})),Z?r.createElement(Dt,{t:D,action:Y,tenantId:A,state:N,bookingNo:b,applicationDetails:z,applicationData:null==z?void 0:z.applicationData,closeModal:()=>{X(null),J(!1)},submitAction:ae,actionData:(null==oe||null===(E=oe.data)||void 0===E?void 0:E.processInstances)||[],businessService:(null==oe||null===(S=oe.data)||void 0===S?void 0:S.applicationBusinessService)||"ADV",moduleCode:"advandhoarding",workflowActions:ie,showToast:x,closeToast:()=>{w(null)},errors:I}):null,x&&r.createElement(t.Toast,{error:"error"===x.key,label:x.label?D(x.label):x.message||x,style:{bottom:"0px"},onClose:()=>{w(null)}}))},ADSApplicationDetails:()=>{var e,a,l,s,u,d,p,f,m,v,g;const[h,y]=n.useState([]),{t:E}=o.useTranslation(),{acknowledgementIds:S,tenantId:b}=(i.useHistory(),i.useParams()),[D,_]=n.useState([]),[A,T]=n.useState(!1),[C,N]=n.useState(!1),[x,w]=n.useState(null),[I,k]=n.useState(!1),[L,O]=n.useState(null),[R,P]=n.useState(!1),M=n.useRef(),[B,F]=n.useState(null),{isLoading:j,error:H,data:U}=(Digit.Hooks.useStore.getInitData(),Digit.Hooks.ads.useADSSearch({tenantId:b,filters:{bookingNo:S}})),[z,q]=(Digit.Hooks.ads.useADSCreateAPI(b,!1),n.useState(null)),W=yn(U,"bookingApplication",[]),V=yn(U,"bookingApplication[0].bookingNo",[]);console.log("adsData",U);let G=W&&W.length>0&&W[0]||{};const K=G;sessionStorage.setItem("ads",JSON.stringify(K));const[$,Y]=n.useState(!1),X=Digit.Hooks.useWorkflowDetails({tenantId:b,id:S,moduleCode:"advandhoarding"});console.log("workflowDetails :>> ",X);const Z=(null==X||null===(e=X.data)||void 0===e||null===(a=e.nextActions)||void 0===a?void 0:a.map(e=>c({},e,{action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase(),assignee:(null==e?void 0:e.assignee)||null,nextStateUuid:(null==e?void 0:e.nextState)||null})))||[];n.useEffect(()=>{y(Z)},[JSON.stringify(Z)]),Digit.Hooks.useClickOutside&&Digit.Hooks.useClickOutside(M,()=>{k(!1)},I);const{isLoading:J}=Digit.Hooks.ads.useADSSearch({tenantId:b,filters:{bookingNo:V,audit:!0}},{enabled:!0});let Q=[];if(Q=null!=(l=null==K?void 0:K.documents)?l:[],j||J||null!=X&&X.isLoading)return r.createElement(t.Loader,null);let ee=E("CS_NA");if(null!=G&&null!==(s=G.additionalDetails)&&void 0!==s&&s.documentDate){var te;const e=new Date(null==G||null===(te=G.additionalDetails)||void 0===te?void 0:te.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];ee=e.getDate()+" "+t+" "+e.getFullYear()}let ne=[];const re=[{Header:""+E("ADS_TYPE"),accessor:"addType"},{Header:""+E("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+E("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+E("ADS_BOOKING_START_DATE"),accessor:"bookingDate"},{Header:""+E("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:"bookingStatus"}],oe=(null==G||null===(u=G.cartDetails)||void 0===u?void 0:u.map(e=>({addType:""+E(e.addType),faceArea:""+E(e.faceArea),nightLight:""+E(!0===e.nightLight?"Yes":"No"),bookingDate:""+E(e.bookingDate),bookingStatus:""+E(e.status)})))||[];return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},E("ADS_BOOKING_DETAILS")),ne&&ne.length>0&&r.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>T(!A),displayOptions:A,options:ne})),r.createElement(t.Card,null,r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:E("ADS_BOOKING_NO"),text:null==G?void 0:G.bookingNo})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:E("ADS_APPLICANT_NAME"),text:(null==G||null===(d=G.applicantDetail)||void 0===d?void 0:d.applicantName)||E("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:E("ADS_MOBILE_NUMBER"),text:(null==G||null===(p=G.applicantDetail)||void 0===p?void 0:p.applicantMobileNo)||E("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:E("ADS_EMAIL_ID"),text:(null==G||null===(f=G.applicantDetail)||void 0===f?void 0:f.applicantEmailId)||E("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:E("PTR_ADDRESS"),text:(null==G||null===(m=G.address)||void 0===m?void 0:m.addressId)||E("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:E("ADS_ADDRESS_PINCODE"),text:(null==G||null===(v=G.address)||void 0===v?void 0:v.pincode)||E("CS_NA")})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("ADS_CART_DETAILS")),r.createElement(Oe,{t:E,data:oe,columns:re,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:oe.length}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,(null===(g=Q)||void 0===g?void 0:g.length)>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"30px"}},Q.map((e,t)=>r.createElement("div",{key:t},E(null==e?void 0:e.documentType),r.createElement(et,{value:Q,Code:null==e?void 0:e.documentType,index:t})))):r.createElement("div",{style:{padding:"0 1.5rem"}},E("TL_NO_DOCUMENTS_MSG"))),r.createElement(Ve,{application:K,id:null==G?void 0:G.bookingNo,userType:"citizen"})),x&&r.createElement(t.Toast,{error:"error"===x.key,label:B||H,onClose:()=>w(null),isDleteBtn:!0})))},ADSSearchApplication:y,ADSRequiredDoc:e=>{var n,o,i,a;let{t:l,onSelect:s,formData:u,value:c=u.adslist}=e;Digit.ULBService.getCurrentTenantId();const d=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:p,data:m={}}=Digit.Hooks.ads.useADSDocumentsMDMS(d,"Advertisement","Documents");let v=null==m||null===(n=m.Advertisement)||void 0===n?void 0:n.Documents;return r.createElement(r.Fragment,null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,l("MODULE_ADS")),r.createElement(t.CardSubHeader,null,r.createElement(Je,{timerValues:null==c||null===(o=c.existingDataSet)||void 0===o||null===(i=o.timervalue)||void 0===i?void 0:i.timervalue,SlotSearchData:null==c?void 0:c.cartDetails,draftId:null==c||null===(a=c.existingDataSet)||void 0===a?void 0:a.draftId}))),r.createElement("div",null,r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_HEADER")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_TEXT")),r.createElement(t.CardSubHeader,null,l("ADS_REQ_SCREEN_LABEL")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_LABEL_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_SIZE")),r.createElement("div",null,p&&r.createElement(t.Loader,null),Array.isArray(v)?v.map((e,n)=>{let{code:o,dropdownData:i}=e;return r.createElement("div",{key:n},r.createElement(t.CardSubHeader,null,n+1,". ",l("ADS_"+f(o,".","_"))),i.map((e,n)=>r.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",l("ADS_"+f(null==e?void 0:e.code,".","_")))))}):null)),r.createElement("span",null,r.createElement(t.SubmitBar,{label:l("ADS_COMMON_NEXT"),onSubmit:s}))))},LocationSearch:F,GIS:We,NewADSStepperForm:e=>{let{userType:a}=e;const l=("employee"===a?Mn:Bn).map(e=>c({},e,{currStepConfig:("employee"===a?Ln:On).filter(t=>t.stepNumber===e.stepNumber)})),{t:u}=(i.useHistory(),o.useTranslation()),d=s.useDispatch(),[p,f]=n.useState(null),m=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{d({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},u("ADS_REGISTRATION_APPLICATION")),r.createElement(kn,{stepsList:l,onSubmit:e=>{console.log("dataGet===",e)},step:m,setStep:e=>{d(Pn(e))}}),p&&r.createElement(t.Toast,{error:p.key,label:u(p.label),onClose:()=>{f(null)},isDleteBtn:"true"}))},NewADSStepFormOne:e=>{let{config:i,onGoNext:a,onBackClick:l}=e;const u=s.useDispatch(),{t:c}=o.useTranslation(),[d,p]=n.useState(!1),[f,m]=n.useState(""),v=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null," ",r.createElement(Fn,{onGoBack:function(e){l(i.key,e)},goNext:function(e){u(Rn(i.key,e)),console.log("conifg keyeeee",i.key),console.log("dataaaaa",e),a()},currentStepData:v,t:c})," ",d&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{p(!1),m("")}})," ")},NewADSStepFormTwo:e=>{let{config:i,onBackClick:a,onGoNext:l}=e;const{t:u}=o.useTranslation(),c=s.useDispatch(),[d,p]=n.useState(!1),[f,m]=n.useState(""),v=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement(jn,{onGoBack:function(e){a(i.key,e)},goNext:function(e){c(Rn(i.key,e)),l()},currentStepData:v,t:u}),d&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{p(!1),m("")}}))},NewADSStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{isLoading:v,data:g}=Digit.Hooks.ads.useADSDocumentsMDMS(m),h=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:h,config:o.currStepConfig,onSubmit:function(e){console.log("Data in step "+o.currStepNumber+" is: \n",e);const t=function(e){if(console.log("documents",e),!v){var t;const n=(null==e||null===(t=e.documents)||void 0===t?void 0:t.documents)||[],r=(g||[]).filter(e=>e.required).map(e=>e.code),o=n.map(e=>e.documentType);return r.filter(e=>!o.includes(e))}}(e);if(console.log("missingFields",t),t.length>0)return f("You haven't uploaded: "+t[0].replace(".","_").toUpperCase()),d(!0),void setTimeout(()=>{d(!1)},3e3);i()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!N.isEqual(t,h)),N.isEqual(t,h)||u(Rn(o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewADSStepFormFour:e=>{let{config:i,onGoNext:a,onBackClick:l}=e;const u=s.useDispatch(),{t:d}=o.useTranslation(),[p,f]=n.useState(!1),[m,v]=n.useState(""),{currentStepData:g,isLoading:h}=s.useSelector(e=>{var t,n,r;return{currentStepData:null===(t=e.ads.ADSNewApplicationFormReducer)||void 0===t?void 0:t.formData,isLoading:(null===(n=e.ads.ADSNewApplicationFormReducer)||void 0===n?void 0:n.isLoading)||!(null!==(r=e.ads.ADSNewApplicationFormReducer)&&void 0!==r&&r.formData)}});return h?null:r.createElement(n.Fragment,null,r.createElement(Hn,{onGoBack:e=>{const t=c({},g,{penalty:e});l(i.key,t)},goNext:e=>{const t=c({},g,{penalty:e});u(Rn(i.key,t)),a()},currentStepData:null==g?void 0:g.penalty,t:d}),p&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{f(!1),v("")}}))},NewADSStepFormFive:function(e){var o,a,l,u,d,p,f,m=e.config,v=e.onBackClick,g=e.t;const h=i.useHistory(),[y,E]=n.useState(!1),S=n.useRef(),[b,D]=n.useState([]);var _=s.useDispatch(),A=n.useState(!1),T=A[0],C=A[1];const x=window.location.href.includes("citizen"),w=x?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");var I=n.useState(""),k=I[0],L=I[1],O=s.useSelector(function(e){return e&&e.ads&&e.ads.ADSNewApplicationFormReducer&&e.ads.ADSNewApplicationFormReducer.formData||{}},N.isEqual),R=n.useRef(O);n.useEffect(function(){R.current=O},[O]);const P=(null==O?void 0:O.bookingNo)||(null==O||null===(o=O.CreatedResponse)||void 0===o?void 0:o.bookingNo)||"";console.log("globalBookingNo",P);const M=Digit.Hooks.useWorkflowDetails({tenantId:w,id:P,moduleCode:"advandhoarding-services"});console.log("live workflowDetails:",M),n.useEffect(()=>{var e,t;const n=null==M?void 0:M.data;if(console.log("wd :>> ",n),!n)return void D(e=>e&&e.length?[]:e);const r=n.processInstances&&n.processInstances.length?n.processInstances[0]:null,o=(r&&r.nextActions||n.nextActions||[]||[]).map(e=>({action:e.action,roles:e.roles||[],assignee:e.assignee||e.assignees||e.assigner||null,nextStateUuid:e.nextState||e.nextStateUuid||null,nextState:e.nextState||e.nextStateUuid||null,buttonLabel:(e.action||"").replace(/_/g," ").toUpperCase(),comment:e.comment||e.action||"",_rawAction:e})),i=Digit.UserService.getUser();let a=(null==i||null===(e=i.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.map(e=>e.code))||[];if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){var l,s,u;const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};a=(null==t||null===(l=t.value)||void 0===l||null===(s=l.info)||void 0===s||null===(u=s.roles)||void 0===u?void 0:u.map(e=>e.code))||a}const c=o.filter(e=>!e.roles||0===e.roles.length||a.some(t=>e.roles.includes(t)));D(e=>N.isEqual(e,c)?e:(console.log("wfActions from workflowDetails:",c),c))},[null==M||null===(a=M.data)||void 0===a?void 0:a.applicationBusinessService,null==M||null===(l=M.data)||void 0===l||null===(u=l.processInstances)||void 0===u?void 0:u.length]);var B=n.useRef(!0),F=n.useRef(null),j=n.useRef(null),H=n.useCallback(function(e){void 0===e&&(e=void 0);try{var t,n,r,o,i,a,l,s,u,d;const p=null==M?void 0:M.data;console.log("goNext called with:",e);const f=N.merge(N.cloneDeep(R.current),e||{});console.log("payloadState issss6666 :>> ",f);const m=null!==(t=e)&&void 0!==t&&t.action?e:(null===(n=e)||void 0===n||null===(r=n.Licenses)||void 0===r?void 0:r[0])||null,v=m.nextState||m.nextStateUuid||m.status||"";console.log("filtData :>> ",m);const y=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==m?void 0:m.assignee)||(null==m?void 0:m.assignees)||(null==m?void 0:m.assigneeUuid));if(!m||!m.action)return _(Rn("finalSubmission",f)),Promise.resolve();_(Rn("finalSubmission",f));const E=(null==p||null===(o=p.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i.state)||void 0===a?void 0:a.applicationStatus)||"",S={bookingApplication:c({tenantId:w},null==f?void 0:f.CreatedResponse,{bookingStatus:"INITIATED"===E?"BOOKING_CREATED":"REFUND"===E?"CANCELLED":E||(null==f||null===(l=f.CreatedResponse)||void 0===l?void 0:l.bookingStatus),documents:(null==f||null===(s=f.documents)||void 0===s||null===(u=s.documents)||void 0===u?void 0:u.documents)||(null==f?void 0:f.documents)||(null==f?void 0:f.Documents)||[],workflow:c({businessService:(null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService)||"ADV",states:v||E||"",action:m.action||"",comments:m.comment||m.action||"",status:E},y?{assignee:y}:{})})};if((null==m||!m.assignee)&&"FORWARD"===m.action)return L("Assignee is mandatory"),C(!0),Promise.resolve();const b=Ze(function(){return Promise.resolve(Digit.ADSServices.update(S,w)).then(function(e){var t;if(console.log("ADS Update response:",e),"SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)){var n,r,o,i,a,l,s,u,d,p,m;const e=c({},(null===(n=Digit)||void 0===n||null===(r=n.Store)||void 0===r||null===(o=r.getState)||void 0===o||null===(i=o.call(r))||void 0===i||null===(a=i.ads)||void 0===a||null===(l=a.ADSNewApplicationFormReducer)||void 0===l?void 0:l.formData)||R.current||{},f),t=Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}));_(Rn("formData",t)),h.replace(x?"/digit-ui/citizen/ads/adsservice/response/"+(null===(s=R.current)||void 0===s||null===(u=s.CreatedResponse)||void 0===u?void 0:u.bookingNo):"/digit-ui/employee/ads/adsservice/response/"+(null===(d=R.current)||void 0===d||null===(p=d.CreatedResponse)||void 0===p?void 0:p.bookingNo),{applicationData:null===(m=R.current)||void 0===m?void 0:m.CreatedResponse})}else L(g&&g("SOMETHING_WENT_WRONG")||"Failed to update"),C(!0)})},function(e){console.error("ADS update error:",e),L(g&&g("SOMETHING_WENT_WRONG")||"Failed to update"),C(!0)});return Promise.resolve(b&&b.then?b.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[w,g,_,null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService,h,x]);function U(e){v(m.key,e)}var z=n.useCallback(function(){var e=arguments.length>1?arguments[1]:void 0;B.current?B.current=!1:e&&(N.isEqual(e,R.current)||F.current&&N.isEqual(e,F.current)||(j.current&&clearTimeout(j.current),j.current=setTimeout(function(){const t=N.omitBy(N.cloneDeep(e),e=>void 0===e);if(console.log("cleanStep keys",Object.keys(t)),"summary"===(null==m?void 0:m.key)&&1===Object.keys(t).length&&""===t.summary)return;const n=N.merge({},R.current,t);Object.keys(t).length>0&&!N.isEqual(n,R.current)&&(F.current=n,_(Rn("formData",n)))},100)))},[_,m&&m.key]);n.useEffect(function(){return function(){j.current&&clearTimeout(j.current)}},[]),console.log("defaultValues keys:",Object.keys(O||{}));const q=r.useMemo(()=>{const e=O||{};return void 0===e.summary?c({},e,{summary:""}):e},[O]);let W=Digit.UserService.getUser();null==W||null===(p=W.info)||void 0===p||null===(f=p.roles)||void 0===f||f.map(e=>e.code);const V=r.useMemo(()=>b||[],[b]);return Digit.Hooks.useClickOutside(S,()=>{E(!1)},y),r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:q,config:m&&m.currStepConfig,onSubmit:e=>H(c({},e,{_isFormSubmit:!0})),onFormValueChange:z,label:g&&m&&m.texts?g(m.texts.submitBarLabel):"",currentStep:m&&m.currStepNumber,onBackClick:U}),T&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:k,onClose:function(){C(!1),L("")}}),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:g("CS_COMMON_BACK"),onSubmit:U,variant:"secondary"}),y&&r.createElement(t.Menu,{localeKeyPrefix:"",options:V,optionKey:"action",t:g,onSelect:e=>{!function(e){var t;if(!e)return;const n=new Set(["SUBMIT","INITIATE","PAY"]),r=e.fromStateCode||(null===(t=e._rawStateObj)||void 0===t?void 0:t.state)||null,o=e.toStateCode||null,i=n.has(e.action)?o||r||e.nextStateUuid:r||o||e.nextStateUuid;H({action:e.action,nextState:e.nextState||e.nextStateUuid||null,status:i||"",comment:e.comment||e.action||"",assignee:e.assignee||null,_rawAction:e})}(e),E(!1)}}),r.createElement(t.SubmitBar,{ref:S,label:g("WF_TAKE_ACTION"),onSubmit:()=>E(!y)})))},ADSCitizenDetailsNew:Fn,ADSCitizenSecond:jn,ADSSelectProofIdentity:e=>{var o;let{t:i,config:a,onSelect:l,formData:s}=e;const u=Digit.ULBService.getStateId(),[d,p]=n.useState({}),[f,m]=n.useState(null),[v,g]=n.useState(!1),h={maxBytes:5242880,allowedExtensions:[".pdf",".jpeg",".jpg",".png"]},y=(e,t)=>{var n,r;if(!e)return null;const o=h.maxBytes;let i=[...h.allowedExtensions];"OWNER.OWNERPHOTO"!==t&&"PET.PETPHOTO"!==t||(i=[".jpeg",".jpg",".png"]);const a=(null==e||null===(n=e.name)||void 0===n||null===(r=n.toLowerCase)||void 0===r?void 0:r.call(n))||"";return i.some(e=>a.endsWith(e))?e.size>o?"CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED":null:"CS_FILE_INVALID_TYPE"},E=e=>{const t=(e||[]).filter(e=>null==e?void 0:e.required);return function(e){void 0===e&&(e=[]);const n={},r=[],o=Array.isArray(e)?e:[];if(!t.length)return n;for(const e of t)o.some(t=>{var n;return(null===(n=t.documentType)||void 0===n?void 0:n.includes(e.code))&&(t.filestoreId||t.fileStoreId)})||r.push(i(null==e?void 0:e.code.replaceAll(".","_")));return r.length>0&&(n.missingRequired="PTR_MISSING_REQUIRED_DOCUMENTS",n.missingDocs=r),n}},{isLoading:S,data:b}=Digit.Hooks.ads.useADSDocumentsMDMS(u),[D,_]=n.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]);n.useEffect(()=>{if(b){const e=E(b)(D);p(e)}},[D,b]),n.useEffect(()=>{var e;const t=(null==s||null===(e=s.documents)||void 0===e?void 0:e.documents)||[];N.isEqual(t,D)||_(t)},[s]);const A=r.useRef();return n.useEffect(()=>{N.isEqual(A.current,D)||(A.current=D,l(a.key,{documents:D}))},[D,a.key]),r.createElement("div",null,S?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:i,config:a,onSelect:()=>{if(g(!0),Object.keys(d).length>0)return m(i(d.missingRequired||"PTR_VALIDATION_ERROR")),void l(a.key,{missingDocs:d.missingDocs||[]});let e=c({},b,{documents:D});l(a.key,e)},onSkip:()=>l(),isDisabled:Object.keys(d).length>0},Array.isArray(b)&&b.map((e,t)=>{const n=D.find(t=>t.documentType===e.code);return r.createElement($n,{key:t,document:c({},e,n),t:i,setDocuments:_,documents:D,validateFile:y,makeDocumentsValidator:E,mdms:b,setFormErrors:p,formErrors:d})}),f&&r.createElement(t.Toast,{isDleteBtn:!0,label:f,onClose:()=>m(null),error:!0})))},ADSSummary:function(e){var n,o,i,a,l,u,c,d;let{t:p}=e;const f=s.useDispatch(),m=e=>p?p(e):e,v=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer.formData),g=r.useMemo(()=>v||{},[v]);console.log("formData",g);const h=(null===(n=g.CreatedResponse)||void 0===n?void 0:n.applicantDetail)||{},y=(null==g||null===(o=g.ownerDetails)||void 0===o?void 0:o.address)||(null===(i=g.CreatedResponse)||void 0===i?void 0:i.address)||{},E=Array.isArray(null===(a=g.CreatedResponse)||void 0===a?void 0:a.cartDetails)?null===(l=g.CreatedResponse)||void 0===l?void 0:l.cartDetails:[],S=Array.isArray(null===(u=g.documents)||void 0===u||null===(c=u.documents)||void 0===c?void 0:c.documents)?g.documents.documents.documents:Array.isArray(null===(d=g.documents)||void 0===d?void 0:d.documents)?g.documents.documents:Array.isArray(g.documents)?g.documents:[],b={backgroundColor:"#ffffff",padding:"1rem 0",borderRadius:"8px",marginBottom:"1.5rem",boxShadow:"0 2px 6px rgba(18,38,63,0.04)"},D={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem",padding:"0 1.5rem"},_={fontSize:"1.25rem",color:"#0d43a7",fontWeight:"600",margin:0},A={cursor:"pointer",color:"#2e86de",fontWeight:600,fontSize:"0.9rem"},T={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e9eef2",padding:"0.6rem 1.5rem",alignItems:"center"},C={flex:"1 1 220px",minWidth:"180px",maxWidth:"260px",backgroundColor:"#fbfcfe",padding:"0.6rem",border:"1px solid #eef3f7",borderRadius:"6px"},N={fontWeight:"500",color:"#333"},x=(e,n)=>r.createElement("div",{style:T},r.createElement("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"}},r.createElement(t.CardLabel,{style:N},e)),r.createElement("div",{style:{textAlign:"right",minWidth:"120px"}},n||"NA"));return r.createElement("div",{className:"application-summary"},r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:b},r.createElement("div",{style:D},r.createElement("h3",{style:_},m("Applicant Details")),r.createElement("span",{style:A,onClick:()=>f(Pn(2))},m("EDIT"))),x(m("Applicant Name"),h.applicantName),x(m("Mobile Number"),h.applicantMobileNo),x(m("Email ID"),h.applicantEmailId),x(m("Pincode"),y.pincode),x(m("Address"),y.addressId))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:b},r.createElement("div",{style:D},r.createElement("h3",{style:_},m("Advertisement Details")),r.createElement("span",{style:A,onClick:()=>f(Pn(1))},m("EDIT"))),E.length?E.map((e,t)=>r.createElement(r.Fragment,{key:t},x(m("Site ID"),e.advertisementId),x(m("Site Name"),e.location),x(m("Geolocation"),(e=>{if(!e)return"NA";if("string"==typeof e)return e;try{const t=JSON.stringify(e);return t.length>120?t.slice(0,117)+"...":t}catch(e){return"NA"}})(e.geoLocation)),x(m("Advertisement Type"),e.addType),x(m("Booking Date"),e.bookingDate),x(m("End Date"),e.endDate),x(m("Address"),e.location),x(m("Face Area"),e.faceArea))):x(m("Advertisement Details"),"NA"))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:b},r.createElement("div",{style:D},r.createElement("h3",{style:_},m("ADS_DOCUMENTS_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Pn(3))},m("EDIT"))),S.length>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",marginTop:"0.5rem"}},S.map((e,t)=>r.createElement("div",{key:t,style:C},m(null==e?void 0:e.documentType),r.createElement(et,{value:S,Code:null==e?void 0:e.documentType,index:t})))):r.createElement("div",{style:{padding:"0 1.5rem"}},p("TL_NO_DOCUMENTS_MSG")))))},ADSPenalty:Hn,ADSResponseCitizen:e=>{var n;const a=window.location.href.includes("citizen");console.log("props",e);const{state:l}=e.location,{t:s}=o.useTranslation(),u=i.useHistory(),c=null==l?void 0:l.applicationData;console.log("state",l),console.log("applicationData",c);const d=a?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),p=((null==u||null===(n=u.location)||void 0===n?void 0:n.pathname)||"").split("/").pop();return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:s("ADS_BOOKED_HEADER"),applicationNumber:p,info:"REJECTED"==(null==c?void 0:c.bookingStatus)?"":s("ADS_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.bookingStatus)?r.createElement(t.CardText,null,s("ADS_BOOKED_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{u.push(a?"/digit-ui/citizen":"/digit-ui/employee")}}),r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{u.push(a?"/digit-ui/citizen/ads-home":"/digit-ui/employee/ads/inbox")}}),r.createElement(t.SubmitBar,{label:s("COMMON_MAKE_PAYMENT"),onSubmit:()=>{u.push(a?"/digit-ui/citizen/payment/collect/adv-services/"+p+"/"+d+"?tenantId="+d:"/digit-ui/employee/payment/collect/adv-services/"+p+"/"+d+"?tenantId="+d)}}))))}},Jn=e=>{let{stateCode:t,userType:o,tenants:a}=e;const{path:l,url:s}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"ADS",language:u}),Object.entries(Zn).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("ADS_TENANTS",a),n.useEffect(()=>"employee"===o&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===o?r.createElement(ht,{path:l,url:s,userType:o}):r.createElement(D,null)},Qn=e=>{const{t:i}=o.useTranslation(),[a,l,s]=Digit.Hooks.useSessionStorage("ADS",{});return n.useEffect(()=>{s()},[]),r.createElement(t.CitizenHomeCard,{header:i("ADVERTISEMENT_MODULE"),links:[],Icon:()=>r.createElement(Ue,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:Jn,ADSLinks:Qn,ADSCard:nt,ADS_INBOX_FILTER:e=>r.createElement(w,e),ADSInboxTableConfig:e=>({ADS:{inboxColumns:t=>[{Header:e("ADS_BOOKING_NO"),Cell:e=>{var n,o,a,l;let{row:s}=e;return console.log("row is :>> ",s),r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(i.Link,{to:t.parentRoute+"/applicationsearch/application-details/"+(null==s||null===(n=s.original)||void 0===n||null===(o=n.searchData)||void 0===o?void 0:o.bookingNo)},null===(a=s.original)||void 0===a||null===(l=a.searchData)||void 0===l?void 0:l.bookingNo)))},mobileCell:e=>{var t;return k(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r,o,i;return I(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(r=n.original)||void 0===r||null===(o=r.searchData)||void 0===o||null===(i=o.applicantDetail)||void 0===i?void 0:i.applicantName))},mobileCell:e=>{var t,n;return k(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.applicantName)}},{Header:e("AD _TYPE"),Cell:e=>{var t,n,r,o;let{row:i}=e;return I(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(r=n.cartDetails)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.addType))},mobileCell:e=>{var t,n,r;return k(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.cartDetails)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.addType)}},{Header:e("BOOKING_STATUS"),Cell:t=>{var n,r,o;let{row:i}=t;return I(e(""+(null==i||null===(n=i.original)||void 0===n||null===(r=n.workflowData)||void 0===r||null===(o=r.state)||void 0===o?void 0:o.applicationStatus)))},mobileCell:t=>{var n,r;return k(e("ES_ADS_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(r=n.state)||void 0===r?void 0:r.applicationStatus)))}},{Header:e("ADS_DATE"),Cell:e=>{var t,n;let{row:r}=e;const o=null===(t=r.original)||void 0===t||null===(n=t.searchData)||void 0===n?void 0:n.applicationDate,i=o?new Date(o).toLocaleDateString("en-GB"):"";return I(i)},mobileCell:e=>{var t;const n=null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationDate,r=n?new Date(n).toLocaleDateString("en-GB"):"";return k(r)}}],serviceRequestIdKey:t=>{var n,r;return null==t||null===(n=t[e("ADS_INBOX_UNIQUE_BOOKING_NUMBER")])||void 0===n||null===(r=n.props)||void 0===r?void 0:r.children}}})},exports.ADSLinks=Qn,exports.ADSModule=Jn,exports.ADSReducers=()=>u.combineReducers({ADSNewApplicationFormReducer:Xn});
|