bonuspluscomponents 0.0.138 → 0.0.139
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingContext.d.ts","sourceRoot":"","sources":["../../../src/AppContext/Context/LoadingContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LoadingContext.d.ts","sourceRoot":"","sources":["../../../src/AppContext/Context/LoadingContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAG5E,KAAK,cAAc,GAAG;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D,CAAC;AAUF,eAAO,MAAM,cAAc,+BAAsC,CAAC;AAsBlE,eAAO,MAAM,eAAe;cAA4B,WAAW;6CAIlE,CAAC"}
|
|
@@ -30,7 +30,7 @@ Check the top-level render call using <`+pe+">.")}return ie}}function Zt(k,ie){{
|
|
|
30
30
|
@font-face {
|
|
31
31
|
font-family: bonusPlus, Fallback, sans-serif;
|
|
32
32
|
}
|
|
33
|
-
`}}});ji=Te.responsiveFontSizes(ji);const hs=ji,Rm={isLoading:!1,setIsLoading(e,t){}},Ln=q.createContext(Rm),Mm=()=>{const[e,t]=q.useState([]),n=(r,o)=>{t(o?i=>i.filter(s=>s.id!==r)
|
|
33
|
+
`}}});ji=Te.responsiveFontSizes(ji);const hs=ji,Rm={isLoading:!1,setIsLoading(e,t){}},Ln=q.createContext(Rm),Mm=()=>{const[e,t]=q.useState([]),n=(r,o)=>{t(o?i=>[...i,{id:r}]:i=>i.filter(s=>s.id!==r))};return{isLoading:e.length!==0,setIsLoading:n}},km=({children:e})=>{const t=Mm();return f.jsx(Ln.Provider,{value:t,children:e})},$m={openedPage:"info",setOpenedPage:null},Ro=q.createContext($m),_m=()=>{const[e,t]=q.useState("info");return{openedPage:e,setOpenedPage:t}},Im=({children:e})=>{const t=_m();return f.jsx(Ro.Provider,{value:t,children:e})},Nm={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,setCabinetSettings:null,cabinetUISettings:null,authToken:null,setAuthToken:null,createAxios:null,theme:null,customer:null,VKUserId:null,setVKUserId:null,additionalData:null,setAdditionalData:null},Ft=q.createContext(Nm),jm=({cabinetType:e})=>{const{setIsLoading:t}=q.useContext(Ln),{setOpenedPage:n}=q.useContext(Ro),[r,o]=q.useState(null),[i,s]=q.useState(null),[l,c]=q.useState(null),[u,d]=q.useState(null),[p,h]=q.useState(null);q.useState(null);const[v,b]=q.useState({}),m=()=>Hu.create({baseURL:p??"",headers:{Authorization:`Bearer ${l}`,"X-CabinetType":e,"X-PhoneNumber":i}}),y=hs,[E,P]=q.useState(null),[x,C]=q.useState(null);return q.useEffect(()=>{(async()=>{if(!l||!i||e===null)return;t("GetCabinetSettings",!0);const R=await m().post("/externalCustomerCabinet/cabinetInfo",{});P(R.data),R.data.isReg&&n("registration"),t("GetCabinetSettings",!1)})()},[i,l]),q.useEffect(()=>{(async()=>{if(!l||!i||e===null||!E||E!=null&&E.isReg)return;t("GetCustomerInfo",!0);const R=await m().post("/externalCustomerCabinet/customer/info",{VKUserId:r});d({...R.data.customer,eCardCustomerLink:R.data.eCardCustomerLink}),t("GetCustomerInfo",!1)})()},[i,E]),q.useEffect(()=>{(async()=>{if(!l)return;t("GetCabinetUISettings",!0);const R=await m().post("/externalCustomerCabinet/settings",{});C(R.data.settings),t("GetCabinetUISettings",!1)})()},[l]),{cabinetType:e,apiAxios:m,cabinetIsLoading:!1,cabinetSettings:E,setCabinetSettings:P,cabinetUISettings:x,phoneNumber:i,setPhoneNumber:s,authToken:l,setAuthToken:c,createAxios:(O,D)=>{c(O),h(D)},theme:y,setVKUserId:o,VKUserId:r,customer:u,additionalData:v,setAdditionalData:b}},Am=({children:e,cabinetType:t})=>{const n=jm({cabinetType:t});return f.jsx(Ft.Provider,{value:{...n,cabinetType:t},children:e})},Ku=({fileValue:e})=>{const{cabinetUISettings:t}=q.useContext(Ft),n=e?`url(data:image/png;base64,${e})`:`url(${t==null?void 0:t.headerImageUrl})`;return f.jsx(Te.Typography,{variant:"h2",component:"div",children:f.jsx("div",{className:"header",style:{backgroundColor:t==null?void 0:t.headerColor},children:f.jsx(Te.Container,{maxWidth:"sm",sx:{paddingBottom:`${t==null?void 0:t.paddingBottom}px`,paddingTop:`${t==null?void 0:t.paddingTop}px`},children:t!=null&&t.headerUrlRedirect?f.jsx("a",{href:t==null?void 0:t.headerUrlRedirect,target:"_blank",children:f.jsx("div",{className:"header__img",style:{backgroundImage:n}})}):f.jsx("div",{className:"header__img",style:{backgroundImage:n}})})})})};class Lm extends q.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.log({error:t,errorInfo:n})}render(){return this.state.hasError?f.jsx("h1",{children:"Что-то пошло не так"}):this.props.children}}var vs={},Qu={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Qu);var St=Qu.exports,mi={};function gn(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function Zn(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Xu(e){if(!Zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Xu(e[n])}),t}function Ht(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return Zn(e)&&Zn(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Zn(t[o])&&o in e&&Zn(e[o])?r[o]=Ht(e[o],t[o],n):n.clone?r[o]=Zn(t[o])?Xu(t[o]):t[o]:r[o]=t[o])}),r}var Ai={exports:{}},Yo={exports:{}},Ue={};/** @license React v16.13.1
|
|
34
34
|
* react-is.production.min.js
|
|
35
35
|
*
|
|
36
36
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -725,7 +725,7 @@ const Ps = Hi, ch = {
|
|
|
725
725
|
}
|
|
726
726
|
}, cr = _o(ch), uh = () => {
|
|
727
727
|
const [e, t] = ke([]), n = (r, o) => {
|
|
728
|
-
t(o ? (i) => i
|
|
728
|
+
t(o ? (i) => [...i, { id: r }] : (i) => i.filter((s) => s.id !== r));
|
|
729
729
|
};
|
|
730
730
|
return {
|
|
731
731
|
isLoading: e.length !== 0,
|
|
@@ -30,7 +30,7 @@ Check the top-level render call using <`+pe+">.")}return ie}}function rn(R,ie){{
|
|
|
30
30
|
@font-face {
|
|
31
31
|
font-family: bonusPlus, Fallback, sans-serif;
|
|
32
32
|
}
|
|
33
|
-
`}}});bi=Ce.responsiveFontSizes(bi);const xi=bi,Em={isLoading:!1,setIsLoading(e,t){}},$n=H.createContext(Em),Pm=()=>{const[e,t]=H.useState([]),n=(r,o)=>{t(o?i=>i.filter(s=>s.id!==r)
|
|
33
|
+
`}}});bi=Ce.responsiveFontSizes(bi);const xi=bi,Em={isLoading:!1,setIsLoading(e,t){}},$n=H.createContext(Em),Pm=()=>{const[e,t]=H.useState([]),n=(r,o)=>{t(o?i=>[...i,{id:r}]:i=>i.filter(s=>s.id!==r))};return{isLoading:e.length!==0,setIsLoading:n}},Om=({children:e})=>{const t=Pm();return f.jsx($n.Provider,{value:t,children:e})},Dm={openedPage:"info",setOpenedPage:null},zr=H.createContext(Dm),Sm=()=>{const[e,t]=H.useState("info");return{openedPage:e,setOpenedPage:t}},Mm=({children:e})=>{const t=Sm();return f.jsx(zr.Provider,{value:t,children:e})},km={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,setCabinetSettings:null,cabinetUISettings:null,authToken:null,setAuthToken:null,createAxios:null,theme:null,customer:null,VKUserId:null,setVKUserId:null,additionalData:null,setAdditionalData:null},Nt=H.createContext(km),Rm=({cabinetType:e})=>{const{setIsLoading:t}=H.useContext($n),{setOpenedPage:n}=H.useContext(zr),[r,o]=H.useState(null),[i,s]=H.useState(null),[l,c]=H.useState(null),[u,d]=H.useState(null),[p,h]=H.useState(null);H.useState(null);const[v,b]=H.useState({}),m=()=>Ll.create({baseURL:p??"",headers:{Authorization:`Bearer ${l}`,"X-CabinetType":e,"X-PhoneNumber":i}}),y=xi,[E,P]=H.useState(null),[x,T]=H.useState(null);return H.useEffect(()=>{(async()=>{if(!l||!i||e===null)return;t("GetCabinetSettings",!0);const M=await m().post("/externalCustomerCabinet/cabinetInfo",{});P(M.data),M.data.isReg&&n("registration"),t("GetCabinetSettings",!1)})()},[i,l]),H.useEffect(()=>{(async()=>{if(!l||!i||e===null||!E||E!=null&&E.isReg)return;t("GetCustomerInfo",!0);const M=await m().post("/externalCustomerCabinet/customer/info",{VKUserId:r});d({...M.data.customer,eCardCustomerLink:M.data.eCardCustomerLink}),t("GetCustomerInfo",!1)})()},[i,E]),H.useEffect(()=>{(async()=>{if(!l)return;t("GetCabinetUISettings",!0);const M=await m().post("/externalCustomerCabinet/settings",{});T(M.data.settings),t("GetCabinetUISettings",!1)})()},[l]),{cabinetType:e,apiAxios:m,cabinetIsLoading:!1,cabinetSettings:E,setCabinetSettings:P,cabinetUISettings:x,phoneNumber:i,setPhoneNumber:s,authToken:l,setAuthToken:c,createAxios:(O,D)=>{c(O),h(D)},theme:y,setVKUserId:o,VKUserId:r,customer:u,additionalData:v,setAdditionalData:b}},$m=({children:e,cabinetType:t})=>{const n=Rm({cabinetType:t});return f.jsx(Nt.Provider,{value:{...n,cabinetType:t},children:e})},Ul=({fileValue:e})=>{const{cabinetUISettings:t}=H.useContext(Nt),n=e?`url(data:image/png;base64,${e})`:`url(${t==null?void 0:t.headerImageUrl})`;return f.jsx(Ce.Typography,{variant:"h2",component:"div",children:f.jsx("div",{className:"header",style:{backgroundColor:t==null?void 0:t.headerColor},children:f.jsx(Ce.Container,{maxWidth:"sm",sx:{paddingBottom:`${t==null?void 0:t.paddingBottom}px`,paddingTop:`${t==null?void 0:t.paddingTop}px`},children:t!=null&&t.headerUrlRedirect?f.jsx("a",{href:t==null?void 0:t.headerUrlRedirect,target:"_blank",children:f.jsx("div",{className:"header__img",style:{backgroundImage:n}})}):f.jsx("div",{className:"header__img",style:{backgroundImage:n}})})})})};class _m extends H.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.log({error:t,errorInfo:n})}render(){return this.state.hasError?f.jsx("h1",{children:"Что-то пошло не так"}):this.props.children}}var wi={},Yl={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Yl);var Ot=Yl.exports,Ci={};function on(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...r){return e(...r)||t(...r)}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function zn(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function Hl(e){if(!zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Hl(e[n])}),t}function Wt(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return zn(e)&&zn(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(zn(t[o])&&o in e&&zn(e[o])?r[o]=Wt(e[o],t[o],n):n.clone?r[o]=zn(t[o])?Hl(t[o]):t[o]:r[o]=t[o])}),r}var Ti={exports:{}},Yo={exports:{}},Ue={};/** @license React v16.13.1
|
|
34
34
|
* react-is.production.min.js
|
|
35
35
|
*
|
|
36
36
|
* Copyright (c) Facebook, Inc. and its affiliates.
|