PageSourceSearch

https://st.lectera.com/_next/static/chunks/pages/manager/price-guide-aaa9432009860bad.js

js lectera.com collected 2026-10-01 11:39:01 UTC 8,733 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="418e6911-5c0a-473f-8d0a-2cc71402d9bc",e._sentryDebugIdIdentifier="sentry-dbid-418e6911-5c0a-473f-8d0a-2cc71402d9bc")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6760],{14578:e=>{e.exports={grey500:"var(--lctr-grey-500)",grey450:"var(--lctr-grey-450)",grey400:"var(--lctr-grey-400)",redBasic:"var(--lctr-red-basic)",priceBlock:"PagePriceGuide_priceBlock__aw4uC",icon:"PagePriceGuide_icon__ZUU_4",buttonsBlock:"PagePriceGuide_buttonsBlock__K5oB7"}},37556:(e,r,t)=>{"use strict";t.r(r),t.d(r,{__N_SSP:()=>V,default:()=>X});var c=t(37876),a=t(65615),i=t(96222),s=t(77328),l=t.n(s),n=t(2787),p=t(54587),u=t.n(p),d=t(79993),o=t(54806),y=t(48711),P=t(61614),g=t(93206),_=t(14232),x=t(26637),h=t(47697),v=t(92718),f=t(14578),I=t.n(f),b=t(88480),m=t(73642);let w=async e=>{let r;return r=(await b.u.delete(`/api/prices/${e}`)).data,(0,m.A)(r,{deep:!0})};var S=t(61212),j=t(36672),N=t(87105),k=t(91913),B=t(89894),A=t.n(B),R=t(90667),G=t(68450),D=t(15039),T=t.n(D),U=t(28882),E=t(92154),C=t.n(E);let M=e=>{let{t:r}=(0,i.B)(),t=(0,_.useCallback)(r=>{let t=null,c=null;switch(e.label){case"USD":t=0;break;case"EUR":t=1;break;case"RUB":t=2;break;case"INR":t=3;break;case"ID Google Play":c="googlePlayId";break;case"ID App Store":c="appStoreId"}e.changePrice(e.isApp?r.target.value:Number(r.target.value),e.index,t,c)},[e]),a=e.isApp?e.value||"":e.value;return(0,c.jsxs)("div",{className:e.isApp?C().inputApps:C().input,"data-sentry-component":"InputPrice","data-sentry-source-file":"InputPrice.tsx",children:[(0,c.jsxs)("div",{className:C().label,children:[(0,c.jsx)("div",{children:e.label}),!e.isApp&&(0,c.jsx)("div",{className:C().priceText,children:r("Price")})]}),(0,c.jsx)(U.p,{type:e.isApp||e.isPopup?"text":"number",disabled:e.isPopup,value:a?.toString(),onChange:t,"data-sentry-element":"Input","data-sentry-source-file":"InputPrice.tsx"})]})};var O=t(72450),$=t.n(O);let J=({price:e,index:r,changePrice:t,handleDeleteRow:a,isDuplicateRows:i,isSelectedRow:s,selectRow:l,isPopup:n})=>(0,c.jsxs)("div",{className:T()($().wrapper,i&&$().duplicateRow),"data-sentry-component":"PriceItem","data-sentry-source-file":"PriceItem.tsx",children:[!n&&(0,c.jsx)("div",{children:r}),e.currencyPrices.map(e=>(0,c.jsx)(M,{label:e.currency,value:e.price,isPopup:n,index:r,changePrice:t},r+e.currency)),(0,c.jsx)(M,{label:"ID Google Play",isApp:!0,isPopup:n,index:r,value:e.googlePlayId,changePrice:t,"data-sentry-element":"InputPrice","data-sentry-source-file":"PriceItem.tsx"}),(0,c.jsx)(M,{label:"ID App Store",isApp:!0,isPopup:n,index:r,value:e.appStoreId,changePrice:t,"data-sentry-element":"InputPrice","data-sentry-source-file":"PriceItem.tsx"}),!n&&(0,c.jsx)(u(),{src:R.A,width:20,height:20,onClick:()=>a(e.priceId,r),className:$().deleteIcon,alt:"close icon"}),n&&l&&(0,c.jsx)(G.S,{checked:s,onChange:()=>l(s?null:e.priceId)})]}),H=e=>{let{t:r}=(0,i.B)(),{priceGuide:t,priceId:a,priceIdToMigrate:s,handleMigratePriceGuide:l,setPriceIdToMigrate:n}=e;return(0,c.jsx)(k.z,{isOpened:e.isPopupOpen,onClose:e.onClose,"data-sentry-element":"Popup","data-sentry-component":"PriceGuidePopup","data-sentry-source-file":"PriceGuidePopup.tsx",children:(0,c.jsxs)("div",{className:A().priceBlock,children:[(0,c.jsxs)("div",{className:A().popupText,children:[(0,c.jsx)("div",{children:r("Эта цена используется в нескольких ценовых схемах")}),(0,c.jsx)("div",{children:r('Чтобы удалить текущую, Выберите новую цену из списка и нажмите "Сохранить"')})]}),(0,c.jsx)("div",{className:A().popupTable,children:t.filter(e=>e.priceId!==a).map((e,r)=>{let t=`${r} ${e.priceId}`;return(0,c.jsx)(J,{index:r,isDuplicateRows:!1,isPopup:!0,isSelectedRow:s===e.priceId,selectRow:e=>n(e),price:e,changePrice:()=>null,handleDeleteRow:()=>null},t)})}),(0,c.jsx)("div",{className:A().buttonsBlock,children:(0,c.jsx)(d.$,{size:"s",onClick:()=>l(a,s),"data-sentry-element":"Button","data-sentry-source-file":"PriceGuidePopup.tsx",children:r("Save")})})]})})};var K=t(38699);let z=()=>{let[e,r]=(0,_.useState)([]),[t,a]=(0,_.useState)([]),[s,l]=(0,_.useState)([]),[p,f]=(0,_.useState)(!1),[m,k]=(0,_.useState)(null),[B,A]=(0,_.useState)(null),{t:R}=(0,i.B)(),G=async()=>{let e=await (0,S.A)();r(e),a(JSON.parse(JSON.stringify(e)))},D=()=>{f(!1),A(0),k(null)},T=async()=>{let t,c,i,s,n,p,u,d,o,y=(t=e=>[...new Set(e.filter((e,r,t)=>
1t.includes(e,r+1)))],c=[],i=[],s=[],n=[],e.forEach(e=>{c.push(e.currencyPrices[0].price),i.push(e.currencyPrices[1].price),s.push(e.currencyPrices[2].price),n.push(e.currencyPrices[3].price)}),p=t(c).flatMap(e=>c.flatMap((r,t)=>r===e?t:[])),u=t(i).flatMap(e=>i.flatMap((r,t)=>r===e?t:[])),d=t(s).flatMap(e=>s.flatMap((r,t)=>r===e?t:[])),o=t(n).flatMap(e=>n.flatMap((r,t)=>r===e?t:[])),[...new Set(p.concat(u,d,o))]);if(y.length)(0,h.K)(g.A.error,"Обнаружены одинаковые строки");else try{let t=await b.u.post("/api/prices",{prices:(0,j.A)(e,{deep:!0})}).then(({data:e})=>(0,N.N)(e,{deep:!0}));r(t),a(JSON.parse(JSON.stringify(t)))}catch(e){(0,v.o)(e)===P.Ou&&(0,h.K)(g.A.error,"Нельзя менять бесплатную цену")}l(y)},U=async(c,a)=>{if(null===c&&a){let t=e.slice();t.splice(a,1),r(t);return}if((0,x.A)(t,e))try{await w(c),await G()}catch(e){(0,y.F0)(e)&&e.response?.status===409&&(A(c),f(!0))}else(0,h.K)(g.A.error,"Сохраните изменения")},E=(t,c,a,i)=>{let s=e.slice();i&&(s[c][i]=t),null!==a&&(s[c].currencyPrices[a].price=Number(t)),r(s)},C=async(e,r)=>{if(null!==r&&null!==e)try{await (0,K.fJ)(e,r),await U(e),k(null),D()}catch(e){(0,h.K)(g.A.error,(0,v.o)(e))}};return((0,_.useEffect)(()=>{G()},[]),e)?(0,c.jsxs)("div",{className:I().priceBlock,"data-sentry-component":"PagePriceGuide","data-sentry-source-file":"PagePriceGuide.tsx",children:[e.map((e,r)=>{let t=`${r} ${e.priceId}`,a=s.includes(r);return(0,c.jsx)(J,{index:r,isDuplicateRows:a,price:e,changePrice:E,handleDeleteRow:(e,r)=>void U(e,r)},t)}),(0,c.jsxs)("div",{className:I().buttonsBlock,children:[(0,c.jsx)(u(),{onClick:()=>{let t=e.slice();t.push({appStoreId:null,currencyPrices:[{currency:o.S.USD,price:0},{currency:o.S.EUR,price:0},{currency:o.S.RUB,price:0},{currency:o.S.INR,price:0}],googlePlayId:null,priceId:null}),r(t)},className:I().icon,src:n.A,alt:"add",width:24,height:24,"data-sentry-element":"Image","data-sentry-source-file":"PagePriceGuide.tsx"}),(0,c.jsx)(d.$,{size:"s",onClick:()=>void T(),"data-sentry-element":"Button","data-sentry-source-file":"PagePriceGuide.tsx",children:R("Save")})]}),(0,c.jsx)(H,{onClose:D,isPopupOpen:p,priceGuide:e,priceId:B,priceIdToMigrate:m,handleMigratePriceGuide:(e,r)=>void C(e,r),setPriceIdToMigrate:k,"data-sentry-element":"PriceGuidePopup","data-sentry-source-file":"PagePriceGuide.tsx"})]}):null};var V=!0;let X=()=>{let{t:e}=(0,i.B)();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l(),{"data-sentry-element":"Head","data-sentry-source-file":"price-guide.tsx",children:(0,c.jsx)("title",{children:e("Price guide")})}),(0,c.jsx)(a.A,{sidebar:!0,"data-sentry-element":"ManagerLayout","data-sentry-source-file":"price-guide.tsx",children:(0,c.jsx)(z,{"data-sentry-element":"PagePriceGuide","data-sentry-source-file":"price-guide.tsx"})})]})}},54806:(e,r,t)=>{"use strict";var c;t.d(r,{S:()=>a});let a=((c={}).USD="USD",c.RUB="RUB",c.EUR="EUR",c.INR="INR",c)},60448:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/manager/price-guide",function(){return t(37556)}])},72450:e=>{e.exports={grey500:"var(--lctr-grey-500)",grey450:"var(--lctr-grey-450)",grey400:"var(--lctr-grey-400)",redBasic:"var(--lctr-red-basic)",root:"PriceItem_root__wkUJt",duplicateRow:"PriceItem_duplicateRow__DEcs2",selectedRow:"PriceItem_selectedRow__TuUOa",wrapper:"PriceItem_wrapper__N5fzO"}},89894:e=>{e.exports={grey500:"var(--lctr-grey-500)",grey450:"var(--lctr-grey-450)",grey400:"var(--lctr-grey-400)",redBasic:"var(--lctr-red-basic)",root:"PriceGuidePopup_root__30AXa",priceBlock:"PriceGuidePopup_priceBlock__T8EeZ",popupText:"PriceGuidePopup_popupText__SUgnv",popupTable:"PriceGuidePopup_popupTable__faH1_",buttonsBlock:"PriceGuidePopup_buttonsBlock__WiVDV"}},92154:e=>{e.exports={grey500:"var(--lctr-grey-500)",grey450:"var(--lctr-grey-450)",grey400:"var(--lctr-grey-400)",redBasic:"var(--lctr-red-basic)",input:"InputPrice_input__4HwRM",inputApps:"InputPrice_inputApps__aoYHV",label:"InputPrice_label__2a6et",priceText:"InputPrice_priceText__rSLHg"}}},e=>{e.O(0,[9705,5907,636,6593,8792],()=>e(e.s=60448)),_N_E=e.O()}]);

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.