1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`39779476-b4bd-4b04-961c-03dde7977b79`,e._sentryDebugIdIdentifier=`sentry-dbid-39779476-b4bd-4b04-961c-03dde7977b79`)}catch{}})();import{En as e,J as t,ft as n,qo as r,ut as i}from"./B9HaxpS5.js";import{$o as a,Di as o,I as s,Js as c,N as l,ia as u,ms as d,na as f,pn as p,ra as m,ta as h,tc as g,xo as _,yn as v}from"./CjuxW0tq.js";import{f as y}from"./mMguafOX.js";import{l as b,t as x}from"./BFHgVwyC.js";import{i as S,m as C,t as w}from"./CPghBDuj.js";import{t as T}from"./C1EM-pyT.js";import{t as E}from"./d9LcRDOX.js";import{t as D}from"./CUygiep0.js";import"./D7gjdIdV.js";import{t as O}from"./D8behEkT2.js";function k(){let e=C(),t=w(),{billingClient:n,pricingClient:i}=r();async function a(){let t=await n.getUserPaymentCards();e.userCards=(t.data||[]).map(b)}async function o(e){return(await n.setMainUserPaymentCards(e)).data}async function s(e){return(await n.deleteUserPaymentCards(e)).data}async function c(){if(t.currencyRates.length>0)return;let e=await i.getCurrencyRates(S);t.currencyRates=e.data??[]}return{getCurrencyRates:c,deleteUserCardData:s,setUserCardData:o,getUserCards:a}}function A(e,t){let n=new Set(t);return e.filter((e,t)=>!n.has(t))}d();function j(){let e=O(),t=a(()=>e.tariffPlans);function n(e,t){return!!e.display_places?.some(e=>e.name===t)}function r(e){return t.value.filter(t=>n(t,e))}function i(e){return t.value.filter(t=>n(t,e)&&t.billing_period_unit===h.YEAR&&t.billing_period_count===1)}function o(e){return t.value.filter(t=>n(t,e)&&t.billing_period_unit===h.MONTH&&t.billing_period_count===1)}function s(e){let t=Number(e?.price?.final_price);return Number.isFinite(t)?t:1/0}function c(e){return e.sort((e,t)=>s(e)-s(t))}function l(e){return e.sort((e,t)=>s(t)-s(e))}function u(e,t){return typeof t==`number`?e.slice(0,t):e}function d(e,t){return e.length<4||!t?.length?e:A(e,t)}function p(e){return e.discounts?.reduce((e,t)=>{if(!t.product_types?.includes(f.OFFLINE_EVENT)||!t.offline_event_types?.length)return e;let n=Number(t.amount_percent);return Number.isFinite(n)&&n>e?n:e},0)??0}function g(e,t){return e.filter(e=>e.content_library_accesses?.some(e=>e.content_library?.code===t&&(e.is_unlimited||e.access_limit&&e.access_limit>0)))}function _(e){return u(c(i(m.MAIN)),e)}function v(e){return u(l(i(m.MAIN)),e)}function y(e){return u(c(i(m.CANCELLATION_OFFER)),e)}function b(){let e=r(m.MAIN).filter(e=>p(e)>0);return e.length?e.reduce((e,t)=>p(t)>p(e)?t:e,e[0]):null}function x(e){return u(c(i(m.MAIN).filter(e=>p(e)>0)),e)}function S(e,t){return e?.content_library_accesses?.find(e=>{let n=e.content_library;return e.content_library_id===t||n?.id===t||n?.code===t})??null}function C(e,t){return S(e,t)?.access_limit??null}function w(e,t){return!!S(e,t)?.is_unlimited}function T(e,t,n){return u(c(g(i(e),t)),n)}function E(e,t,n){return u(c(g(o(e),t)),n)}function D(e,t,n){let r=c(i(e).filter(e=>e.content_library_accesses?.some(e=>e.content_library_id===t&&(e.is_unlimited||e.access_limit&&e.access_limit>0))));return n?u(r,n):r}function k(e,t,n){let r=c(i(e).filter(e=>e.offline_event_countries.length===1&&e.offline_event_countries[0].iso2===`RU`&&e.content_library_accesses?.some(e=>e.content_library_id===t&&(e.is_unlimited||e.access_limit&&e.access_limit>0))));return n?u(r,n):r}function j(e,t,n){let r=c(i(e).filter(e=>(e.offline_event_countries.length!==1||e.offline_event_countries[0].iso2!==`RU`)&&e.content_library_accesses?.some(e=>e.content_library_id===t&&(e.is_unlimited||e.access_limit&&e.access_limit>0))));return n?u(r,n):r}return{tariffPlans:t,getMinYearMainPlans:_,getMaxYearMainPlans:v,getMinYearCancellationOfferPlans:y,getMainPlanWithMaxCumDiscount:b,getMinYearMainPlansWithCumDiscount:x,getPlanMaxOfflineEventDiscount:p,getPlanLibAmount:C,checkPlanLibUnlimited:w,getAnnualPlansByLibCode:T,getMonthlyPlansByLibCode:E,getAnnualPlans:D,getAnnualRfPlans:k,getAnnualOfflinePlans:j,filterPlansForMob:d}}var M=`â`;function N(e,n){if(!Number.isFinite(e))return``;let r=t(e);
1if(!r)return``;let i=n??``;return i?`${M}${r} ${i}`:r}function P(e,n){if(!Number.isFinite(e))return``;let r=t(e);if(!r)return``;let i=n??``;return i?`${i}${M}${r}`:r}function F(){let e=l();function t({price:t,symbol:n,format:r=`Price Symbol`}){let i=Number(t);if(!Number.isFinite(i))return``;let a=n??e.currentCurrency?.symbol??``;return r===`SymbolPrice`?P(i,a):N(i,a)}return{getFormattedPrice:t}}d(),c();function I(t){let r=_();t?.eventItem;let c=l(),d=a(()=>c.currentCurrency),f=o(),m=C(),b=O(),S=T(),{getFormattedPrice:w}=F(),{createPaymentObligationPlan:A}=x(),{getCurrentUser:M}=D(),{getUserCards:N}=k(),{createI18n:P}=E(),{t:I}=P(),{getMinYearMainPlans:ee,getMainPlanWithMaxCumDiscount:te,getMinYearMainPlansWithCumDiscount:ne,getPlanMaxOfflineEventDiscount:L}=j(),re=a(()=>ee(6)),R=a(()=>te()),z=a(()=>R.value?L(R.value):0),B=a(()=>f.isSimplifiedSubscription),V=g(),H=a(()=>f.authorizedUser),U=a(()=>m.userCards),W=g(!1),ie=a(()=>!!H.value),ae=[{devCode:y.FREE_LESSONS},{devCode:y.PREMIUM_LESSONS},{devCode:y.UNLIMITED_ACCESS},{devCode:y.FREE_ACCESS},{devCode:y.FREE_PERIOD}],G=a(()=>H.value?.subscription??null),K=a(()=>Y.value!==u.ACTIVE&&Y.value!==u.IN_GRACE_PERIOD?null:G.value),q=a(()=>K.value?.plan??null),J=a(()=>!!K.value),oe=a(()=>J.value),se=a(()=>J.value?Y.value===u.IN_GRACE_PERIOD:!1),ce=a(()=>H.value?.subscription?.plan?.id??null),Y=a(()=>H.value?.subscription?.status??null),le=a(()=>!!K.value?.auto_renewal_enabled),X=a(()=>q.value?L(q.value):0),ue=a(()=>`${X.value}%`),de=a(()=>!J.value||!q.value||!R.value?!1:z.value>0&&X.value>=z.value),fe=a(()=>z.value||10),pe=a(()=>{if(!U.value)return``;let e=U.value.find(e=>e.is_main);return e?e?.masked_number?.slice(-9):``}),me=a(()=>ne(2)),he=a(()=>H.value?.subscription?.ends_at??``),Z=a(()=>H.value?.subscription?.balances?.find(e=>e.content_library?.content_format===s.ONLINE&&!e.is_unlimited)??null),ge=a(()=>Z.value?.content_library??null),_e=a(()=>Z.value?.balance??null);async function Q(e){await A({planId:e.id})}function $(e){return H.value?.subscription?.balances?.find(t=>{let n=t.content_library;return t.content_library_id===e||n?.id===e||n?.code===e})??null}function ve(e){let t=$(e);return(t?.balance??0)===0&&!t?.is_unlimited}async function ye(){S.isLoadingSubscriptions=!0;try{ie.value&&(await M(),await Promise.allSettled([N()]))}catch(t){let a=i(t);n(e.create(a),r)}finally{S.isLoadingSubscriptions=!1,W.value=!0}}function be(e){return e?w({price:e?.final_price}):``}function xe(e){return!e||!e?.price_before_discounts?``:w({price:e?.price_before_discounts})}function Se(e){return e?.price?.discount?.ends_at??``}function Ce(e){let t=e?.price,n=t?.discount;return!t||!n?!1:!!(t.price_before_discounts>t.final_price&&n.percent>0&&v(n.ends_at))}function we(e){return e===h.YEAR?I(`tariff.perYear`):I(`tariff.perMonth`)}function Te(e){b.clearBasePriceFromPlane(e)}function Ee(e){let t=e?.price?.discount,n=t?.percent??0,r=t?.ends_at??``;return{date:r,relevantFromDate:p(r),discount:n>0?`${n}%`:``}}return{user:H,isPageDataInitialized:W,orderBlocks:ae,userSubscription:G,userActiveSubscriptionPlan:q,isSubs:oe,currencySymbol:d,userHasActiveSubscription:J,userActiveSubscription:K,activePlanId:ce,userHasUnpaidSubscription:se,mainUserCardNumber:pe,mainTariffPlansForBlocks:re,isSimplifiedSubscription:B,userSubscriptionEndDate:he,userOnlineBalanceLibrary:ge,userOnlineBalance:_e,plansWithCumDiscount:me,paymentResultDialog:V,userHasActiveAutoRenewalSubscription:le,userCumulativeDiscount:X,userCumulativeDiscountText:ue,userHasTariffWithMaxCumDiscount:de,maxPossibleDiscountForUser:fe,choosePlan:Q,getSubscriptionPageData:ye,getPrice:be,getMaxPrice:xe,getTimerDataStart:Se,checkIsShowTimer:Ce,getUserLibBalance:$,checkUserZeroLibBalance:ve,getPeriodName:we,updatePriceForPlan:Te,getPlanDiscountTimerData:Ee}}
1export{k as i,F as n,j as r,I as t};
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.