1"use strict";(globalThis.webpackChunkverisure_owa=globalThis.webpackChunkverisure_owa||[]).push([[3123],{5997(e,i,a){a.r(i),a.d(i,{DeactivatedCarCrash:()=>K,default:()=>G});var n=a(5247),t=a(43433),s=a(69884),o=a(61884),r=a(3200),c=a(38041),C=a.n(c),l=a(56432),d=a(42730),A=a(40630),v=a(71070),h=a(34366),E=a(83849),m=a(95881),R=a(50731),x=a(10438),u=a(8055),g=a(2172),T=a(47378),_=a(64840),j=a(6168),I=a(84151),N=a(42866);const w="CWi_0n",S="kmLTN7",p="WsYtSC",V="q3cWCz",f="gWKgmM",O="yA5APQ",U="kJxtq9",H="hVWBa2",b="mZ20mB",y="UzclqV",k="QhUHg3",M="VpRx0w",D="M4Fr4O",P="GJj_dy";var L=a(51367);const K=e=>{let{navigate:i}=e;const[a,t]=(0,n.useState)(!1);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:y,children:[(0,L.jsx)("img",{className:f,src:_.Cy,alt:_.Cy}),(0,L.jsx)("p",{className:k,children:(0,L.jsx)(r.x6,{i18nKey:"CarCrash.mainView.initInfo.label"})}),(0,L.jsxs)("div",{className:M,children:[(0,L.jsx)(A.$n,{"id-owa":"CarCrash-showLearnMore",text:(0,o.t)("common.learnMore"),onClick:()=>t(!0)}),(0,L.jsx)(A.$n,{"id-owa":"CarCrash-startActivation",text:(0,o.t)("CarCrash.mainView.start.button"),color:v.v.WHITE_RED,onClick:()=>{(0,I.logUserEvent)(N.CARCRASH_ACTIVATION_INITIATE)(),i(l.J.CC_ACTIVATION)}})]})]}),a&&(0,L.jsx)(E.vQ,{onFinish:()=>t(!1)})]})},F=e=>{let{location:i}=e;const a=i?{icon:"icon-motion-detection",info:"CarCrash.mainView.needActivity.info",btn:"CarCrash.mainView.needActivity.btn"}:{icon:"icon-location",info:"CarCrash.mainView.needLocation.info",btn:"CarCrash.mainView.needLocation.btn"};return(0,L.jsxs)("div",{className:w,children:[(0,L.jsx)("img",{className:f,src:_.xC,alt:""}),(0,L.jsxs)("div",{className:O,children:[(0,L.jsx)("div",{className:U,children:(0,o.t)("CarCrash.mainView.deactivated.info")}),(0,L.jsxs)("div",{className:H,children:[(0,L.jsx)(A.In,{icon:a.icon}),(0,o.t)("CarCrash.mainView.needPermissions.title")]}),(0,L.jsx)("div",{className:b,children:(0,L.jsx)(r.x6,{i18nKey:a.info})}),(0,L.jsx)(A.$n,{"id-owa":"CarCrash-permissions-"+(i?"activity":"location"),text:(0,o.t)(a.btn),color:v.v.WHITE_RED,onClick:()=>{i?(0,g.wr)(u.hR.CARCRASH):(0,g.Ch)(u.hR.CARCRASH)}})]})]})},J=()=>{const[e,i]=(0,n.useState)(!1),[a,s]=(0,n.useState)(null),r=(0,T.wP)(),{device:{uuid:c}={}}=(0,T.E8)(),C=(0,t.wA)(),[l,{loading:d}]=(0,h.lb)(j.Y7,{fetchPolicy:h.bV.NETWORK_ONLY,variables:{numinst:r,deviceUuid:c},onCompleted:e=>{"OK"===(null===e||void 0===e?void 0:e.res)?((0,I.logUserEvent)(N.CARCRASH_DEACTIVATION_COMPLETED)(),(0,g.pu)({numinst:r}),C((0,R.x)({forceUpdate:!0}))):((0,I.logUserEvent)(N.CARCRASH_DEACTIVATION_ERROR)({error:null===e||void 0===e?void 0:e.msg}),s(null===e||void 0===e?void 0:e.msg))},onError:e=>{const i=(null===e||void 0===e?void 0:e.message)||(0,o.t)("common.error");(0,I.logUserEvent)(N.CARCRASH_DEACTIVATION_ERROR)({error:i}),s(i)},onFinally:()=>i(!1)});return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:D,children:(0,L.jsx)(A.$n,{"id-owa":"CarCrash-deactivate",text:(0,o.t)("CarCrash.mainView.Deactivation.button"),onClick:()=>{(0,I.logUserEvent)(N.CARCRASH_MAIN_MENU_CLICK_DEACTIVATION)({screen:_.E5.DEACTIVATE_SERVICE}),i(!0)}})}),a&&(0,L.jsx)(A.AA,{"id-owa":"Carcrash-deactivation-error",description:a,onCancel:()=>s(null)}),e&&(0,L.jsx)(A.mt,{title:(0,o.t)("CarCrash.mainView.deactivationModal.title"),hasAcceptButton:!0,acceptDisabled:d,acceptText:(0,o.t)("AppConfig.AppConfig.yes.button"),onAccept:()=>{(0,I.logUserEvent)(N.CARCRASH_DEACTIVATION_INITIATE)(),l()},hasCancelButton:!0,cancelText:(0,o.t)("common.goBack"),onCancel:()=>i(!1),children:(0,L.jsx)("div",{className:P,children:(0,o.t)("CarCrash.mainView.deactivationModal.info")})})]})},W=e=>{let{navigate:i,deactiveCC:a}=e;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A.Zp,{noPadding:!0,children:(0,L.jsx)(A.E7,{"id-owa":"CarCrash-contacts",text:(0,o.t)("CarCrash.mainView.contacts.label"),icon:"icon-arrow-right",iconColor:"red",onClick:()=>{(0,I.logUserEvent)(N.CARCRASH_MAIN_MENU_START)({screen:_.E5.EMERGENCY_CONTACT}),i(l.J.CC_CONFIG,{state:{config:"contacts"}})}})}),(0,L.jsx)(A.Zp,{noPadding:!0,children:(0,L.jsx)(A.E7,{"id-owa":"CarCrash-pers
1onalInfo",text:(0,o.t)("CarCrash.mainView.personalinfo.label"),icon:"icon-arrow-right",iconColor:"red",onClick:()=>{(0,I.logUserEvent)(N.CARCRASH_MAIN_MENU_START)({screen:_.E5.EDIT_CARCRASH_DATA}),i(l.J.CC_CONFIG,{state:{config:"personalInfo"}})}})}),(0,L.jsx)(A.Zp,{noPadding:!0,children:(0,L.jsx)(A.E7,{"id-owa":"CarCrash-travelHistory",text:(0,o.t)("CarCrash.mainView.travelHistory.label"),icon:"icon-arrow-right",iconColor:"red",onClick:()=>{(0,I.logUserEvent)(N.CARCRASH_MAIN_MENU_START)({screen:_.E5.TRIPS_SECTION}),i(l.J.CC_TRAVELHISTORY)}})}),(0,L.jsx)(J,{deactiveCC:a})]})},B=e=>{let{permissions:i,navigate:a,deactiveCC:n}=e;return(0,L.jsxs)(L.Fragment,{children:[i.location&&i.activity?(0,L.jsxs)("div",{className:C()(w,S),children:[(0,L.jsx)(A.In,{icon:"icon-checkmark",className:p}),(0,o.t)("CarCrash.mainView.activated.info"),(0,L.jsx)("div",{className:V,children:(0,o.t)("CarCrash.mainView.carcrashActivationOK.info")})]}):(0,L.jsx)(F,{location:i.location}),(0,L.jsx)(W,{navigate:a,deactiveCC:n})]})},G=n.memo(()=>{const[{location:e,activity:i},a]=(0,n.useState)({}
1),[r,c]=(0,n.useState)(!1),[C,v]=(0,n.useState)(!0),E=(0,s.Zp)(),u=(0,s.zy)(),{source:w=""}=(null===u||void 0===u?void 0:u.state)||{},S=(0,T.wP)(),{device:{uuid:p}={}}=(0,T.E8)(),{forceUpdate:V}=(0,T.LB)(),f=(0,t.wA)(),O=(0,T.tp)(),{error:U,loading:H}=(0,h.Je)(j.uT,{...V&&{fetchPolicy:h.bV.NETWORK_ONLY},variables:{numinst:S,deviceUuid:p},onError:e=>{(0,I.logUserEvent)(N.CARCRASH_ACCESS_ERROR)({error:e,source:w})},onCompleted:e=>{const{token:i,status:n,actionPlan:t}=(null===e||void 0===e?void 0:e.assistanceServiceLicense)||{};i&&(0,g.cu)({token:i}),"OK"===(null===e||void 0===e?void 0:e.res)?f((0,R.x)({status:n,actionPlan:t,forceUpdate:!1,token:i})):f((0,R.G)()),(0,_.AQ)({numinst:S}).then(e=>{const i=n===_.jq.ACTIVE,t=e[0].value||{},s=e[1].value||{};c(i&&"true"===t.active),a({...s}),"true"!==t.active&&i&&(f((0,x.Bg)(!1)),E(l.J.CHECKSERVICE,{state:{carCrash:{isAvailable:!0,isActivated:!1,needActivation:!0},permissions:{...s}}})),v(!1)}),w&&(0,I.logUserEvent)(N.CARCRASH_ACCESS_COMPLETED)({source:w})}}),b=C||H;return(0,n.useEffect)(()=>{w?(0,I.logUserEvent)(N.CARCRASH_ACCESS_START)({source:w}):(0,I.logUserEvent)(N.CARCRASH_RELOAD_CLICK)()},[]),(0,n.useEffect)(()=>{O&&(f((0,m.PQ)(!1)),(0,_.rW)().then(e=>a(e)))},[O]),(0,L.jsxs)(d.U3,{title:(0,o.t)("CarCrash.mainView.title.label"),contentArea:{type:d.U3.contentArea.MAIN,configUrl:l.J.CC_CARDCONFIG},services:["CARCRASH"],children:[b&&(0,L.jsx)(d.Rh,{withSomeHeight:!0}),!b&&!r&&(0,L.jsx)(K,{navigate:E}),!b&&r&&(0,L.jsx)(B,{permissions:{location:e,activity:i},navigate:E,deactiveCC:()=>c(!1)}),U&&(0,L.jsx)(A.AA,{"id-owa":"Carcrash-error",description:U,onCancel:()=>E(l.J.HOME)})]})})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.