@inno_user/inno_clouds_lib 9.3.3 → 9.3.5
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.
|
@@ -3475,7 +3475,18 @@ function c1(s) {
|
|
|
3475
3475
|
};
|
|
3476
3476
|
}
|
|
3477
3477
|
const jt = Or("cartLib", () => {
|
|
3478
|
-
const s = ir(), o = Nr(), i = qt(), c = vt(), { config_lib: d, countBonus: f, totalPrice_lib: g, initialCartPrice_lib: m, is18Allowed: w } = Le(c), { itemThemes: p } = Le(i), _ = ae(!1), v = ae(""), E = ae(null), k = ae("wait"), S = ae(!1), P = ae(0), D = ae(""), G = ae([]), B = ae([]), O = ae(), M = ae(0), Q = ae(!1), ee = ae(), X = ae(null), le = ae(
|
|
3478
|
+
const s = ir(), o = Nr(), i = qt(), c = vt(), { config_lib: d, countBonus: f, totalPrice_lib: g, initialCartPrice_lib: m, is18Allowed: w } = Le(c), { itemThemes: p } = Le(i), _ = ae(!1), v = ae(""), E = ae(null), k = ae("wait"), S = ae(!1), P = ae(0), D = ae(""), G = ae([]), B = ae([]), O = ae(), M = ae(0), Q = ae(!1), ee = ae(), X = ae(null), le = ae(
|
|
3479
|
+
[
|
|
3480
|
+
"failed_payment",
|
|
3481
|
+
"failed_after_paid",
|
|
3482
|
+
"failed",
|
|
3483
|
+
"failed_after_sent",
|
|
3484
|
+
"failed_after_sent_fiscalization",
|
|
3485
|
+
"payment_initiation_retry",
|
|
3486
|
+
"cancelled",
|
|
3487
|
+
"failed_after_payment_initiation"
|
|
3488
|
+
]
|
|
3489
|
+
), H = ae("Оплатить"), de = ae(), q = ve({
|
|
3479
3490
|
get: () => G.value || [],
|
|
3480
3491
|
set: (Be) => {
|
|
3481
3492
|
(Be == null ? void 0 : Be.length) === 1 && (de.value = Be[0]), G.value = Be;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...i){const u=new this(s);return i.forEach(f=>u.set(f)),u}static accessor(s){const u=(this[Ss]=this[Ss]={accessors:{}}).accessors,f=this.prototype;function h(m){const x=Lr(m);u[x]||(Jc(f,m),u[x]=!0)}return J.isArray(s)?s.forEach(h):h(s),this}};$t.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),J.reduceDescriptors($t.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}}),J.freezeMethods($t);function Qi(o,s){const i=this||Pr,u=s||i,f=$t.from(u.headers);let h=u.data;return J.forEach(o,function(x){h=x.call(i,h,f.normalize(),s?s.status:void 0)}),f.normalize(),h}function Ns(o){return!!(o&&o.__CANCEL__)}function mr(o,s,i){Be.call(this,o??"canceled",Be.ERR_CANCELED,s,i),this.name="CanceledError"}J.inherits(mr,Be,{__CANCEL__:!0});function Ts(o,s,i){const u=i.config.validateStatus;!i.status||!u||u(i.status)?o(i):s(new Be("Request failed with status code "+i.status,[Be.ERR_BAD_REQUEST,Be.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function eu(o){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return s&&s[1]||""}function tu(o,s){o=o||10;const i=new Array(o),u=new Array(o);let f=0,h=0,m;return s=s!==void 0?s:1e3,function(_){const p=Date.now(),C=u[h];m||(m=p),i[f]=_,u[f]=p;let y=h,S=0;for(;y!==f;)S+=i[y++],y=y%o;if(f=(f+1)%o,f===h&&(h=(h+1)%o),p-m<s)return;const M=C&&p-C;return M?Math.round(S*1e3/M):void 0}}function nu(o,s){let i=0,u=1e3/s,f,h;const m=(p,C=Date.now())=>{i=C,f=null,h&&(clearTimeout(h),h=null),o(...p)};return[(...p)=>{const C=Date.now(),y=C-i;y>=u?m(p,C):(f=p,h||(h=setTimeout(()=>{h=null,m(f)},u-y)))},()=>f&&m(f)]}const ui=(o,s,i=3)=>{let u=0;const f=tu(50,250);return nu(h=>{const m=h.loaded,x=h.lengthComputable?h.total:void 0,_=m-u,p=f(_),C=m<=x;u=m;const y={loaded:m,total:x,progress:x?m/x:void 0,bytes:_,rate:p||void 0,estimated:p&&x&&C?(x-m)/p:void 0,event:h,lengthComputable:x!=null,[s?"download":"upload"]:!0};o(y)},i)},ks=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Rs=o=>(...s)=>J.asap(()=>o(...s)),ru=Ht.hasStandardBrowserEnv?((o,s)=>i=>(i=new URL(i,Ht.origin),o.protocol===i.protocol&&o.host===i.host&&(s||o.port===i.port)))(new URL(Ht.origin),Ht.navigator&&/(msie|trident)/i.test(Ht.navigator.userAgent)):()=>!0,iu=Ht.hasStandardBrowserEnv?{write(o,s,i,u,f,h,m){if(typeof document>"u")return;const x=[`${o}=${encodeURIComponent(s)}`];J.isNumber(i)&&x.push(`expires=${new Date(i).toUTCString()}`),J.isString(u)&&x.push(`path=${u}`),J.isString(f)&&x.push(`domain=${f}`),h===!0&&x.push("secure"),J.isString(m)&&x.push(`SameSite=${m}`),document.cookie=x.join("; ")},read(o){if(typeof document>"u")return null;const s=document.cookie.match(new RegExp("(?:^|; )"+o+"=([^;]*)"));return s?decodeURIComponent(s[1]):null},remove(o){this.write(o,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ou(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function su(o,s){return s?o.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):o}function Os(o,s,i){let u=!ou(s);return o&&(u||i==!1)?su(o,s):s}const Bs=o=>o instanceof $t?{...o}:o;function Qn(o,s){s=s||{};const i={};function u(p,C,y,S){return J.isPlainObject(p)&&J.isPlainObject(C)?J.merge.call({caseless:S},p,C):J.isPlainObject(C)?J.merge({},C):J.isArray(C)?C.slice():C}function f(p,C,y,S){if(J.isUndefined(C)){if(!J.isUndefined(p))return u(void 0,p,y,S)}else return u(p,C,y,S)}function h(p,C){if(!J.isUndefined(C))return u(void 0,C)}function m(p,C){if(J.isUndefined(C)){if(!J.isUndefined(p))return u(void 0,p)}else return u(void 0,C)}function x(p,C,y){if(y in s)return u(p,C);if(y in o)return u(void 0,p)}const _={url:h,method:h,data:h,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:x,headers:(p,C,y)=>f(Bs(p),Bs(C),y,!0)};return J.forEach(Object.keys({...o,...s}),function(C){const y=_[C]||f,S=y(o[C],s[C],C);J.isUndefined(S)&&y!==x||(i[C]=S)}),i}const Ms=o=>{const s=Qn({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:f,xsrfCookieName:h,headers:m,auth:x}=s;if(s.headers=m=$t.from(m),s.url=ys(Os(s.baseURL,s.url,s.allowAbsoluteUrls),o.params,o.paramsSerializer),x&&m.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?unescape(encodeURIComponent(x.password)):""))),J.isFormData(i)){if(Ht.hasStandardBrowserEnv||Ht.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(J.isFunction(i.getHeaders)){const _=i.getHeaders(),p=["content-type","content-length"];Object.entries(_).forEach(([C,y])=>{p.includes(C.toLowerCase())&&m.set(C,y)})}}if(Ht.hasStandardBrowserEnv&&(u&&J.isFunction(u)&&(u=u(s)),u||u!==!1&&ru(s.url))){const _=f&&h&&iu.read(h);_&&m.set(f,_)}return s},au=typeof XMLHttpRequest<"u"&&function(o){return new Promise(function(i,u){const f=Ms(o);let h=f.data;const m=$t.from(f.headers).normalize();let{responseType:x,onUploadProgress:_,onDownloadProgress:p}=f,C,y,S,M,T;function D(){M&&M(),T&&T(),f.cancelToken&&f.cancelToken.unsubscribe(C),f.signal&&f.signal.removeEventListener("abort",C)}let v=new XMLHttpRequest;v.open(f.method.toUpperCase(),f.url,!0),v.timeout=f.timeout;function U(){if(!v)return;const O=$t.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),$={data:!x||x==="text"||x==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:O,config:o,request:v};Ts(function(W){i(W),D()},function(W){u(W),D()},$),v=null}"onloadend"in v?v.onloadend=U:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(U)},v.onabort=function(){v&&(u(new Be("Request aborted",Be.ECONNABORTED,o,v)),v=null)},v.onerror=function(B){const $=B&&B.message?B.message:"Network Error",K=new Be($,Be.ERR_NETWORK,o,v);K.event=B||null,u(K),v=null},v.ontimeout=function(){let B=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded";const $=f.transitional||As;f.timeoutErrorMessage&&(B=f.timeoutErrorMessage),u(new Be(B,$.clarifyTimeoutError?Be.ETIMEDOUT:Be.ECONNABORTED,o,v)),v=null},h===void 0&&m.setContentType(null),"setRequestHeader"in v&&J.forEach(m.toJSON(),function(B,$){v.setRequestHeader($,B)}),J.isUndefined(f.withCredentials)||(v.withCredentials=!!f.withCredentials),x&&x!=="json"&&(v.responseType=f.responseType),p&&([S,T]=ui(p,!0),v.addEventListener("progress",S)),_&&v.upload&&([y,M]=ui(_),v.upload.addEventListener("progress",y),v.upload.addEventListener("loadend",M)),(f.cancelToken||f.signal)&&(C=O=>{v&&(u(!O||O.type?new mr(null,o,v):O),v.abort(),v=null)},f.cancelToken&&f.cancelToken.subscribe(C),f.signal&&(f.signal.aborted?C():f.signal.addEventListener("abort",C)));const P=eu(f.url);if(P&&Ht.protocols.indexOf(P)===-1){u(new Be("Unsupported protocol "+P+":",Be.ERR_BAD_REQUEST,o));return}v.send(h||null)})},lu=(o,s)=>{const{length:i}=o=o?o.filter(Boolean):[];if(s||i){let u=new AbortController,f;const h=function(p){if(!f){f=!0,x();const C=p instanceof Error?p:this.reason;u.abort(C instanceof Be?C:new mr(C instanceof Error?C.message:C))}};let m=s&&setTimeout(()=>{m=null,h(new Be(`timeout ${s} of ms exceeded`,Be.ETIMEDOUT))},s);const x=()=>{o&&(m&&clearTimeout(m),m=null,o.forEach(p=>{p.unsubscribe?p.unsubscribe(h):p.removeEventListener("abort",h)}),o=null)};o.forEach(p=>p.addEventListener("abort",h));const{signal:_}=u;return _.unsubscribe=()=>J.asap(x),_}},cu=function*(o,s){let i=o.byteLength;if(i<s){yield o;return}let u=0,f;for(;u<i;)f=u+s,yield o.slice(u,f),u=f},uu=async function*(o,s){for await(const i of du(o))yield*cu(i,s)},du=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const s=o.getReader();try{for(;;){const{done:i,value:u}=await s.read();if(i)break;yield u}}finally{await s.cancel()}},vs=(o,s,i,u)=>{const f=uu(o,s);let h=0,m,x=_=>{m||(m=!0,u&&u(_))};return new ReadableStream({async pull(_){try{const{done:p,value:C}=await f.next();if(p){x(),_.close();return}let y=C.byteLength;if(i){let S=h+=y;i(S)}_.enqueue(new Uint8Array(C))}catch(p){throw x(p),p}},cancel(_){return x(_),f.return()}},{highWaterMark:2})},Ds=64*1024,{isFunction:di}=J,fu=(({Request:o,Response:s})=>({Request:o,Response:s}))(J.global),{ReadableStream:Ps,TextEncoder:Ls}=J.global,Fs=(o,...s)=>{try{return!!o(...s)}catch{return!1}},hu=o=>{o=J.merge.call({skipUndefined:!0},fu,o);const{fetch:s,Request:i,Response:u}=o,f=s?di(s):typeof fetch=="function",h=di(i),m=di(u);if(!f)return!1;const x=f&&di(Ps),_=f&&(typeof Ls=="function"?(T=>D=>T.encode(D))(new Ls):async T=>new Uint8Array(await new i(T).arrayBuffer())),p=h&&x&&Fs(()=>{let T=!1;const D=new i(Ht.origin,{body:new Ps,method:"POST",get duplex(){return T=!0,"half"}}).headers.has("Content-Type");return T&&!D}),C=m&&x&&Fs(()=>J.isReadableStream(new u("").body)),y={stream:C&&(T=>T.body)};f&&["text","arrayBuffer","blob","formData","stream"].forEach(T=>{!y[T]&&(y[T]=(D,v)=>{let U=D&&D[T];if(U)return U.call(D);throw new Be(`Response type '${T}' is not supported`,Be.ERR_NOT_SUPPORT,v)})});const S=async T=>{if(T==null)return 0;if(J.isBlob(T))return T.size;if(J.isSpecCompliantForm(T))return(await new i(Ht.origin,{method:"POST",body:T}).arrayBuffer()).byteLength;if(J.isArrayBufferView(T)||J.isArrayBuffer(T))return T.byteLength;if(J.isURLSearchParams(T)&&(T=T+""),J.isString(T))return(await _(T)).byteLength},M=async(T,D)=>{const v=J.toFiniteNumber(T.getContentLength());return v??S(D)};return async T=>{let{url:D,method:v,data:U,signal:P,cancelToken:O,timeout:B,onDownloadProgress:$,onUploadProgress:K,responseType:W,headers:ie,withCredentials:V="same-origin",fetchOptions:ae}=Ms(T),j=s||fetch;W=W?(W+"").toLowerCase():"text";let G=lu([P,O&&O.toAbortSignal()],B),z=null;const X=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let N;try{if(K&&p&&v!=="get"&&v!=="head"&&(N=await M(ie,U))!==0){let me=new i(D,{method:"POST",body:U,duplex:"half"}),xe;if(J.isFormData(U)&&(xe=me.headers.get("content-type"))&&ie.setContentType(xe),me.body){const[Ie,_e]=ks(N,ui(Rs(K)));U=vs(me.body,Ds,Ie,_e)}}J.isString(V)||(V=V?"include":"omit");const Q=h&&"credentials"in i.prototype,H={...ae,signal:G,method:v.toUpperCase(),headers:ie.normalize().toJSON(),body:U,duplex:"half",credentials:Q?V:void 0};z=h&&new i(D,H);let te=await(h?j(z,ae):j(D,H));const q=C&&(W==="stream"||W==="response");if(C&&($||q&&X)){const me={};["status","statusText","headers"].forEach(Me=>{me[Me]=te[Me]});const xe=J.toFiniteNumber(te.headers.get("content-length")),[Ie,_e]=$&&ks(xe,ui(Rs($),!0))||[];te=new u(vs(te.body,Ds,Ie,()=>{_e&&_e(),X&&X()}),me)}W=W||"text";let re=await y[J.findKey(y,W)||"text"](te,T);return!q&&X&&X(),await new Promise((me,xe)=>{Ts(me,xe,{data:re,headers:$t.from(te.headers),status:te.status,statusText:te.statusText,config:T,request:z})})}catch(Q){throw X&&X(),Q&&Q.name==="TypeError"&&/Load failed|fetch/i.test(Q.message)?Object.assign(new Be("Network Error",Be.ERR_NETWORK,T,z),{cause:Q.cause||Q}):Be.from(Q,Q&&Q.code,T,z)}}},gu=new Map,Vs=o=>{let s=o&&o.env||{};const{fetch:i,Request:u,Response:f}=s,h=[u,f,i];let m=h.length,x=m,_,p,C=gu;for(;x--;)_=h[x],p=C.get(_),p===void 0&&C.set(_,p=x?new Map:hu(s)),C=p;return p};Vs();const Ji={http:Pc,xhr:au,fetch:{get:Vs}};J.forEach(Ji,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const Us=o=>`- ${o}`,mu=o=>J.isFunction(o)||o===null||o===!1;function pu(o,s){o=J.isArray(o)?o:[o];const{length:i}=o;let u,f;const h={};for(let m=0;m<i;m++){u=o[m];let x;if(f=u,!mu(u)&&(f=Ji[(x=String(u)).toLowerCase()],f===void 0))throw new Be(`Unknown adapter '${x}'`);if(f&&(J.isFunction(f)||(f=f.get(s))))break;h[x||"#"+m]=f}if(!f){const m=Object.entries(h).map(([_,p])=>`adapter ${_} `+(p===!1?"is not supported by the environment":"is not available in the build"));let x=i?m.length>1?`since :
|
|
4
4
|
`+m.map(Us).join(`
|
|
5
5
|
`):" "+Us(m[0]):"as no adapter specified";throw new Be("There is no suitable adapter to dispatch the request "+x,"ERR_NOT_SUPPORT")}return f}const zs={getAdapter:pu,adapters:Ji};function eo(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new mr(null,o)}function Hs(o){return eo(o),o.headers=$t.from(o.headers),o.data=Qi.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",!1),zs.getAdapter(o.adapter||Pr.adapter,o)(o).then(function(u){return eo(o),u.data=Qi.call(o,o.transformResponse,u),u.headers=$t.from(u.headers),u},function(u){return Ns(u)||(eo(o),u&&u.response&&(u.response.data=Qi.call(o,o.transformResponse,u.response),u.response.headers=$t.from(u.response.headers))),Promise.reject(u)})}const Gs="1.13.2",fi={};["object","boolean","number","function","string","symbol"].forEach((o,s)=>{fi[o]=function(u){return typeof u===o||"a"+(s<1?"n ":" ")+o}});const Ws={};fi.transitional=function(s,i,u){function f(h,m){return"[Axios v"+Gs+"] Transitional option '"+h+"'"+m+(u?". "+u:"")}return(h,m,x)=>{if(s===!1)throw new Be(f(m," has been removed"+(i?" in "+i:"")),Be.ERR_DEPRECATED);return i&&!Ws[m]&&(Ws[m]=!0,console.warn(f(m," has been deprecated since v"+i+" and will be removed in the near future"))),s?s(h,m,x):!0}},fi.spelling=function(s){return(i,u)=>(console.warn(`${u} is likely a misspelling of ${s}`),!0)};function xu(o,s,i){if(typeof o!="object")throw new Be("options must be an object",Be.ERR_BAD_OPTION_VALUE);const u=Object.keys(o);let f=u.length;for(;f-- >0;){const h=u[f],m=s[h];if(m){const x=o[h],_=x===void 0||m(x,h,o);if(_!==!0)throw new Be("option "+h+" must be "+_,Be.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Be("Unknown option "+h,Be.ERR_BAD_OPTION)}}const hi={assertOptions:xu,validators:fi},In=hi.validators;let Jn=class{constructor(s){this.defaults=s||{},this.interceptors={request:new bs,response:new bs}}async request(s,i){try{return await this._request(s,i)}catch(u){if(u instanceof Error){let f={};Error.captureStackTrace?Error.captureStackTrace(f):f=new Error;const h=f.stack?f.stack.replace(/^.+\n/,""):"";try{u.stack?h&&!String(u.stack).endsWith(h.replace(/^.+\n.+\n/,""))&&(u.stack+=`
|
|
6
|
-
`+h):u.stack=h}catch{}}throw u}}_request(s,i){typeof s=="string"?(i=i||{},i.url=s):i=s||{},i=Qn(this.defaults,i);const{transitional:u,paramsSerializer:f,headers:h}=i;u!==void 0&&hi.assertOptions(u,{silentJSONParsing:In.transitional(In.boolean),forcedJSONParsing:In.transitional(In.boolean),clarifyTimeoutError:In.transitional(In.boolean)},!1),f!=null&&(J.isFunction(f)?i.paramsSerializer={serialize:f}:hi.assertOptions(f,{encode:In.function,serialize:In.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),hi.assertOptions(i,{baseUrl:In.spelling("baseURL"),withXsrfToken:In.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let m=h&&J.merge(h.common,h[i.method]);h&&J.forEach(["delete","get","head","post","put","patch","common"],T=>{delete h[T]}),i.headers=$t.concat(m,h);const x=[];let _=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(i)===!1||(_=_&&D.synchronous,x.unshift(D.fulfilled,D.rejected))});const p=[];this.interceptors.response.forEach(function(D){p.push(D.fulfilled,D.rejected)});let C,y=0,S;if(!_){const T=[Hs.bind(this),void 0];for(T.unshift(...x),T.push(...p),S=T.length,C=Promise.resolve(i);y<S;)C=C.then(T[y++],T[y++]);return C}S=x.length;let M=i;for(;y<S;){const T=x[y++],D=x[y++];try{M=T(M)}catch(v){D.call(this,v);break}}try{C=Hs.call(this,M)}catch(T){return Promise.reject(T)}for(y=0,S=p.length;y<S;)C=C.then(p[y++],p[y++]);return C}getUri(s){s=Qn(this.defaults,s);const i=Os(s.baseURL,s.url,s.allowAbsoluteUrls);return ys(i,s.params,s.paramsSerializer)}};J.forEach(["delete","get","head","options"],function(s){Jn.prototype[s]=function(i,u){return this.request(Qn(u||{},{method:s,url:i,data:(u||{}).data}))}}),J.forEach(["post","put","patch"],function(s){function i(u){return function(h,m,x){return this.request(Qn(x||{},{method:s,headers:u?{"Content-Type":"multipart/form-data"}:{},url:h,data:m}))}}Jn.prototype[s]=i(),Jn.prototype[s+"Form"]=i(!0)});let wu=class nl{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(h){i=h});const u=this;this.promise.then(f=>{if(!u._listeners)return;let h=u._listeners.length;for(;h-- >0;)u._listeners[h](f);u._listeners=null}),this.promise.then=f=>{let h;const m=new Promise(x=>{u.subscribe(x),h=x}).then(f);return m.cancel=function(){u.unsubscribe(h)},m},s(function(h,m,x){u.reason||(u.reason=new mr(h,m,x),i(u.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const i=this._listeners.indexOf(s);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const s=new AbortController,i=u=>{s.abort(u)};return this.subscribe(i),s.signal.unsubscribe=()=>this.unsubscribe(i),s.signal}static source(){let s;return{token:new nl(function(f){s=f}),cancel:s}}};function _u(o){return function(i){return o.apply(null,i)}}function Cu(o){return J.isObject(o)&&o.isAxiosError===!0}const to={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(to).forEach(([o,s])=>{to[s]=o});function Xs(o){const s=new Jn(o),i=as(Jn.prototype.request,s);return J.extend(i,Jn.prototype,s,{allOwnKeys:!0}),J.extend(i,s,null,{allOwnKeys:!0}),i.create=function(f){return Xs(Qn(o,f))},i}const nt=Xs(Pr);nt.Axios=Jn,nt.CanceledError=mr,nt.CancelToken=wu,nt.isCancel=Ns,nt.VERSION=Gs,nt.toFormData=li,nt.AxiosError=Be,nt.Cancel=nt.CanceledError,nt.all=function(s){return Promise.all(s)},nt.spread=_u,nt.isAxiosError=Cu,nt.mergeConfig=Qn,nt.AxiosHeaders=$t,nt.formToJSON=o=>Is(J.isHTMLForm(o)?new FormData(o):o),nt.getAdapter=zs.getAdapter,nt.HttpStatusCode=to,nt.default=nt;const{Axios:Wg,AxiosError:Xg,CanceledError:jg,isCancel:qg,CancelToken:Zg,VERSION:Yg,all:$g,Cancel:Kg,isAxiosError:Qg,spread:Jg,toFormData:em,AxiosHeaders:tm,HttpStatusCode:nm,formToJSON:rm,getAdapter:im,mergeConfig:om}=nt;let Sn=null,Gt=null;function Cn(o){o&&o.close(!0)}async function Fr(o,s){const i=St(),u=lt(),f=En.create();try{const h=await f.initPaymentLink(o,s);return i.paymentCostQR=u.totalPrice_lib-u.countBonus,i.linkQR=h.url,Gt==null||Gt.deleteCart(null,Gt==null?void 0:Gt.is_requestKiosk),h}catch(h){throw i.isButtonDisabled=!1,i.showNotification(h==null?void 0:h.response.data.user_friendly_message),h}}function Eu(o,s,i){if(o!=null&&o.params){if(o.error){s.showNotification(o.error),cn(s,null),ro(s);return}i(o,s)}}function no(o,s){const i=St(),u=lt();return s.has_rms_discount?(o.params.new_discounts&&(i.extraDiscount=Number(o.params.new_total_cost)-s.initialCartPrice,u.totalPrice_lib=Number(o.params.new_total_cost),s.showNotification("К заказу были добавлены скидки")),!0):!1}const cn=(o,s)=>{o.updateOrderStatus&&o.updateOrderStatus(s)},yu=o=>{o.loadCart&&o.loadCart()},gi=o=>{o.resetBonuses&&o.resetBonuses()},ro=o=>{o.closeWebSocket&&o.closeWebSocket()},js=(o,s)=>{o.is_tableservice&&(Cn(s),o.resetStores(),o.deleteCart(null,o.is_requestKiosk),o.cartCleanup?o.cartCleanup.cleanupAndNavigate("profile",o.is_requestKiosk):o.deleteCart("profile",o.is_requestKiosk))},qs=(o,s,i,u)=>{const f=s.ws||i;En.create().orderPay(o.params.order_id||"").then(m=>{s.setOrderNumber&&s.setOrderNumber(m.data.order_number)}).catch(m=>{(s.errorHandler||u).handleOrderPayError(m,{...s,closeWebSocket:()=>Cn(f)})})},io=(o,s,i)=>{const u=o.ws||s;(o.errorHandler||i).handleOrderError({...o,closeWebSocket:()=>Cn(u)})},bu=(o,s,i)=>{const u=St(),f=u.getCurrentPaymentMethodId();if(!f||!Ln.getConfig(f)||!Ln.isMethodAvailable(f,o))return null;const m=Ln.createHandler(f);if(!m)return null;const x=u.createPaymentHandler(o,s,i,f);return x?{handler:m,config:x.config}:null},Au=o=>{if(!Gt)return;const s=Gt.context,i=Gt.is_requestKiosk,u=Gt.is_tableservice,f=bu(s,i,u);if(!f){console.warn("handleWebSocketMessageWithDynamicHandler: не удалось получить handler");return}const{handler:h,config:m}=f,x={...m,...Gt};Eu(o,x,h.handleWebSocketStatus)};async function Iu(o,s,i,u){var C,y;const{is_requestKiosk:f,is_tableservice:h}=i,{comment:m,is_authorized:x,signal:_}=u;i.setButtonDisabled(!0);const p=En.create();try{const S=await p.createOrder(o,s,f,m,x,h,_);if((S==null?void 0:S.status)===201&&((C=S==null?void 0:S.data)!=null&&C.id)){const M=S.data.id,T={...i,signal:_};Gt=T;const v=`wss://${T.area||""}/ws/order/${M}/`;Sn=ri(v,{signal:_});const U=()=>{console.warn("WebSocket connection opened (centralized mode)")},P=B=>{var $;console.error("WebSocket error (centralized mode):",B),Cn(Sn),Sn=null,Gt=null,i.setButtonDisabled(!1),($=i.errorHandler)==null||$.handlePaymentError(B,T)},O=B=>{Au(B)};Sn.on("open",U),Sn.on("message",O),Sn.on("error",P),Sn.connect(),Gt.ws=Sn,Gt.closeWebSocket=()=>{Cn(Sn),Sn=null,Gt=null}}return S}catch(S){throw nt.isCancel(S)||((y=i.errorHandler)==null||y.handleCreateOrderError(S,i),i.setButtonDisabled(!1)),S}}const Zs=o=>{var s,i;return((i=(s=o==null?void 0:o.response)==null?void 0:s.data)==null?void 0:i.user_friendly_message)||null};function mi(){const o=St();return{handlePaymentError(s,i){var f,h,m,x,_,p;const u=Zs(s);cn(i,null),yu(i),u?(i.showNotification(u),ro(i),i.is_requestKiosk&&((h=i.orderErrors)!=null&&h.includes((f=s.response)==null?void 0:f.status))&&(i.cartCleanup?i.cartCleanup.cleanupAndNavigate("retryPage",i.is_requestKiosk):i.deleteCart("retryPage",i.is_requestKiosk)),i.is_tableservice?i.resetStores():(gi(i),i.context==="qr"&&i.navigation?i.navigation.redirectToError():i.context==="qr"&&i.redirect&&(o.isButtonDisabled=!1,i.redirect(`/${((x=(m=i.route)==null?void 0:m.params)==null?void 0:x.orgId)||""}/errorPayment`)))):i.context==="qr"&&(gi(i),i.navigation?i.navigation.redirectToError():i.redirect&&i.redirect(`/${((p=(_=i.route)==null?void 0:_.params)==null?void 0:p.orgId)||""}/errorPayment`)),o.isButtonDisabled=!1},handleOrderPayError(s,i){var f,h,m,x;const u=Zs(s);u&&(i.showNotification(u),ro(i),i.is_requestKiosk?((h=i.orderErrors)!=null&&h.includes((f=s.response)==null?void 0:f.status)&&(i.cartCleanup.cleanupAndNavigate("retryPage",i.is_requestKiosk),i.deleteCart("retryPage",i.is_requestKiosk)),cn(i,null)):(gi(i),i.navigation?i.navigation.redirectToError():i.redirect&&i.redirect(`/${((x=(m=i.route)==null?void 0:m.params)==null?void 0:x.orgId)||""}/errorPayment`),cn(i,null)))},handleOrderError(s){var i,u;s.is_requestKiosk?s.cartCleanup?s.cartCleanup.cleanupAndNavigate("retryPage",s.is_requestKiosk):s.deleteCart("retryPage",s.is_requestKiosk):s.is_tableservice?s.showNotification("Ошибка создания заказа. Пожалуйста, попробуйте еще раз"):(gi(s),s.navigation?s.navigation.redirectToError():s.redirect&&(o.isButtonDisabled=!1,s.redirect(`/${((u=(i=s.route)==null?void 0:i.params)==null?void 0:u.orgId)||""}/errorPayment`)))},handleCreateOrderError(s,i){var m,x,_,p,C,y;const{is_requestKiosk:u,is_tableservice:f}=i,h=i.route.params.orgId;u?(((m=s==null?void 0:s.response)==null?void 0:m.status)===403&&((x=i.on403Kiosk)==null||x.call(i),(_=i.redirect)==null||_.call(i,`/${h}/retryPage`)),i.deleteCart("retryPage",u)):f?i.showNotification(((C=(p=s==null?void 0:s.response)==null?void 0:p.data)==null?void 0:C.user_friendly_message)||"Ошибка создания заказа"):(y=i.redirect)==null||y.call(i,`/${h}/errorPayment`)}}}const Su=()=>{const o=St();let s=null;const i=mi(),u=(f,h)=>{var x,_;const m=(x=f.params)==null?void 0:x.status;if(m==="sent"){if(no(f,h)){o.isButtonDisabled=!1;return}Fr(f.params.order_id||"",h.method).catch(p=>{const C=h.errorHandler||i,y=h.ws||s;C.handlePaymentError(p,{...h,closeWebSocket:()=>Cn(y)})})}else if(m==="waiting_for_fiscalization")cn(h,1);else if(m==="payment_initiation_retry"||m==="fiscalized")qs(f,h,s,i);else if(m==="payment_initiation")cn(h,2);else if(m==="paid"){cn(h,3);const p=h.ws||s;Cn(p),localStorage.removeItem("cart")}else(_=h.orderErrors)!=null&&_.includes(m)&&io(h,s,i)};return{handleWebSocketStatus(f,h){u(f,h)}}};function Nu(){const o=St();let s=null;const i=mi(),u=(f,h)=>{var x,_,p,C;const m=(x=f.params)==null?void 0:x.status;if((_=f.params)!=null&&_.number&&(o.orderNumber=(p=f.params)==null?void 0:p.number),m==="sent"){if(no(f,h)){o.isButtonDisabled=!1;return}Fr(f.params.order_id||"",h.method).catch(y=>{const S=h.errorHandler||i,M=h.ws||s;S.handlePaymentError(y,{...h,closeWebSocket:()=>Cn(M)})})}else if(m==="sent_fiscalization")cn(h,1);else if(m==="waiting_payment")cn(h,4);else if(m==="paid"){cn(h,3);const y=h.ws||s;Cn(y),localStorage.removeItem("cart")}else(C=h.orderErrors)!=null&&C.includes(m)&&(o.isButtonDisabled=!1,io(h,s,i))};return{handleWebSocketStatus(f,h){u(f,h)}}}const Tu=()=>{const o=St();let s=null;const i=mi(),u=(f,h)=>{var x,_;const m=(x=f.params)==null?void 0:x.status;if(m==="sent"){if(no(f,h)){o.isButtonDisabled=!1;return}Fr(f.params.order_id||"",h.method).then(p=>{if(h.is_tableservice){const C=h.ws||s;js(h,C)}else p.url&&window.location.replace(p.url)}).catch(p=>{const C=h.errorHandler||i,y=h.ws||s;C.handlePaymentError(p,{...h,closeWebSocket:()=>Cn(y)})})}else if(m==="payment_initiation_retry"||m==="fiscalized")qs(f,h,s,i);else if(m==="payment_initiation")cn(h,2);else if(m==="paid"){cn(h,3);const p=h.ws||s;Cn(p),localStorage.removeItem("cart")}else(_=h.orderErrors)!=null&&_.includes(m)&&(o.isButtonDisabled=!1,io(h,s,i))};return{handleWebSocketStatus(f,h){u(f,h)}}};class Ln{static initialize(){this.register({id:"TERMINAL_BASE",method:"TERMINAL",handlerFactory:Su,availableContexts:["kiosk"]}),this.register({id:"YOOKASSA_BASE",method:"YOOKASSA",handlerFactory:Tu,availableContexts:["qr","tableservice"]}),this.register({id:"SBP",method:"YOOKASSA",handlerFactory:Nu,availableContexts:["kiosk"]})}static register(s){this.methods.set(s.id,s)}static getConfig(s){return this.methods.get(s)??null}static getAvailableMethods(s){return Array.from(this.methods.entries()).filter(([i,u])=>u.availableContexts.includes(s)).map(([i])=>i)}static isMethodAvailable(s,i){const u=this.getConfig(s);return u?u.availableContexts.includes(i):!1}static createHandler(s){const i=this.getConfig(s);return i?i.handlerFactory():(console.warn(`PaymentMethodRegistry: метод оплаты ${s} не зарегистрирован`),null)}}Xe(Ln,"methods",new Map),Ln.initialize();function ku(o){return{cleanupAndNavigate(s,i){o.deleteCart(s,i)},cleanup(s){o.deleteCart(null,s)},clearTokens(){o.deleteCart(null,!0)},resetStores(){o.resetStores()}}}function Ru(o){var i,u;const s=((u=(i=o.route)==null?void 0:i.params)==null?void 0:u.orgId)||"";return{redirectToError(){const f=`/${s}/errorPayment`;o.redirect?o.redirect(f):o.router&&o.router.push(f)},redirectToSuccess(f){const h=f?`/${s}/${f}`:`/${s}/profile`;o.redirect?o.redirect(h):o.router&&o.router.push(h)},redirect(f){o.redirect?o.redirect(f):o.router&&o.router.push(f)},getErrorPath(){return`/${s}/errorPayment`},getSuccessPath(){return`/${s}/profile`}}}const St=we.defineStore("cartLib",()=>{const o=ke.useRouter(),s=ke.useRoute(),i=It(),u=lt(),{config_lib:f,countBonus:h,totalPrice_lib:m,initialCartPrice_lib:x,is18Allowed:_}=we.storeToRefs(u),{itemThemes:p}=we.storeToRefs(i),C=l.ref(!1),y=l.ref(""),S=l.ref(null),M=l.ref("wait"),T=l.ref(!1),D=l.ref(0),v=l.ref(""),U=l.ref([]),P=l.ref([]),O=l.ref(),B=l.ref(0),$=l.ref(!1),K=l.ref(),W=l.ref(null),ie=l.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),V=l.ref("Оплатить"),ae=l.ref(),j=l.computed({get:()=>U.value||[],set:Oe=>{(Oe==null?void 0:Oe.length)===1&&(ae.value=Oe[0]),U.value=Oe}}),G=l.ref(!1),z=l.ref(null),X=l.ref(0),N=l.ref(!1),Q=l.ref({textNotification:""}),H=Oe=>{N.value=!0,Q.value.textNotification=Oe},te=()=>{var Oe,qe;return(Oe=O.value)!=null&&Oe.front_type?O.value.front_type:((qe=P.value[0])==null?void 0:qe.front_type)||null},q=(Oe,qe,Qe,Ot)=>{var pt;const ce=Ot??((pt=P.value[0])==null?void 0:pt.front_type);if(!ce)return console.warn("Не удалось определить метод оплаты"),null;const He=Ln.getConfig(ce);if(!He||!Ln.isMethodAvailable(ce,Oe))return console.warn(`Метод ${ce} недоступен для контекста ${Oe}`),null;const $e=Ln.createHandler(ce);return $e?(K.value=re(He.method,Oe,qe,Qe),{handler:$e,config:K.value}):(console.warn(`Не удалось создать обработчик для метода ${ce}`),null)},re=(Oe,qe,Qe,Ot)=>{const ce={method:Oe,context:qe,is_requestKiosk:Qe,is_tableservice:Ot,router:o,route:s,orderErrors:ie.value,area:f.value.area,has_rms_discount:f.value.has_rms_discount,totalPrice:m,initialCartPrice:x,showNotification:H,deleteCart:Ve,resetStores:ct,redirect:Je=>o.push(Je),updateOrderStatus:Je=>{z.value=Je},setOrderNumber:Je=>{W.value=Je},loadCart:()=>u.loadCart(),resetBonuses:()=>{h.value=0}},He=mi(),$e=ku(ce),pt=Ru(ce);return{...ce,errorHandler:He,cartCleanup:$e,navigation:pt}},me=l.computed(()=>!!S.value),xe=Oe=>{M.value=Oe},Ie=Oe=>{S.value=Oe},_e=()=>{p.value.kiosk_show_loyalty_card_button&&p.value.kiosk_show_loyalty_phone_input_button?C.value=!0:!p.value.kiosk_show_loyalty_card_button&&p.value.kiosk_show_loyalty_phone_input_button?u.is_OpenLoyal=!0:C.value=!0,M.value="wait",y.value=""},Me=()=>{C.value=!1,M.value="wait",y.value=""},ge=()=>{S.value=null,y.value="",M.value="wait",Me()},ct=()=>{G.value=!1,z.value=null},Ve=(Oe=null,qe=!1)=>{u.cartProducts_lib=[],fr(["cart"]),qe&&(fr(["authTokensAccess","authTokensRefresh","user"]),u.profile=null,sessionStorage.removeItem("is_adult"),_.value=!1),Oe&&o.push(`/${s.params.orgId}/${Oe}`)};return{isButtonDisabled:G,orderCompleted_lib:z,extraDiscount:D,orderNumber:W,is_notification_lib:N,notificationData_lib:Q,textPaymentBtn_lib:V,count:X,guestInfo:S,error:y,isDrawerOpen:C,currentState:M,isAuthorized:me,discountBtn:T,linkQR:v,orderTypes:j,providerTypes:P,is_paymentCart:$,selectedOrderType:ae,selectedProvider:O,configPayment:K,paymentCostQR:B,deleteCart:Ve,setGuestInfo:Ie,setState:xe,openDrawer:_e,closeDrawer:Me,clearCard:ge,showNotification:H,createPaymentHandler:q,getCurrentPaymentMethodId:te,getAvailablePaymentMethods:Oe=>Ln.getAvailableMethods(Oe)}}),Rt=we.defineStore("cardLib",()=>{var ae;const o=()=>({openCard:null,currentModifier:null,groupModifiers:[],groupModifiersSelected:[],groupCurrentOpen:null,isModifiedAmount:!1,selectedSize:{},productSizes:[],addedProducts:[],plusButtonsRefs:[],modalCount:1,isSectionModifier:!1,isAnimationFly:!0,textErrorRequaired:""}),s=It(),i=l.ref(o()),u=()=>i.value=o(),f=l.ref(!1),h=l.ref(!1),m=l.ref(!1),x=l.ref(),_=l.ref([]),p=l.ref({id:null,visible:!1}),C=l.ref(!((ae=s.itemThemes)!=null&&ae.kiosk_disable_lock_screen)),y=l.computed(()=>{const j=i.value.groupModifiersSelected.findIndex(G=>G.group===i.value.groupCurrentOpen.id);return S(j)}),S=j=>j===-1?0:(i.value.groupModifiersSelected[j].modifiers||[]).reduce((z,X)=>z+(X.amount||0),0),M=l.computed(()=>{var G;const j=(G=i.value.openCard)==null?void 0:G.group_modifiers.findIndex(z=>z.id===i.value.groupCurrentOpen.id);return j===-1||!i.value.openCard?0:i.value.openCard.modifiers.length>0&&j===0?i.value.openCard.modifiers.reduce((z,X)=>z+X.max_amount,0):i.value.groupModifiers[j].max_amount}),T=l.computed(()=>{var G;const j=(i.value.addedProducts??[]).reduce((z,X)=>z+X.price,0);if(i.value.openCard){const z=i.value.openCard,X=dr(z)||0,N=z.amount||1;return(i.value.groupModifiersSelected.reduce((H,te)=>(te.modifiers.forEach(q=>{var re,me;q.sizes&&(q.price=((me=(re=q.sizes)==null?void 0:re.find(xe=>xe.id===i.value.selectedSize.id))==null?void 0:me.price)??q.price),H+=q.price*q.amount}),H),0)+X)*N+j}return(G=i.value.addedProducts)!=null&&G.length?j:0}),D=l.computed(()=>{const j=i.value.groupModifiers,G=i.value.groupModifiersSelected;for(let z=0;z<j.length;z++){const X=j[z],N=G[z];if(X.min_amount>0&&S(z)<X.min_amount)return i.value.textErrorRequaired=`В группе "${X.name}" должно содержаться не меньше ${X.min_amount} модификатора(ов)`,{haveRequaire:!0,group:X};for(const Q of X.group_modifiers)if(Q.min_amount>0){const H=N.modifiers.find(te=>te.id===Q.id);if(!H||H.amount<Q.min_amount)return i.value.textErrorRequaired=`В группе "${X.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:X}}}return{haveRequaire:!1,group:j[0]}}),v=()=>{i.value.groupModifiers.forEach((j,G)=>{i.value.groupCurrentOpen={...j,index:G},j.group_modifiers.forEach(z=>{z.default_amount>0&&(z.amount=z.default_amount,ie(z,!0))})})},U=j=>{i.value.addedProducts.push(j)},P=j=>{i.value.openCard=j},O=j=>{_.value=[...j]},B=(j,G)=>{var X,N;const z=j.id!==((X=i.value.groupCurrentOpen)==null?void 0:X.id);i.value.groupCurrentOpen={...j,index:G},z?i.value.isSectionModifier=!0:i.value.isSectionModifier=!i.value.isSectionModifier,(N=i.value.plusButtonsRefs[G])==null||N.scrollIntoView({behavior:"smooth",block:"start"})},$=()=>{i.value.modalCount>i.value.currentModifier.min_amount&&i.value.modalCount>=2&&(i.value.modalCount-=1)},K=()=>{i.value.groupCurrentOpen&&i.value.modalCount+y.value<M.value&&(i.value.currentModifier.max_amount===0||i.value.currentModifier.max_amount>i.value.modalCount)&&(i.value.modalCount+=1)},W=(j,G)=>{var X;const z=(X=i.value.groupCurrentOpen)==null?void 0:X.id.toUpperCase();if(!j&&!i.value.isModifiedAmount&&G.max_amount!==1){if(z==="Добавки2000"&&G.max_amount>1)return!0;if(Math.abs(M.value-y.value)>1&&z!=="Добавки2000")return!0}return!1},ie=(j,G=!1)=>{i.value.modalCount=1,i.value.currentModifier=j;const z=i.value.groupModifiersSelected.findIndex(X=>X.group===i.value.groupCurrentOpen.id);V(z,j,G)},V=(j,G,z)=>{var N,Q;let X=i.value.groupModifiersSelected;if(G.sizes.length>0&&G.sizes.find(H=>{var te;return H.id===((te=i.value.selectedSize)==null?void 0:te.id)}),j===-1)W(z,G)?i.value.isModifiedAmount=!0:X[i.value.groupCurrentOpen.index]={group:i.value.groupCurrentOpen.id,is_fake:((N=i.value.groupCurrentOpen)==null?void 0:N.is_fake)||!1,is_product_determining:((Q=i.value.groupCurrentOpen)==null?void 0:Q.is_product_determining)||!1,modifier_count:0,modifiers:[{...G,amount:(G==null?void 0:G.amount)??1}]};else{const H=i.value.groupModifiers[j].group_modifiers.findIndex(q=>q.id===G.id);if(X[j].modifiers.findIndex(q=>q.id===G.id)===-1){if(M.value===1)X[j].modifiers=[];else if(y.value>=M.value)return;W(z,G)?i.value.isModifiedAmount=!0:(X[j].modifiers.push({...G,amount:(G==null?void 0:G.amount)??1}),X[j].modifier_count=X[j].modifiers.reduce((q,re)=>q+=re.amount,0),i.value.isAnimationFly=!0)}else X[j].modifiers=X[j].modifiers.filter(q=>q.id!==G.id),X[j].modifier_count=X[j].modifiers.reduce((q,re)=>q+=re.amount,0),i.value.groupModifiers[j].group_modifiers[H].amount=1,i.value.groupModifiers[j].group_modifiers[H].default_amount=0,i.value.isAnimationFly=!1}i.value.groupModifiersSelected=X};return{stateCard:i,totalPrice_libCard:T,recountGroupTotalAmount:y,groupTotalAmount:M,isOpenWindow:f,isUpSale:h,checkedRequiredBtn:D,dataUpSale:x,productCards:_,isAddToCard:m,openProduct:p,is_startPage:C,setProduct:O,summModifierAmount:S,setAddedProducts:U,setCurrentCard:P,minusAmount:$,plusAmount:K,toggleNotRequire:B,modifierSelect:ie,defaultAmountModifiers:v,reset:u}});var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ys(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var $s={exports:{}};(function(o,s){(function(i,u){o.exports=u()})(pr,function(){var i=1e3,u=6e4,f=36e5,h="millisecond",m="second",x="minute",_="hour",p="day",C="week",y="month",S="quarter",M="year",T="date",D="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(X){var N=["th","st","nd","rd"],Q=X%100;return"["+X+(N[(Q-20)%10]||N[Q]||N[0])+"]"}},O=function(X,N,Q){var H=String(X);return!H||H.length>=N?X:""+Array(N+1-H.length).join(Q)+X},B={s:O,z:function(X){var N=-X.utcOffset(),Q=Math.abs(N),H=Math.floor(Q/60),te=Q%60;return(N<=0?"+":"-")+O(H,2,"0")+":"+O(te,2,"0")},m:function X(N,Q){if(N.date()<Q.date())return-X(Q,N);var H=12*(Q.year()-N.year())+(Q.month()-N.month()),te=N.clone().add(H,y),q=Q-te<0,re=N.clone().add(H+(q?-1:1),y);return+(-(H+(Q-te)/(q?te-re:re-te))||0)},a:function(X){return X<0?Math.ceil(X)||0:Math.floor(X)},p:function(X){return{M:y,y:M,w:C,d:p,D:T,h:_,m:x,s:m,ms:h,Q:S}[X]||String(X||"").toLowerCase().replace(/s$/,"")},u:function(X){return X===void 0}},$="en",K={};K[$]=P;var W="$isDayjsObject",ie=function(X){return X instanceof G||!(!X||!X[W])},V=function X(N,Q,H){var te;if(!N)return $;if(typeof N=="string"){var q=N.toLowerCase();K[q]&&(te=q),Q&&(K[q]=Q,te=q);var re=N.split("-");if(!te&&re.length>1)return X(re[0])}else{var me=N.name;K[me]=N,te=me}return!H&&te&&($=te),te||!H&&$},ae=function(X,N){if(ie(X))return X.clone();var Q=typeof N=="object"?N:{};return Q.date=X,Q.args=arguments,new G(Q)},j=B;j.l=V,j.i=ie,j.w=function(X,N){return ae(X,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var G=function(){function X(Q){this.$L=V(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[W]=!0}var N=X.prototype;return N.parse=function(Q){this.$d=function(H){var te=H.date,q=H.utc;if(te===null)return new Date(NaN);if(j.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var re=te.match(v);if(re){var me=re[2]-1||0,xe=(re[7]||"0").substring(0,3);return q?new Date(Date.UTC(re[1],me,re[3]||1,re[4]||0,re[5]||0,re[6]||0,xe)):new Date(re[1],me,re[3]||1,re[4]||0,re[5]||0,re[6]||0,xe)}}return new Date(te)}(Q),this.init()},N.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},N.$utils=function(){return j},N.isValid=function(){return this.$d.toString()!==D},N.isSame=function(Q,H){var te=ae(Q);return this.startOf(H)<=te&&te<=this.endOf(H)},N.isAfter=function(Q,H){return ae(Q)<this.startOf(H)},N.isBefore=function(Q,H){return this.endOf(H)<ae(Q)},N.$g=function(Q,H,te){return j.u(Q)?this[H]:this.set(te,Q)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(Q,H){var te=this,q=!!j.u(H)||H,re=j.p(Q),me=function(Oe,qe){var Qe=j.w(te.$u?Date.UTC(te.$y,qe,Oe):new Date(te.$y,qe,Oe),te);return q?Qe:Qe.endOf(p)},xe=function(Oe,qe){return j.w(te.toDate()[Oe].apply(te.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(qe)),te)},Ie=this.$W,_e=this.$M,Me=this.$D,ge="set"+(this.$u?"UTC":"");switch(re){case M:return q?me(1,0):me(31,11);case y:return q?me(1,_e):me(0,_e+1);case C:var ct=this.$locale().weekStart||0,Ve=(Ie<ct?Ie+7:Ie)-ct;return me(q?Me-Ve:Me+(6-Ve),_e);case p:case T:return xe(ge+"Hours",0);case _:return xe(ge+"Minutes",1);case x:return xe(ge+"Seconds",2);case m:return xe(ge+"Milliseconds",3);default:return this.clone()}},N.endOf=function(Q){return this.startOf(Q,!1)},N.$set=function(Q,H){var te,q=j.p(Q),re="set"+(this.$u?"UTC":""),me=(te={},te[p]=re+"Date",te[T]=re+"Date",te[y]=re+"Month",te[M]=re+"FullYear",te[_]=re+"Hours",te[x]=re+"Minutes",te[m]=re+"Seconds",te[h]=re+"Milliseconds",te)[q],xe=q===p?this.$D+(H-this.$W):H;if(q===y||q===M){var Ie=this.clone().set(T,1);Ie.$d[me](xe),Ie.init(),this.$d=Ie.set(T,Math.min(this.$D,Ie.daysInMonth())).$d}else me&&this.$d[me](xe);return this.init(),this},N.set=function(Q,H){return this.clone().$set(Q,H)},N.get=function(Q){return this[j.p(Q)]()},N.add=function(Q,H){var te,q=this;Q=Number(Q);var re=j.p(H),me=function(_e){var Me=ae(q);return j.w(Me.date(Me.date()+Math.round(_e*Q)),q)};if(re===y)return this.set(y,this.$M+Q);if(re===M)return this.set(M,this.$y+Q);if(re===p)return me(1);if(re===C)return me(7);var xe=(te={},te[x]=u,te[_]=f,te[m]=i,te)[re]||1,Ie=this.$d.getTime()+Q*xe;return j.w(Ie,this)},N.subtract=function(Q,H){return this.add(-1*Q,H)},N.format=function(Q){var H=this,te=this.$locale();if(!this.isValid())return te.invalidDate||D;var q=Q||"YYYY-MM-DDTHH:mm:ssZ",re=j.z(this),me=this.$H,xe=this.$m,Ie=this.$M,_e=te.weekdays,Me=te.months,ge=te.meridiem,ct=function(qe,Qe,Ot,ce){return qe&&(qe[Qe]||qe(H,q))||Ot[Qe].slice(0,ce)},Ve=function(qe){return j.s(me%12||12,qe,"0")},Oe=ge||function(qe,Qe,Ot){var ce=qe<12?"AM":"PM";return Ot?ce.toLowerCase():ce};return q.replace(U,function(qe,Qe){return Qe||function(Ot){switch(Ot){case"YY":return String(H.$y).slice(-2);case"YYYY":return j.s(H.$y,4,"0");case"M":return Ie+1;case"MM":return j.s(Ie+1,2,"0");case"MMM":return ct(te.monthsShort,Ie,Me,3);case"MMMM":return ct(Me,Ie);case"D":return H.$D;case"DD":return j.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return ct(te.weekdaysMin,H.$W,_e,2);case"ddd":return ct(te.weekdaysShort,H.$W,_e,3);case"dddd":return _e[H.$W];case"H":return String(me);case"HH":return j.s(me,2,"0");case"h":return Ve(1);case"hh":return Ve(2);case"a":return Oe(me,xe,!0);case"A":return Oe(me,xe,!1);case"m":return String(xe);case"mm":return j.s(xe,2,"0");case"s":return String(H.$s);case"ss":return j.s(H.$s,2,"0");case"SSS":return j.s(H.$ms,3,"0");case"Z":return re}return null}(qe)||re.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(Q,H,te){var q,re=this,me=j.p(H),xe=ae(Q),Ie=(xe.utcOffset()-this.utcOffset())*u,_e=this-xe,Me=function(){return j.m(re,xe)};switch(me){case M:q=Me()/12;break;case y:q=Me();break;case S:q=Me()/3;break;case C:q=(_e-Ie)/6048e5;break;case p:q=(_e-Ie)/864e5;break;case _:q=_e/f;break;case x:q=_e/u;break;case m:q=_e/i;break;default:q=_e}return te?q:j.a(q)},N.daysInMonth=function(){return this.endOf(y).$D},N.$locale=function(){return K[this.$L]},N.locale=function(Q,H){if(!Q)return this.$L;var te=this.clone(),q=V(Q,H,!0);return q&&(te.$L=q),te},N.clone=function(){return j.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},X}(),z=G.prototype;return ae.prototype=z,[["$ms",h],["$s",m],["$m",x],["$H",_],["$W",p],["$M",y],["$y",M],["$D",T]].forEach(function(X){z[X[1]]=function(N){return this.$g(N,X[0],X[1])}}),ae.extend=function(X,N){return X.$i||(X(N,G,ae),X.$i=!0),ae},ae.locale=V,ae.isDayjs=ie,ae.unix=function(X){return ae(1e3*X)},ae.en=K[$],ae.Ls=K,ae.p={},ae})})($s);var Ou=$s.exports;const Ks=Ys(Ou),Bu=o=>{const s=ke.useRouter(),i=`${o.domain}/api/`,u=nt.create({baseURL:i}),f=nt.create({baseURL:i}),h=nt.create({baseURL:i}),m=nt.create({baseURL:i}),x=nt.create({baseURL:i}),_=nt.create({baseURL:i}),p=nt.create({baseURL:i}),C=P=>{try{const O=JSON.parse(localStorage.getItem("authTokensAccess")||"");O.length>0&&(P.headers.Authorization=`Bearer ${O}`)}catch{console.warn("accessToken is undefined [useAxios]")}return P},y=P=>{const O=localStorage.getItem("apiKey");return P.headers={"Content-Type":"application/json","x-api-key":O},P},S=async P=>{if(!o.user)return P;const O=o.user.exp??0;if(!(Ks.unix(O).diff(Ks())<3e3))return P;const $=ss("authTokensRefresh",null,"string");try{const K=await nt.post(`${i}user/token/refresh/`,{refresh:$.value});if(!K.data.access)return U(),P;localStorage.setItem("authTokensAccess",JSON.stringify(K.data.access)),D(K.data),v(os(K.data.access)),P.headers={...P.headers,Authorization:`Bearer ${K.data.access}`}}catch(K){console.error("Failed to refresh token:",K),U()}return P},M=P=>{P.interceptors.request.use(O=>S(C(O)),O=>Promise.reject(O))};M(h),M(x),M(p);const T=P=>{P.interceptors.request.use(O=>y(O))};T(_),T(f),T(p);const D=(P,O=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(P.access)),O&&localStorage.setItem("authTokensRefresh",JSON.stringify(P.refresh))},v=P=>{o.user=P,localStorage.setItem("user",JSON.stringify(P))},U=()=>{o.user=null,fr(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),s.replace({name:"home"}).then(()=>window.location.reload())};return{axiosInstanceAuthenticationGet:h,axiosInstanceAuthenticationPost:x,axiosInstanceAuthenticationPostApiKey:p,axiosInstancePost:m,axiosInstanceGet:u,axiosInstanceGetApiKey:f,axiosInstancePostApiKey:_}},Qs=(o="themeConfig")=>{try{const s=localStorage.getItem(o);return s?JSON.parse(s):null}catch{return null}},Le=class Le{constructor(){Xe(this,"axiosInstanceGet");Xe(this,"axiosInstancePost");Xe(this,"axiosInstanceAuthenticationGet");Xe(this,"axiosInstanceAuthenticationPost");Xe(this,"axiosInstanceGetApiKey");Xe(this,"axiosInstancePostApiKey");Xe(this,"axiosInstanceAuthenticationPostApiKey");Xe(this,"currentUpsaleController",null);Xe(this,"controller",new AbortController);this.axiosInstanceGet=Le._axiosGet,this.axiosInstancePost=Le._axiosPost,this.axiosInstanceGetApiKey=Le._axiosPostApiKey,this.axiosInstancePostApiKey=Le._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=Le._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=Le._axiosAuthGet,this.axiosInstanceAuthenticationPost=Le._axiosAuthPost}static create(s){return s&&!Le._config&&Le._initialize(s),Le._config||console.warn("InitConnection не инициализирован"),new Le}static _initialize(s,i=null){const u=lt(),f=Rt(),{config_lib:h}=we.storeToRefs(u),{stateCard:m,recountGroupTotalAmount:x}=we.storeToRefs(f);Le._config=s,Le._cardStore=f,Le._stateCard=m,Le._recountGroupTotalAmount=x,h.value=s;const _=Bu(s);Le._axiosPostApiKey=_.axiosInstanceGetApiKey,Le._axiosPostApiKey=_.axiosInstancePostApiKey,Le._axiosAuthPostApiKey=_.axiosInstanceAuthenticationPostApiKey,Le._axiosGet=_.axiosInstanceGet,Le._axiosPost=_.axiosInstancePost,Le._axiosAuthGet=_.axiosInstanceAuthenticationGet,Le._axiosAuthPost=_.axiosInstanceAuthenticationPost}get config(){return Le._config}get cardStore(){return Le._cardStore}get stateCard(){return Le._stateCard}get recountGroupTotalAmount(){return Le._recountGroupTotalAmount}async updateTheme(){var h,m;const s=Qs(),i=It();if(s!==null){i.updateColor(s);return}const u=lt(),f=await((m=this.axiosInstanceGet)==null?void 0:m.get(`org/organizations/${(h=this.config)==null?void 0:h.orgId}/design/`));u.setStateDrum(f==null?void 0:f.data.hide_barban),u.setKioskTimeout(f==null?void 0:f.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(f.data)),i.updateColor(f.data)}async getGroupByID(s){var i,u;try{const f=await((u=this.axiosInstanceGet)==null?void 0:u.get(`${(i=this.config)==null?void 0:i.pointId}/group/${s}`));return f==null?void 0:f.data}catch(f){throw console.error("Ошибка в request.ts[getGroupByID]",f),f}}async loadGroupProducts(s){var i,u;try{const f=await((u=this.axiosInstanceGet)==null?void 0:u.get(`${(i=this.config)==null?void 0:i.pointId}/products/?group=${s}`)),h=(f==null?void 0:f.data)||[];for(const m of h)m&&await El(m);return await this.cacheImagesInBackground(h),h}catch(f){return console.error("Ошибка загрузки группы:",f),[]}}async getGroup(){var s,i;try{const u=await((i=this.axiosInstanceGet)==null?void 0:i.get(`${(s=this.config)==null?void 0:s.pointId}/groups/`));return u==null?void 0:u.data}catch(u){return console.error("Error fetching products:",u),[]}}async fetchAndCacheAllPages(){var s,i;try{const u=((s=this.config)==null?void 0:s.pointId)||"",f=await Hi(u);if(f)return f.data;const h=await((i=this.axiosInstanceGet)==null?void 0:i.get(`${u}/group/`)),m=(h==null?void 0:h.data)||[],x=[];for(const _ of m){_.products=_.products||[],await Rr(_.id,_),x.push(_);const p=await this.loadGroupProducts(_.id);_.products=p}return await this.cacheImagesInBackground(m),await Rr(u,m),x}catch(u){return console.error("fetchAndCacheAllPages error:",u),[]}}cacheImagesInBackground(s){s.forEach(i=>{var u;i.video_link&&this.loadAndCacheMedia(i.video_link,i.id+"_video"),i.image_link&&this.loadAndCacheMedia(i.image_link,i.id+"_image"),(u=i.products)==null||u.forEach(f=>{f.video_link&&this.loadAndCacheMedia(f.video_link,f.id+"_video"),f.image_link&&this.loadAndCacheMedia(f.image_link,f.id+"_image")})})}async loadAndCacheMedia(s,i){const u=await ur(i);if(u){this.dispatchImageCachedEvent(i,u);return}try{const f=await fetch(s);if(!f.ok)throw new Error("Network error");const h=await f.blob();if(h.size===0)throw new Error("Empty blob");await Gi(i,h),this.dispatchImageCachedEvent(i,h)}catch(f){console.warn(`[ImageCache] Failed for ${i}:`,f)}}dispatchImageCachedEvent(s,i){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:s,blob:i}}))}async getProduct(s=null){var i,u;if(!s)return[];try{const f=await((u=this.axiosInstanceGet)==null?void 0:u.get(`${(i=this.config)==null?void 0:i.pointId}/products/${s}`));return f==null?void 0:f.data}catch(f){return console.error("Error fetching cardProducts:",f),[]}}async getSingleProduct(s){var f;const i=lt(),{config_lib:u}=we.storeToRefs(i);try{let h=await $o(s);if(h)this._fullCardProduct(h);else{const m=await((f=this.axiosInstanceGet)==null?void 0:f.get(`${u.value.pointId}/products/${s}`));(m==null?void 0:m.status)===200&&this._fullCardProduct(m.data)}}catch(h){throw console.warn("store card[getFetchProducts]:",h),h}}_fullCardProduct(s){const i=Rt();i.stateCard.openCard={...s,amount:1},i.stateCard.groupModifiers=s.group_modifiers,s.modifiers.length>0&&i.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:s.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:s.modifiers.reduce((u,f)=>u+=f.min_amount,0),name:"Добавки",required:!1}),i.stateCard.groupModifiersSelected=new Array(i.stateCard.groupModifiers.length).fill({group:"",modifiers:[],is_fake:!1,is_product_determining:!1,modifier_count:0}),i.stateCard.productSizes=s.sizes,i.defaultAmountModifiers(),s.show_recommendations&&this.productUpsale(s.id)}async getTheme(){try{this.updateTheme()}catch(s){return console.error("Error fetching products:",s),[]}}async authorizeByCard(s){var i,u;try{const f=await((u=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:u.post(`${(i=this.config)==null?void 0:i.domain}/api/user/validate-card/`,{card_number:s}));return localStorage.setItem("authTokensAccess",JSON.stringify(f==null?void 0:f.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(f==null?void 0:f.data.refresh)),f==null?void 0:f.data}catch(f){throw console.error("Ошибка авторизации:",f),f}}async getLoyalSmsCode(s){var i,u;try{const f=await((u=this.axiosInstancePostApiKey)==null?void 0:u.post(`${(i=this.config)==null?void 0:i.domain}/api/device/auth/request-otp/`,{phone:s}));return f==null?void 0:f.data}catch(f){throw console.error("Ошибка получения sms-code:",f),f}}async sendSmsCodeForAuth(s,i){var u,f;try{const h=await((f=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:f.post(`${(u=this.config)==null?void 0:u.domain}/api/device/auth/`,{code:s,phone:i}));return h==null?void 0:h.data}catch(h){throw console.error("Ошибка отправки sms-code:",h),h}}async callStaff(s,i,u){var f,h,m,x;try{const _=await((m=this.axiosInstancePost)==null?void 0:m.post(`${(f=this.config)==null?void 0:f.domain}/api/org_unit/${(h=this.config)==null?void 0:h.pointId}/table/${s}/call-staff/`,{...i},u));return(x=_==null?void 0:_.data)==null?void 0:x.response_text}catch(_){throw console.error("Ошибка[callStaff]",_),_}}async createOrder(s,i,u=!0,f,h=!1,m=!1,x){var D,v,U,P,O;const _=St(),p=h?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,C=u?p:this.axiosInstanceAuthenticationPost,y=u?"/device/order/create":"/order/create",S=u?(D=this.config)==null?void 0:D.pointId:(v=this.config)==null?void 0:v.pointId,M={items:s,table:i||null,comment:f};return u&&((U=_.selectedOrderType)!=null&&U.id)&&(M.order_type_id=(P=_.selectedOrderType)==null?void 0:P.id),await(C==null?void 0:C.post(`${(O=this.config)==null?void 0:O.domain}/api/org_unit/${S}${y}`,M,{signal:x}))}async initPaymentLink(s,i){const u=this.axiosInstanceAuthenticationPost,f=lt(),h=await(u==null?void 0:u.post("payment/init",{by_bonuses:f.countBonus,order:s,provider_type:i}));return h==null?void 0:h.data}async orderPay(s){var i;return(i=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:i.post(`order/${s}/pay/`,{order_id:s})}async getProfile(){var i,u;const s=await((u=this.axiosInstanceAuthenticationGet)==null?void 0:u.get(`user/current?organization=${(i=this.config)==null?void 0:i.orgId}`));if((s==null?void 0:s.status)===200){const f=lt();return f.profile=s.data,f.is18Allowed=sessionStorage.getItem("is_adult")==="true",s.data}else return s}async joinLoyalty(){var i;const s=await((i=this.axiosInstanceAuthenticationGet)==null?void 0:i.post("user/join-loyalty/"));return{success:(s==null?void 0:s.status)===200}}async isPhoneExist(s,i={}){var u,f;try{const h=await((f=this.axiosInstanceGet)==null?void 0:f.get("user/check-phone",{...i,params:{organization:(u=this.config)==null?void 0:u.orgId,phone:s}}));return(h==null?void 0:h.status)===200}catch{return!1}}async sendOTP(s,i={}){var f,h;const u=await((h=this.axiosInstancePost)==null?void 0:h.post("user/check-phone",{organization:(f=this.config)==null?void 0:f.orgId,phone:s},i));return u==null?void 0:u.data}async auth(s,i={}){var f,h;return await((h=this.axiosInstancePost)==null?void 0:h.post("user/auth",{organization:(f=this.config)==null?void 0:f.orgId,...s},i))}async signup(s,i={}){var f,h;return await((h=this.axiosInstancePost)==null?void 0:h.post("user/register",{organization:(f=this.config)==null?void 0:f.orgId,...s},i))}async calculateDiscount(s,i=!0,u=!1,f){var p,C;const h=u?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,m=i?h:this.axiosInstanceAuthenticationPost,x=i?(p=this.config)==null?void 0:p.pointId:(C=this.config)==null?void 0:C.pointId,_=await(m==null?void 0:m.post(`/org_unit/${x}/cart/calculate-discount/`,s,{signal:f}));return(_==null?void 0:_.status)===200?_.data:_}async maxPayByBonuses(s,i=!0,u=!1,f){const h=lt(),m=u?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,x=i?m:this.axiosInstanceAuthenticationPost,_=await(x==null?void 0:x.post("/cart/max-pay-by-bonuses/",{total_cart_price:s},{signal:f})),p=_==null?void 0:_.data;return h.profile&&p&&"balance"in p&&(h.profile.balance=p.balance),p}async getDeviceInfo(){var u;const s=St(),i=await((u=this.axiosInstanceGetApiKey)==null?void 0:u.get("/device/current/"));return(i==null?void 0:i.status)===200?(s.orderTypes=i.data.order_types,s.providerTypes=i.data.payment_provider_type,i.data):i}async validateApiKey(s,i){var f,h;const u=await((h=this.axiosInstancePost)==null?void 0:h.post(`/device/org_unit/${(f=this.config)==null?void 0:f.pointId}/validate-api-key/`,{api_key:s},i));return(u==null?void 0:u.status)===200}async productUpsale(s){var h,m,x;const i=Rt(),{dataUpSale:u}=we.storeToRefs(i);(h=this.currentUpsaleController)==null||h.abort();const f=new AbortController;this.currentUpsaleController=f;try{const _=await((x=this.axiosInstanceGet)==null?void 0:x.get(`/${(m=this.config)==null?void 0:m.pointId}/products/${s}/recommendation/`,{signal:f.signal}));f.signal.aborted||(u.value=_==null?void 0:_.data)}catch(_){if(_.name==="AbortError"||_.name==="CanceledError"){console.warn("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",_),_}finally{this.currentUpsaleController===f&&(this.currentUpsaleController=null)}}};Xe(Le,"_config",null),Xe(Le,"_axiosGet"),Xe(Le,"_axiosGetApiKey"),Xe(Le,"_axiosPostApiKey"),Xe(Le,"_axiosAuthPostApiKey"),Xe(Le,"_axiosPost"),Xe(Le,"_axiosAuthGet"),Xe(Le,"_axiosAuthPost"),Xe(Le,"_cardStore",null),Xe(Le,"_stateCard",null),Xe(Le,"_recountGroupTotalAmount",null);let En=Le;const Js=l.ref(!1),ea=l.ref(window.innerWidth),Nn=()=>{const o=l.computed({get:()=>Js.value,set:f=>{Js.value=f}}),s=l.computed(()=>o.value&&ea.value>1024),i=()=>ea.value=window.innerWidth;return l.onMounted(()=>{window.addEventListener("resize",i)}),l.onUnmounted(()=>{window.removeEventListener("resize",i)}),{isDesktop:o,shouldUseDragScroll:s,syncWithRoute:f=>{o.value=f.query.mode==="pdf"}}},Mu=l.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(o,{expose:s}){const i=o,u=lt(),f=l.ref(null),{isDesktop:h}=Nn(),m=async _=>{if(!f.value||!_)return;let p=window;i.container&&(p=typeof i.container=="string"?document.querySelector(i.container)||window:i.container);const C={behavior:i.behavior};if(i.axis==="x"){const y=p===window?window.innerWidth:p.clientWidth,S=_.offsetWidth;let M=_.offsetLeft;if(p!==window){const T=p.getBoundingClientRect();M=_.getBoundingClientRect().left-T.left+p.scrollLeft}M-=(y-S)/2,C.left=Math.max(0,M)}else{const y=p===window?window.innerHeight:p.clientHeight,S=_.offsetHeight;let M=_.offsetTop;if(p!==window){const T=p.getBoundingClientRect();M=_.getBoundingClientRect().top-T.top+p.scrollTop}M-=(y-S)/2,C.top=Math.max(0,M)}try{p===window?window.scrollTo(C):p.scrollTo(C)}catch(y){console.error("Scroll error:",y)}};l.onMounted(async()=>{if(i.autoScroll){let _=null;if(await l.nextTick(),u.activeScrolling_lib){const p=u.activeScrolling_lib.findIndex(C=>C.id===i.idActive);i.idActive?(_=document.getElementById(`scrolling${i.idActive}`),_&&p!==-1&&(u.activeScrolling_lib[p]=_)):u.activeScrolling_lib[p]&&(_=u.activeScrolling_lib[p]),m(_)}}});const x=async _=>{i.clearContainer&&(u.activeScrolling_lib=[]);const p=_.currentTarget;await l.nextTick(),u.activeScrolling_lib.includes(p)||u.activeScrolling_lib.push(p),m(p)};return s({scrollToElement:m}),(_,p)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"wrapperRef",ref:f,class:l.normalizeClass(["scroll-to-wrapper",{scroll_pdf:l.unref(h)}])},[l.renderSlot(_.$slots,"default",{handleTargetClick:x},void 0,!0)],2))}}),ze=(o,s)=>{const i=o.__vccOpts||o;for(const[u,f]of s)i[u]=f;return i},oo=ze(Mu,[["__scopeId","data-v-e47a167d"]]),Vr={mounted(o){let s=!1,i,u,f,h,m,x=0,_=0,p=0,C=0,y=0,S=!1;const M=5;o.style.cursor="grab";const T=U=>{U.button===0&&(m&&(cancelAnimationFrame(m),m=0),s=!0,S=!1,i=U.pageX-o.offsetLeft,u=U.pageY-o.offsetTop,f=o.scrollLeft,h=o.scrollTop,p=U.pageX,C=U.pageY,y=Date.now(),x=0,_=0)},D=U=>{if(!s)return;const P=U.pageX,O=U.pageY,B=Math.abs(P-p),$=Math.abs(O-C);if(!S&&(B>M||$>M)&&(S=!0,o.style.pointerEvents="none"),S){U.stopPropagation(),U.preventDefault();const K=Date.now(),W=K-y;W>0&&(x=(P-p)/W*16,_=(O-C)/W*16),p=P,C=O,y=K;const ie=P-o.offsetLeft,V=O-o.offsetTop,ae=ie-i,j=V-u;o.scrollLeft=f-ae,o.scrollTop=h-j}else p=P,C=O,y=Date.now()},v=U=>{if(s){if(S){if(U.stopPropagation(),U.preventDefault(),o.style.pointerEvents="",Math.abs(x)>.1||Math.abs(_)>.1){const P=()=>{o.scrollLeft-=x,o.scrollTop-=_,x*=.95,_*=.95,Math.abs(x)>.1||Math.abs(_)>.1?m=requestAnimationFrame(P):m=0};m=requestAnimationFrame(P)}}else o.style.pointerEvents="";s=!1,S=!1}};o.addEventListener("mousedown",T),window.addEventListener("mousemove",D),window.addEventListener("mouseup",v),o._dragScrollCleanup=()=>{m&&cancelAnimationFrame(m),o.removeEventListener("mousedown",T),window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",v),o.style.pointerEvents=""}},unmounted(o){o._dragScrollCleanup&&o._dragScrollCleanup()}},vu={},Du={id:"custom_svg_lib",width:"26.000000",height:"26.000000",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Pu(o,s){return l.openBlock(),l.createElementBlock("svg",Du,[...s[0]||(s[0]=[l.createElementVNode("defs",null,null,-1),l.createElementVNode("path",{id:"custom_svg_color",d:"M11.83 26L11.83 14.15L0 14.15L0 11.84L11.83 11.84L11.83 0L14.15 0L14.15 11.84L26 11.84L26 14.15L14.15 14.15L14.15 26L11.83 26Z",fill:"#FF6D2E","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const so=ze(vu,[["render",Pu]]),Lu=["id","onClick"],Fu={class:"modified_plus_btn"},Vu=["src"],Uu={key:2,class:"wrapper_modifier_item"},zu={key:0,class:"modifier_item_n_wrapper"},Hu=["src"],Gu={key:1,class:"modifier_plus_item"},Wu=["src"],Xu=["src"],ta=ze(l.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(o){const s=Rt(),i=It(),{stateCard:u}=we.storeToRefs(s),{itemThemes:f}=we.storeToRefs(i),{shouldUseDragScroll:h}=Nn(),m=l.ref([]),x=l.ref([]),_=l.ref(null),p=l.ref(null),C=S=>{S instanceof HTMLElement&&!m.value.includes(S)&&m.value.push(S)},y=S=>{p.value=S};return l.onMounted(async()=>{await l.nextTick(),u.value.plusButtonsRefs=m.value}),l.watchEffect(()=>{x.value=u.value.groupModifiersSelected,document.body.style.overflow=""}),l.onBeforeUnmount(()=>{m.value=[],u.value.plusButtonsRefs=[]}),(S,M)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({card_modified_wrapper_many:l.unref(u).groupModifiers.length>=5})},[l.unref(u).groupModifiersSelected?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["card_modified_wrapper",[l.unref(u).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:_},[l.createVNode(oo,{axis:"x",behavior:"smooth",container:_.value,autoScroll:!0,idActive:p.value,clearContainer:!0},{default:l.withCtx(({handleTargetClick:T})=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(u).groupModifiers,(D,v)=>{var U,P;return l.openBlock(),l.createElementBlock("div",{class:"button_modified",key:D.id,ref_for:!0,ref:C,id:"scrolling"+D.id,"data-clickable":"true",onClick:O=>{o.toggleNotRequire&&o.toggleNotRequire(D,v),y(D.id),T(O)}},[l.createElementVNode("div",Fu,[x.value[v].modifiers.length===0?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass([{modified_plus_btn_active:D.id===((U=l.unref(u).groupCurrentOpen)==null?void 0:U.id)&&o.isSectionModifier},"modified_plus_active"])},[l.createVNode(so,{"aria-label":`Открыть группу модификаторов ${D.name}`},null,8,["aria-label"])],2)):x.value[v].modifiers.length===1?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:D.id===((P=l.unref(u).groupCurrentOpen)==null?void 0:P.id)&&o.isSectionModifier}])},[l.createElementVNode("img",{src:x.value[v].modifiers[0].image_link||l.unref(f).fallback_image||"",alt:"Модификатор"},null,8,Vu)],2)):(l.openBlock(),l.createElementBlock("div",Uu,[x.value[v].modifiers.length>2?(l.openBlock(),l.createElementBlock("div",zu,[x.value[v].modifiers.length===3?(l.openBlock(),l.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:x.value[v].modifiers[2].image_link||l.unref(f).fallback_image||""},null,8,Hu)):(l.openBlock(),l.createElementBlock("p",Gu," + "+l.toDisplayString(x.value[v].modifiers.length-2),1))])):l.createCommentVNode("",!0),l.createElementVNode("div",null,[x.value[v].modifiers.length>0?(l.openBlock(),l.createElementBlock("img",{key:0,src:x.value[v].modifiers[0].image_link||l.unref(f).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,Wu)):l.createCommentVNode("",!0),x.value[v].modifiers.length>1?(l.openBlock(),l.createElementBlock("img",{key:1,src:x.value[v].modifiers[1].image_link||l.unref(f).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,Xu)):l.createCommentVNode("",!0)])]))]),l.createElementVNode("p",null,l.toDisplayString(D.name),1)],8,Lu)}),128))]),_:1},8,["container","idActive"])],2)),[[l.unref(Vr),l.unref(h)?{}:!1]]):l.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-c850b1ab"]]),ju={},qu={id:"custom_svg_lib",width:"21.847656",height:"21.846924",viewBox:"0 0 21.8477 21.8469",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Zu(o,s){return l.openBlock(),l.createElementBlock("svg",qu,[...s[0]||(s[0]=[l.createElementVNode("desc",null," Created with Pixso. ",-1),l.createElementVNode("defs",null,null,-1),l.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),l.createElementVNode("path",{id:"Vector",d:"M12.38 15.9L12.89 15.39C12.96 15.33 13 15.25 13 15.16C13 15.08 12.96 15 12.89 14.93L8.84 11L12.89 7.06C12.96 6.99 13 6.91 13 6.83C13 6.74 12.96 6.66 12.89 6.6L12.38 6.1C12.31 6.03 12.23 6 12.14 6C12.05 6 11.97 6.03 11.9 6.1L7.1 10.76C7.03 10.83 7 10.91 7 11C7 11.08 7.03 11.16 7.1 11.23L11.9 15.9C11.97 15.96 12.05 16 12.14 16C12.23 16 12.31 15.96 12.38 15.9Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const Ur=ze(ju,[["render",Zu]]),zr={mounted(o){o.muted=!0,o.setAttribute("muted","")}},Yu={class:"wrapper_modifiers"},$u={class:"wrapper_nutritional_value"},Ku={class:"nutritional_scheme"},Qu={key:0,class:"nutritional_parameters"},Ju={key:1,class:"nutritional_parameters"},ed={key:2,class:"nutritional_parameters"},td={key:3,class:"nutritional_parameters"},nd={ref:"modifierBody",class:"modifier_shadow"},rd={class:"wrapper_modifiers_title"},id={class:"wrapper_text_count_modifiers"},od=["id","aria-label","onClick","onKeydown"],sd={key:0,class:"counter_modifier"},ad={class:"hide_image_corners"},ld=["src","alt"],cd={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},ud=["src"],dd={class:"modifier_title"},fd=ze(l.defineComponent({__name:"SectionModifiers",emits:["close"],setup(o,{emit:s}){const i=s,u=It(),f=Rt(),{itemThemes:h}=we.storeToRefs(u),{stateCard:m,recountGroupTotalAmount:x,groupTotalAmount:_}=we.storeToRefs(f),{isDesktop:p,shouldUseDragScroll:C}=Nn(),y=l.ref(null),S=Xt.useTemplateRefsList(),M=T=>{if(!T)return;const D=m.value.groupModifiers.findIndex(B=>B.id===m.value.groupCurrentOpen.id),v=m.value.plusButtonsRefs[D]||m.value.plusButtonsRefs[0];if(!v)return;const U=T.getBoundingClientRect(),P=v.getBoundingClientRect(),O=T.cloneNode(!0);O.classList.add("flyer"),Object.assign(O.style,{width:`${U.width}px`,height:`${U.height}px`,left:`${U.left}px`,top:`${U.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(O),y.value=O,requestAnimationFrame(()=>{const B=P.left+P.width/3-(U.left+U.width/2),$=P.top+P.height/4-(U.top+U.height/2),K=P.width/U.width*.2;O.style.transform=`translate(${B}px, ${$}px) scale(${K})`,O.style.opacity="0.4",O.style.transition="transform 0.5s ease, opacity 0.5s ease"}),O.addEventListener("transitionend",()=>{O.remove(),y.value=null,v.classList.add("bump"),setTimeout(()=>v.classList.remove("bump"),300)},{once:!0})};return l.watch(()=>m.value.isAnimationFly,T=>{T===!0&&m.value.currentModifier&&(M(S.value.find(D=>D.id===m.value.currentModifier.id)),m.value.isAnimationFly=!1)}),(T,D)=>{var v,U,P,O,B,$,K,W,ie,V,ae,j,G;return l.openBlock(),l.createElementBlock("div",Yu,[l.createElementVNode("div",$u,[l.createElementVNode("div",{class:l.normalizeClass(["card_header_inner_back",[(v=l.unref(m).openCard)!=null&&v.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:D[0]||(D[0]=z=>i("close"))},[l.createVNode(Ur,{class:"arrow_bottom"})],2),l.createElementVNode("div",Ku,[(U=l.unref(m).openCard)!=null&&U.energy_amount?(l.openBlock(),l.createElementBlock("div",Qu,[l.createElementVNode("b",null,l.toDisplayString((P=l.unref(m).openCard)==null?void 0:P.energy_amount),1),D[1]||(D[1]=l.createElementVNode("p",null,"Килокалории",-1))])):l.createCommentVNode("",!0),(O=l.unref(m).openCard)!=null&&O.proteins_amount?(l.openBlock(),l.createElementBlock("div",Ju,[l.createElementVNode("b",null,l.toDisplayString((B=l.unref(m).openCard)==null?void 0:B.proteins_amount),1),D[2]||(D[2]=l.createElementVNode("p",null,"Белки",-1))])):l.createCommentVNode("",!0),($=l.unref(m).openCard)!=null&&$.fat_amount?(l.openBlock(),l.createElementBlock("div",ed,[l.createElementVNode("b",null,l.toDisplayString((K=l.unref(m).openCard)==null?void 0:K.fat_amount),1),D[3]||(D[3]=l.createElementVNode("p",null,"Жиры",-1))])):l.createCommentVNode("",!0),(W=l.unref(m).openCard)!=null&&W.carbohydrates_amount?(l.openBlock(),l.createElementBlock("div",td,[l.createElementVNode("b",null,l.toDisplayString((ie=l.unref(m).openCard)==null?void 0:ie.carbohydrates_amount),1),D[4]||(D[4]=l.createElementVNode("p",null,"Углеводы",-1))])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",nd,[l.createElementVNode("p",rd,l.toDisplayString((V=l.unref(m).groupCurrentOpen)==null?void 0:V.name),1),l.createElementVNode("p",id,"Выбрано "+l.toDisplayString(l.unref(x))+" из "+l.toDisplayString(l.unref(_)),1),l.withDirectives((l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass((ae=l.unref(m).groupModifiers.find(z=>{var X;return z.id===((X=l.unref(m).groupCurrentOpen)==null?void 0:X.id)}))!=null&&ae.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(((j=l.unref(m).groupCurrentOpen)==null?void 0:j.group_modifiers)||[],z=>{var X,N,Q;return l.openBlock(),l.createElementBlock("div",{key:z.id,ref_for:!0,ref:l.unref(S).set,id:z.id,style:l.normalizeStyle({pointerEvents:l.unref(p)?"none":"auto"}),class:l.normalizeClass(["modifier_card",{hidden_modifier_card:z.default_amount===0&&((X=l.unref(m).groupCurrentOpen)==null?void 0:X.id)==="Добавки2000"&&z.min_amount===0&&z.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${z.name}`,onClick:H=>l.unref(f).modifierSelect(z),onKeydown:l.withKeys(H=>l.unref(f).modifierSelect(z),["enter"])},[l.createElementVNode("div",{class:l.normalizeClass([{modifier_card_active:l.unref(m).groupModifiersSelected.some(H=>{var te;return H.group===((te=l.unref(m).groupCurrentOpen)==null?void 0:te.id)&&H.modifiers.some(q=>q.id===z.id)})},"wrapper_image_corners"])},[z.amount>1?(l.openBlock(),l.createElementBlock("div",sd,l.toDisplayString(z.amount),1)):l.createCommentVNode("",!0),l.createElementVNode("div",ad,[z.video_link?l.withDirectives((l.openBlock(),l.createElementBlock("video",cd,[l.createElementVNode("source",{src:z.video_link||"",type:"video/webm"},null,8,ud)])),[[l.unref(zr)]]):(l.openBlock(),l.createElementBlock("img",{key:0,class:"modifier_image",src:z.image_link||l.unref(h).fallback_image||"",alt:z.name},null,8,ld)),l.createElementVNode("div",{class:l.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:z.min_amount>0||z.required}])},[l.createElementVNode("h3",dd,l.toDisplayString(z.name),1),l.createElementVNode("p",null,"+"+l.toDisplayString(((Q=(N=z.sizes)==null?void 0:N.find(H=>H.id===l.unref(m).selectedSize.id))==null?void 0:Q.price)||z.price||0)+"₽",1)],2)])],2)],46,od)}),128))],2)),[[l.unref(Vr),(G=l.unref(m).groupModifiers.find(z=>{var X;return z.id===((X=l.unref(m).groupCurrentOpen)==null?void 0:X.id)}))!=null&&G.group_modifiers.length?{}:!1]])],512)])}}}),[["__scopeId","data-v-2ce24a7a"]]),hd={key:0,class:"card_size_place"},gd=["onClick","onKeydown","aria-label"],md={key:1,class:"card_size static"},pd=["onClick","onKeydown","aria-label"],ao=3,xd=ze(l.defineComponent({__name:"SizeModifier",setup(o){const s=Rt(),{stateCard:i}=we.storeToRefs(s),u=l.ref(null),{isDesktop:f}=Nn(),h=l.ref(50),m=l.ref(),x=l.ref(0),_=l.ref(0),p=l.ref(null),C=l.computed(()=>{var B;if(i.value.productSizes.length<=3)return i.value.productSizes[m.value.index]||i.value.productSizes[0];const P=x.value+1,O=((B=S.value[P])==null?void 0:B.originalIndex)??1;return i.value.productSizes[O]}),y=()=>{p.value&&i.value.productSizes.length>=3&&(_.value=p.value.offsetWidth/ao)},S=l.computed(()=>{if(i.value.productSizes.length<=3)return i.value.productSizes;const P=i.value.productSizes;return[...P.map((O,B)=>({...O,originalIndex:B})),...P.map((O,B)=>({...O,originalIndex:B})),...P.map((O,B)=>({...O,originalIndex:B}))]}),M=(P,O)=>{if(m.value={id:P.id,title:P.name,index:O,is_default:P.is_default},P.price!==null&&i.value.openCard&&(i.value.openCard={...i.value.openCard,price:P.price}),i.value.selectedSize=P,i.value.productSizes.length>3){y();const B=x.value+1;O<B?T():O>B&&D()}else{const B=i.value.productSizes.length,$=(O+.5)*(100/B);h.value=$}},T=()=>{var P;if(!(i.value.productSizes.length<=3)){if(x.value--,x.value<i.value.productSizes.length-ao+1){x.value+=i.value.productSizes.length;const O=(P=p.value)==null?void 0:P.querySelector(".card_size");O&&(O.style.transition="none",O.style.transform=`translateX(-${x.value*_.value}px)`,O.offsetHeight,O.style.transition="transform 0.2s ease-in-out")}v()}},D=()=>{var P;if(!(i.value.productSizes.length<=3)){if(x.value++,x.value>=i.value.productSizes.length*2){x.value-=i.value.productSizes.length;const O=(P=p.value)==null?void 0:P.querySelector(".card_size");O&&(O.style.transition="none",O.style.transform=`translateX(-${x.value*_.value}px)`,O.offsetHeight,O.style.transition="transform 0.2s ease-in-out")}v()}},v=()=>{var $;if(i.value.productSizes.length<=3)return;const P=x.value+1,O=(($=S.value[P])==null?void 0:$.originalIndex)??0,B=i.value.productSizes[O];m.value={id:B.id,title:B.name,index:O,is_default:B.is_default}};l.watch(()=>[i.value.productSizes,p.value],([P=[],O])=>{if(Array.isArray(P)&&P.length>0&&O!==null){let B=P.findIndex($=>$.is_default===!0);P.length<3&&u.value&&parseInt(u.value.style.minWidth)<767&&(u.value.style.width="100px"),B>-1?(x.value=B,M(P[B],B),_.value=120/ao):P.length===2||P.length===1?(M(P[0],0),h.value=(0+.5)*(100/2)):(M(P[1],1),h.value=(1+.5)*(100/3))}}),l.watch(()=>{var P;return[(P=i.value.selectedSize)==null?void 0:P.id,i.value.groupModifiersSelected]},([P,O])=>{if(!P||!Array.isArray(O))return;const B=O.map($=>({...$,modifiers:$.modifiers.map(K=>{if(!K.sizes||K.sizes.length===0)return K;const W=K.sizes.find(ie=>ie.id===P);return W?{...K,size:W,price:W.price??K.price}:K})}));JSON.stringify(B)!==JSON.stringify(i.value.groupModifiersSelected)&&(i.value.groupModifiersSelected=B)},{deep:!0});const U={mounted:y};return l.onBeforeUnmount(()=>{window.removeEventListener("resize",y)}),(P,O)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:u},[l.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:p},[l.unref(i).productSizes.length>1&&m.value?(l.openBlock(),l.createElementBlock("div",hd,[l.unref(i).productSizes.length>3?(l.openBlock(),l.createElementBlock("ul",{key:0,class:"card_size",style:l.normalizeStyle({transform:`translateX(-${x.value*_.value}px)`})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,(B,$)=>(l.openBlock(),l.createElementBlock("li",{key:`${B.id}-${$}`,onClick:K=>M(B,$),onKeydown:l.withKeys(K=>M(B,$),["enter"]),class:l.normalizeClass({active:m.value.id===B.id&&m.value.index===B.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${B.name}`},l.toDisplayString(B.alt_name?B.alt_name:B.name),43,gd))),128))],4)):(l.openBlock(),l.createElementBlock("ul",md,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(i).productSizes,(B,$)=>(l.openBlock(),l.createElementBlock("li",{key:`${B.id}-${$}`,onClick:K=>M(B,$),onKeydown:l.withKeys(K=>M(B,$),["enter"]),class:l.normalizeClass({active:m.value.id===B.id&&m.value.index===$}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${B.name}`},l.toDisplayString(B.alt_name?B.alt_name:B.name),43,pd))),128))])),C.value?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:2,class:"size_active",style:l.normalizeStyle(l.unref(i).productSizes.length<=3?{left:`${h.value}%`}:{})},[l.createElementVNode("p",null,l.toDisplayString(C.value.alt_name?C.value.alt_name:C.value.name),1)],4)),[[U]]):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],512)],512)),[[l.vShow,l.unref(i).productSizes.length>1&&m.value]])}}),[["__scopeId","data-v-2fab37e4"]]),wd="data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.3063%2019.7525C8.12104%2019.7525%208.78152%2019.1097%208.78152%2018.3167C8.78152%2017.5236%208.12104%2016.8808%207.3063%2016.8808C6.49156%2016.8808%205.83108%2017.5236%205.83108%2018.3167C5.83108%2019.1097%206.49156%2019.7525%207.3063%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M7.3063%2019.2525C7.83733%2019.2525%208.26782%2018.8335%208.26782%2018.3167C8.26782%2017.7998%207.83733%2017.3808%207.3063%2017.3808C6.77526%2017.3808%206.34478%2017.7998%206.34478%2018.3167C6.34478%2018.8335%206.77526%2019.2525%207.3063%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M14.4716%2019.7525C15.2864%2019.7525%2015.9469%2019.1097%2015.9469%2018.3167C15.9469%2017.5236%2015.2864%2016.8808%2014.4716%2016.8808C13.6569%2016.8808%2012.9964%2017.5236%2012.9964%2018.3167C12.9964%2019.1097%2013.6569%2019.7525%2014.4716%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M14.4716%2019.2525C15.0027%2019.2525%2015.4332%2018.8335%2015.4332%2018.3167C15.4332%2017.7998%2015.0027%2017.3808%2014.4716%2017.3808C13.9406%2017.3808%2013.5101%2017.7998%2013.5101%2018.3167C13.5101%2018.8335%2013.9406%2019.2525%2014.4716%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M0.770536%203.75L4.56158%206.21L6.66771%2015.23H15.1025L17.2086%208.26'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.19507%2011.95H12.2669H15.945'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.1908%200.830648V7.34648L8.26615%204.49981C8.03242%204.27231%207.64886%204.27231%207.41513%204.49981C7.35957%204.55378%207.3155%204.61788%207.28542%204.68845C7.25535%204.75902%207.23987%204.83467%207.23987%204.91106C7.23987%204.98746%207.25535%205.06311%207.28542%205.13368C7.3155%205.20425%207.35957%205.26835%207.41513%205.32231L11.3646%209.16648C11.5983%209.39398%2011.9759%209.39398%2012.2096%209.16648L16.159%205.32231C16.2145%205.26831%2016.2585%205.20419%2016.2885%205.13363C16.3186%205.06307%2016.334%204.98744%2016.334%204.91106C16.334%204.83469%2016.3186%204.75906%2016.2885%204.6885C16.2585%204.61794%2016.2145%204.55382%2016.159%204.49981C16.1035%204.44581%2016.0377%204.40297%2015.9652%204.37374C15.8927%204.34451%2015.815%204.32947%2015.7365%204.32947C15.658%204.32947%2015.5803%204.34451%2015.5078%204.37374C15.4353%204.40297%2015.3695%204.44581%2015.314%204.49981L12.3894%207.34648V0.830648C12.3894%200.509814%2012.1197%200.247314%2011.7901%200.247314C11.4604%200.247314%2011.1908%200.509814%2011.1908%200.830648Z'%20fill='%23F2F7FF'/%3e%3c/svg%3e",_d={class:"counter_container"},Cd={class:"card_size_place_wrapper",ref:"sliderWrapper"},Ed={class:"cart_amount_counter"},yd={class:"button_circle_number"},bd=ze(l.defineComponent({__name:"NumberModifier",props:{qr_menu:{type:Boolean}},setup(o){const s=Rt(),{stateCard:i}=we.storeToRefs(s),u=ke.useRouter(),f=o,h=()=>{var x,_,p,C;(_=(x=u.options.history.state)==null?void 0:x.back)!=null&&_.includes("mode=pdf")&&f.qr_menu||(p=i.value.openCard)!=null&&p.amount&&((C=i.value.openCard)==null?void 0:C.amount)>1&&(i.value.openCard.amount-=1)},m=()=>{var x,_,p;(_=(x=u.options.history.state)==null?void 0:x.back)!=null&&_.includes("mode=pdf")&&f.qr_menu||(p=i.value.openCard)!=null&&p.amount&&(i.value.openCard.amount+=1)};return(x,_)=>{var p,C;return l.openBlock(),l.createElementBlock("div",_d,[l.createElementVNode("div",Cd,[l.createElementVNode("div",Ed,[l.createElementVNode("p",{class:l.normalizeClass(["cart_circle_minus",[((p=l.unref(i).openCard)==null?void 0:p.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:l.withModifiers(h,["stop","prevent"])},[..._[0]||(_[0]=[l.createElementVNode("span",null,null,-1)])],2),l.createElementVNode("p",yd,l.toDisplayString((C=l.unref(i).openCard)==null?void 0:C.amount),1),l.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:l.withModifiers(m,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-50b09b8c"]]);function na(o,s=800){const i=l.ref(o),u=l.ref(o);let f=null,h=null,m=o;const x=_=>{h||(h=_);const p=_-h,C=Math.min(p/s,1),y=C<.5?4*C*C*C:1-Math.pow(-2*C+2,3)/2;i.value=Math.round(m+(u.value-m)*y),C<1?f=requestAnimationFrame(x):(i.value=u.value,f=null)};return l.watch(u,()=>{f&&cancelAnimationFrame(f),m=i.value,h=null,f=requestAnimationFrame(x)},{immediate:!0}),l.onUnmounted(()=>{f&&cancelAnimationFrame(f)}),{displayNumber:i,targetNumber:u,update:_=>{u.value=_}}}const jt=l.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(o){const s=o,{displayNumber:i,update:u}=na(s.price||0,s.duration||800);return l.watchEffect(()=>{u(s.price)}),(f,h)=>(l.openBlock(),l.createElementBlock("span",null,l.toDisplayString(l.unref(i).toFixed(o.fixedFloat)),1))}}),Ad=["disabled","id"],un=l.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(o){const s=o,i=()=>{s.onClick()};return(u,f)=>(l.openBlock(),l.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:o.disabled,onClick:i,id:o.disabled?"buttonDefaultDisabled":""},l.toDisplayString(o.textButtonDefault),9,Ad))}}),Id={class:"notification_info"},Sd={key:0,class:"notification_18plus"},Nd={class:"notification_18plus_image"},Td=["src"],kd={class:"notification_18plus_text"},Rd={class:"notification_18plus_accept"},Od={key:1,class:"notification_text"},Bd={key:0,class:"wrapper_button_accept"},lo=l.defineComponent({__name:"NotificationWindow",props:l.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean},is_qr:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(o){const s=o,i=It(),u=lt(),{is18Allowed:f,notificationData_lib:h}=we.storeToRefs(u),{itemThemes:m}=we.storeToRefs(i),x=l.computed(()=>s.backgroundColor||"rgba(50, 50, 50, 0.9)"),_=l.computed(()=>{var T;return!!((T=m.value)!=null&&T.kiosk_hide_menu_update_notification)});let p;const C=l.useModel(o,"visible"),y=()=>{h.value.fastAdd&&(u.addToCart(h.value.fastAdd),h.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),f.value=!0,C.value=!1,h.value.callback&&(h.value.callback(),h.value.callback=null)},S=()=>{C.value=!1},M=()=>{C.value=!1,clearTimeout(p)};return l.watch([C,()=>s.textNotificationDefault,_],([T,D,v],[U,P])=>{p&&(!T||T!==U||D!==P)&&clearTimeout(p),v&&T&&(p=setTimeout(M,4e3))},{immediate:!0}),l.onUnmounted(()=>{p&&M()}),(T,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[!_.value&&C.value?(l.openBlock(),l.createBlock(l.Transition,{key:0,name:"notificationBlack",appear:""},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"notification_background_black",onClick:S})]),_:1})):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"notification"},{default:l.withCtx(()=>{var v;return[C.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"notification_overlay",onClick:S},[l.createElementVNode("div",{class:"notification_wrapper",style:l.normalizeStyle({"background-color":x.value,border:`2px solid ${x.value}`})},[l.createElementVNode("div",Id,[o.type?(l.openBlock(),l.createElementBlock("div",Sd,[l.createElementVNode("div",Nd,[l.createElementVNode("img",{src:l.unref(m).adult_disclaimer_image||l.unref(m).fallback_image,alt:"Дисклеймер"},null,8,Td)]),l.createElementVNode("div",kd,l.toDisplayString(l.unref(m).adult_disclaimer_text),1),l.createElementVNode("div",Rd,[D[0]||(D[0]=l.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой. ",-1)),l.createVNode(un,{textButtonDefault:"Мне есть 18",onClick:y,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(l.openBlock(),l.createElementBlock("div",Od,[l.createTextVNode(l.toDisplayString(o.textNotificationDefault)+" ",1),(v=o.buttonAccept)!=null&&v.state?(l.openBlock(),l.createElementBlock("div",Bd,[l.createVNode(un,{class:"button_accept",textButtonDefault:o.buttonAccept.text,onClick:o.buttonAccept.acceptBtn,disabled:o.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):l.createCommentVNode("",!0)]))])],4)])):l.createCommentVNode("",!0)]}),_:1})],64))}}),Md={class:"button_price button_price_modifiers"},vd=["src"],Dd={class:"button_text_container"},Pd={class:"button_text_price"},Ld=ze(l.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(o){const s=ke.useRouter(),i=ke.useRoute(),u=Rt(),f=lt(),h=It(),m=l.ref([]),x=l.ref([]),_=o,{stateCard:p,totalPrice_libCard:C,isOpenWindow:y,isAddToCard:S}=we.storeToRefs(u),{isDesktop:M}=Nn(),{itemThemes:T}=we.storeToRefs(h),D=l.ref(!0),v=l.ref(!1),U=l.computed(()=>M.value?!1:D.value),P=()=>{var B,$,K,W,ie;if(($=(B=s.options.history.state)==null?void 0:B.back)!=null&&$.includes("mode=pdf")&&_.qr_menu)return;if(D.value){u.setCurrentCard(p.value.openCard),v.value=!0;const V=p.value.groupModifiers.findIndex(ae=>u.checkedRequiredBtn.group.id===ae.id);u.checkedRequiredBtn.haveRequaire&&u.toggleNotRequire(u.checkedRequiredBtn.group,V);return}const O=p.value.groupModifiersSelected||[];if(m.value=[],x.value=[],Array.isArray(O)&&O.length>0&&O.forEach(V=>{const ae=V.group,j=V.modifiers||[];ae==="Добавки2000"?m.value=j.map(G=>{var z;return{...G,old_price:G.price,size:Array.isArray(G.size)?G.size.map(X=>X.id).filter(Boolean):(z=G.size)!=null&&z.id?G.size.id:void 0}}):j.length>0&&x.value.push({group:ae,is_fake:V.is_fake||!1,is_product_determining:V.is_product_determining||!1,modifiers:j.map(G=>{var z;return{...G,old_price:G.price,size:Array.isArray(G.size)?G.size.map(X=>X.id).filter(Boolean):(z=G.size)!=null&&z.id?G.size.id:void 0}})})}),document.body.style.overflow="",p.value.openCard){const V={id:p.value.openCard.id,is_fake:p.value.openCard.is_fake||!1,is_od_united_product:p.value.openCard.is_od_united_product||!1,amount:p.value.openCard.amount,name:p.value.openCard.name,image_link:p.value.openCard.image_link,price:p.value.openCard.price,old_price:p.value.openCard.price,size:((K=p.value.selectedSize)==null?void 0:K.id)??((ie=(W=p.value.openCard.sizes)==null?void 0:W.find(ae=>ae.is_default))==null?void 0:ie.id),sizes:p.value.openCard.sizes||[],modifiers:m.value,groups:p.value.openCard.groups,group_modifiers:x.value,energy_amount:p.value.openCard.energy_amount??0,proteins_amount:p.value.openCard.proteins_amount??0,fat_amount:p.value.openCard.fat_amount??0,carbohydrates_amount:p.value.openCard.carbohydrates_amount??0};_.closeProduct&&_.closeProduct(),f.addToCart(V),S.value=!0}y.value=!1,_.qr_menu&&s.push(`/${i.params.orgId}/`)};return l.watch(()=>p.value.productSizes,O=>{!O||O.length===0||!p.value.selectedSize||(p.value.selectedSize={...p.value.selectedSize})},{immediate:!0}),l.watchEffect(()=>{u.checkedRequiredBtn.haveRequaire?D.value=!0:D.value=!1}),l.onMounted(()=>{S.value=!1}),(O,B)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(lo,{visible:v.value,textNotificationDefault:l.unref(p).textErrorRequaired,backgroundColor:l.unref(T).accent_color?l.unref(T).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":B[0]||(B[0]=$=>v.value=$)},null,8,["visible","textNotificationDefault","backgroundColor"])])),l.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:B[3]||(B[3]=l.withModifiers(()=>{},["stop"])),onPointerdown:B[4]||(B[4]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",Md,[l.unref(M)?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(bd,{key:0,qr_menu:o.qr_menu},null,8,["qr_menu"])),l.createElementVNode("div",{class:l.normalizeClass(["card_product_button_buy",{buy_active:!U.value}]),"data-clickable":"true",onClick:P,onTouchstart:B[1]||(B[1]=l.withModifiers(()=>{},["stop"])),onPointerdown:B[2]||(B[2]=l.withModifiers(()=>{},["stop"]))},[l.unref(M)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("img",{key:0,src:l.unref(wd),class:"card_product_button_icon"},null,8,vd)),l.createElementVNode("div",Dd,[l.createElementVNode("p",Pd,[l.createVNode(jt,{price:+l.unref(C),fixedFloat:2},null,8,["price"]),B[5]||(B[5]=l.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-4ebdaed7"]]),Fd={class:"modified_amount"},Vd={class:"hide_image_corners"},Ud=["src"],zd={class:"wrapper_modifier_title"},Hd={class:"amount_title"},Gd={class:"wrapper_amount_counter"},Wd={class:"amount_count"},Xd={class:"amount_wrapper"},jd={class:"add_counter_amount"},qd=ze(l.defineComponent({__name:"ModalAmount",setup(o){const s=Rt(),i=It(),{itemThemes:u}=we.storeToRefs(i),{stateCard:f}=we.storeToRefs(s),h=l.computed(()=>{var _,p,C;return((C=(p=(_=f.value.currentModifier)==null?void 0:_.sizes)==null?void 0:p.find(y=>y.id===f.value.selectedSize.id))==null?void 0:C.price)??dr(f.value.currentModifier)}),m=()=>{f.value.currentModifier&&(f.value.currentModifier.amount=f.value.modalCount),s.modifierSelect(f.value.currentModifier),f.value.isModifiedAmount=!1},x=()=>{f.value.modalCount=1,f.value.currentModifier.amount=1};return(_,p)=>{var C,y;return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",Fd,[l.createElementVNode("div",Vd,[l.createElementVNode("img",{class:"modifier_image",src:((C=l.unref(f).currentModifier)==null?void 0:C.image_link)||l.unref(u).fallback_image||""},null,8,Ud),l.createElementVNode("div",zd,[l.createElementVNode("p",Hd,l.toDisplayString((y=l.unref(f).currentModifier)==null?void 0:y.name),1),l.createElementVNode("p",null,"+ "+l.toDisplayString(h.value)+"₽",1)])])]),l.createElementVNode("div",Gd,[l.createElementVNode("div",{class:"amount_mines",onClick:p[0]||(p[0]=l.withModifiers((...S)=>l.unref(s).minusAmount&&l.unref(s).minusAmount(...S),["stop"]))},[...p[1]||(p[1]=[l.createElementVNode("div",null,null,-1)])]),l.createElementVNode("p",Wd,l.toDisplayString(l.unref(f).modalCount),1),l.createElementVNode("div",Xd,[l.createVNode(so,{onClick:l.withModifiers(l.unref(s).plusAmount,["stop"])},null,8,["onClick"])])]),l.createElementVNode("p",{class:"clear_count",onClick:l.withModifiers(x,["stop"])},"Убрать все"),l.createElementVNode("div",jd,[l.createVNode(un,{textButtonDefault:"Добавить",onClick:m,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-84debd5d"]]),Zd=(o,s,i)=>Math.max(s,Math.min(o,i)),Yd=(o,s)=>Math.pow(o,s*5),ra=(o,s,i)=>s===0||Math.abs(s)===1/0?Yd(o,i):o*s*i/(s+i*o),pi=(o,s)=>s*parseFloat(o)/100,co=(o,s,i,u=.15)=>u===0?Zd(o,s,i):o<s?-ra(s-o,i-s,u)+s:o>i?+ra(o-i,i-s,u)+i:o,sn=(o,{min:s,max:i})=>s!==void 0&&o<s?s:i!==void 0&&o>i?i:o;function $d(o,s,i){const u=l.ref(0),f=l.computed(()=>o.value.map(_=>typeof _=="string"?pi(_,i.value):_)),h=l.computed(()=>Math.min(...f.value)),m=l.computed(()=>Math.max(...f.value)),x=l.computed(()=>{const _=f.value.reduce((p,C)=>Math.abs(C-s.value)<Math.abs(p-s.value)?C:p);return f.value.indexOf(_)});return{currentSnapPointIndex:u,flattenedSnapPoints:f,minSnapPoint:h,maxSnapPoint:m,closestSnapPointIndex:x}}const uo=ze(l.defineComponent({__name:"BottomSheet",props:{duration:{default:250},snapPoints:{},initialSnapPoint:{},blocking:{type:Boolean,default:!0},canSwipeClose:{type:Boolean,default:!0},swipeCloseThreshold:{},canBackdropClose:{type:Boolean,default:!0},expandOnContentDrag:{type:Boolean,default:!0},modelValue:{type:Boolean},teleportTo:{default:"body"},teleportDefer:{type:Boolean,default:!1},headerClass:{},contentClass:{},footerClass:{}},emits:["opened","opening-started","closed","closing-started","ready","dragging-up","dragging-down","snapped","instinctHeight","update:modelValue"],setup(o,{expose:s,emit:i}){const u=o,f=i;let h=null;const m=l.ref(0),x=Xt.useVModel(u,"modelValue",f,{passive:!0});l.watch(x,ce=>{ce&&me()}),l.onMounted(()=>{x.value&&me()});const _=l.ref(),p=l.ref(null),C=l.ref(null),y=l.ref(null),S=l.ref(null),M=l.ref(u.expandOnContentDrag),{height:T}=Xt.useWindowSize(),{height:D}=Xt.useElementBounding(_),{height:v}=Xt.useElementBounding(p),{height:U}=Xt.useElementBounding(S),{height:P}=Xt.useElementBounding(C),O=l.computed({get(){return sn(Math.ceil(U.value+v.value+P.value),{max:T.value})},set(ce){[v.value,U.value,P.value]=ce}}),B=l.ref(0),$=l.ref(0),K=At.useMotionValue(0),W=At.useMotionValue(0),{snapPoints:ie}=l.toRefs(u),V=l.computed(()=>ie.value??[O.value]),{flattenedSnapPoints:ae,currentSnapPointIndex:j,closestSnapPointIndex:G,minSnapPoint:z,maxSnapPoint:X}=$d(V,B,T);let N;function Q(ce){M.value=!0,H(ce)}function H(ce){M.value&&ce.preventDefault()}const te=ce=>{ce.key==="Escape"&&Ie()},q=()=>{u.canBackdropClose&&Ie()};let re=!1;const me=async()=>{var ce;if(!re){xe&&(xe=!1,h&&(clearTimeout(h),h=null)),m.value++,x.value=!0,re=!0,f("opening-started");try{await l.nextTick(),await l.nextTick();const He=(ce=_.value)==null?void 0:ce.$el;if(!He){console.warn("[BottomSheet] sheet not ready, aborting"),x.value=!1;return}D.value=He.getBoundingClientRect().height;const $e=He.querySelector("[data-vsbs-content]"),pt=He.querySelector("[data-vsbs-header]"),Je=He.querySelector("[data-vsbs-footer]");if(O.value=[pt.getBoundingClientRect().height,$e.getBoundingClientRect().height,Je.getBoundingClientRect().height],await l.nextTick(),j.value=ae.value.findIndex(Re=>Re===z.value),u.initialSnapPoint){const Re=u.initialSnapPoint;if(Re<0||Re>=V.value.length)return console.warn("Index out of bounds");B.value=typeof V.value[Re]=="number"?sn(V.value[Re],{max:T.value}):pi(V.value[Re],T.value)}else B.value=sn(z.value,{max:T.value});$.value=B.value,K.jump(B.value),W.jump(B.value),requestAnimationFrame(()=>{N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut"}),N=At.animate(W,0,{duration:u.duration/1e3,ease:"easeInOut",onComplete:()=>{u.blocking&&f("opened")}})}),window.addEventListener("keydown",te)}finally{re=!1}}};let xe=!1;const Ie=()=>{xe||(re&&(re=!1),N&&N.stop(),x.value=!1,xe=!0,f("closing-started"),window.removeEventListener("keydown",te),h&&clearTimeout(h),h=setTimeout(()=>{f("closed"),xe=!1,h=null},u.duration))},_e=ce=>{if(V.value){if(ce<0||ce>=V.value.length){console.warn("Index out of bounds");return}j.value=ce,B.value=typeof V.value[ce]=="number"?sn(V.value[ce],{max:T.value}):pi(V.value[ce],T.value),N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut",onComplete:()=>f("snapped",V.value.indexOf(V.value[ce]))})}};function Me(ce){ce>0?f("dragging-down"):ce<0&&f("dragging-up")}const ge=()=>{B.value=D.value,$.value=W.get(),K.jump(B.value),W.jump($.value)},ct=async(ce,He)=>{await l.nextTick(),_.value&&($.value<=0&&(B.value-=He.delta.y),B.value<=z.value&&(B.value=z.value,$.value+=He.delta.y,W.set(u.canSwipeClose?sn($.value,{min:0}):sn(co($.value,-D.value,0,.5),{min:0}))),K.set(sn(co(B.value,0,X.value,.25),{min:0,max:T.value})),Me(He.delta.y))},Ve=()=>{if(u.canSwipeClose){let ce=B.value/2;u.swipeCloseThreshold&&typeof u.swipeCloseThreshold=="number"&&(ce=u.swipeCloseThreshold),u.swipeCloseThreshold&&typeof u.swipeCloseThreshold=="string"&&u.swipeCloseThreshold.includes("%")&&(ce=B.value*(Number(u.swipeCloseThreshold.replace("%",""))/100)),Math.abs($.value)>ce&&($.value=B.value)}else $.value=0;if(N=At.animate(W,$.value,{duration:u.duration/1e3,ease:"easeInOut"}),$.value===B.value){$.value=0,Ie();return}j.value=G.value,B.value=typeof V.value[G.value]=="number"?sn(V.value[G.value],{max:T.value}):pi(V.value[G.value],T.value),N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut",onComplete:()=>f("snapped",V.value.indexOf(V.value[G.value]))}),N=At.animate(W,0,{duration:u.duration/1e3,ease:"easeInOut"})},Oe=(ce,He)=>{if(B.value=D.value,$.value=W.get(),N&&N.stop(),!y.value)return;const $e=y.value.scrollTop===0,pt=He.delta.y>0,Je=ae.value.length===1,Re=.5>Math.abs(B.value-X.value);if(Je){if(!u.expandOnContentDrag)return M.value=!1;W.get()===0&&$e&&pt&&(M.value=!0),W.get()===0&&$e&&!pt&&(M.value=!1)}else{if(!u.expandOnContentDrag)return M.value=!1;M.value=!0,Re&&(pt&&$e&&(M.value=!0),!pt&&$e&&(M.value=!1),$e||(M.value=!1))}},qe=async(ce,He)=>{if(await l.nextTick(),!u.expandOnContentDrag)return M.value=!1;if(!_.value)return;$.value===0&&M.value&&u.expandOnContentDrag&&(B.value-=He.delta.y),B.value<=z.value&&(B.value=z.value,M.value&&u.expandOnContentDrag&&($.value+=He.delta.y),$.value=sn($.value,{min:0,max:z.value}),W.set(u.canSwipeClose?sn($.value,{min:0}):sn(co($.value,-D.value,0,.5),{min:0}))),B.value>X.value&&(B.value=X.value),B.value=sn(B.value,{max:T.value}),!(ae.value.length===1)&&B.value===X.value&&(M.value=!1),K.set(B.value),Me(He.delta.y)},Qe=()=>{if(!y.value)return;const ce=y.value.scrollTop===0;M.value=ce},Ot=Xt.useDebounceFn(ce=>_e(ce),u.duration);return l.watch(V,(ce,He)=>{if(x.value===!1||!ce||!He)return;const $e=ce[j.value],pt=He[j.value];typeof $e!="string"&&typeof pt!="string"&&(B.value=sn($e,{max:T.value}),$e!==pt&&(N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut"})))}),l.watch(T,()=>Ot(j.value)),s({open:me,close:Ie,snapToPoint:_e}),l.onUnmounted(()=>{h&&clearTimeout(h)}),(ce,He)=>(l.openBlock(),l.createBlock(l.Teleport,{to:o.teleportTo,defer:o.teleportDefer},[l.createElementVNode("div",l.mergeProps(ce.$attrs,{"data-vsbs-container":""}),[l.createVNode(l.unref(At.AnimatePresence),null,{default:l.withCtx(()=>[l.unref(x)&&o.blocking?(l.openBlock(),l.createBlock(l.unref(At.Motion),{ref:"backdrop",key:"backdrop-"+m.value,"data-vsbs-backdrop":"",onClick:He[0]||(He[0]=$e=>q()),transition:{ease:"easeInOut",duration:o.duration/1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},null,8,["transition"])):l.createCommentVNode("",!0)]),_:1}),l.createVNode(l.unref(At.AnimatePresence),null,{default:l.withCtx(()=>[l.unref(x)?(l.openBlock(),l.createBlock(l.unref(At.Motion),{ref_key:"sheet",ref:_,exit:{y:"100%",height:l.unref(D),opacity:0},initial:!1,key:m.value,style:l.normalizeStyle({y:l.unref(W),z:1,height:l.unref(K)}),"data-vsbs-shadow":!o.blocking,"data-vsbs-sheet-show":l.unref(x),"aria-modal":"true","data-vsbs-sheet":"",tabindex:"-1"},{default:l.withCtx(()=>[l.createVNode(l.unref(At.Motion),{ref_key:"sheetHeader",ref:p,"data-vsbs-header":"",onPanStart:ge,onPan:ct,onPanEnd:Ve,onTouchmove:Q,class:l.normalizeClass(o.headerClass)},{default:l.withCtx(()=>[l.renderSlot(ce.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),l.createElementVNode("div",{ref_key:"sheetScroll",ref:y,"data-vsbs-scroll":"",onScrollend:Qe},[l.createVNode(l.unref(At.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:Oe,onPan:qe,onPanEnd:Ve,onTouchmove:H},{default:l.withCtx(()=>[l.createElementVNode("div",{ref_key:"sheetContent",ref:S,"data-vsbs-content":"",class:l.normalizeClass(o.contentClass)},[l.renderSlot(ce.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),l.createVNode(l.unref(At.Motion),{ref_key:"sheetFooter",ref:C,"data-vsbs-footer":"",onPanStart:ge,onPan:ct,onPanEnd:Ve,onTouchmove:Q,class:l.normalizeClass(o.footerClass)},{default:l.withCtx(()=>[l.renderSlot(ce.$slots,"footer",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["exit","style","data-vsbs-shadow","data-vsbs-sheet-show"])):l.createCommentVNode("",!0)]),_:3})],16)],8,["to","defer"]))}}),[["__scopeId","data-v-5acf0656"]]);function Fn(o,s=null){const i=ti();i.initCacheSingle("defaultImage");const u=l.computed(()=>i.cache.defaultImage||null),f=l.shallowRef(!1),h=l.computed(()=>{var p;return((p=l.toValue(o))==null?void 0:p.toString())||null}),m=Xt.computedAsync(async()=>{const p=h.value;return p?(await i.initCacheSingle(p),i.cache[p]||null):null},null,{evaluating:f}),x=l.computed(()=>f.value&&h.value!==null);return{mediaUrl:l.computed(()=>m.value||l.toValue(s)||u.value||null),isLoading:x}}const Kd={class:"card_product_modifiers_sheet_body"},Qd={class:"card__pictures"},Jd=["src"],e0=["src"],t0={class:"card_header_wrapper"},n0={key:0,class:"card_fire_kkal_wrapper"},r0={class:"card_content"},i0={class:"wrapper_size"},o0={key:0,class:"description"},s0={key:1},a0=ze(l.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(o){const s=It(),i=Rt(),{stateCard:u,isOpenWindow:f}=we.storeToRefs(i),{itemThemes:h}=we.storeToRefs(s),m=ke.useRouter(),x=ke.useRoute(),_=o,p=l.computed(()=>!!(x.query.mode==="pdf"&&_.configPage.qr_menu)),{mediaUrl:C}=Fn(()=>{var M,T;return(M=u.value.openCard)!=null&&M.video_link?`${u.value.openCard.id}_video`:(T=u.value.openCard)!=null&&T.image_link?`${u.value.openCard.id}_image`:null},()=>{var M,T;return((M=u.value.openCard)==null?void 0:M.video_link)||((T=u.value.openCard)==null?void 0:T.image_link)||null}),y=()=>{_.configPage.qr_menu?p.value?m.push(`/${x.params.orgId}?mode=pdf`):m.push(`/${x.params.orgId}`):_.configPage.closeProduct()},S=()=>{u.value.isModifiedAmount=!1};return l.watch(()=>_.configPage.data,i.setCurrentCard),l.watch(()=>u.value.isSectionModifier,M=>{p.value&&document.body.classList.toggle("pdf_hidden",M)},{immediate:!0}),l.watchEffect(()=>{f.value||(f.value=_.configPage.is_closeProduct)}),l.onBeforeUnmount(()=>i.reset()),(M,T)=>{var D,v,U,P,O,B;return l.openBlock(),l.createElementBlock("div",{class:"card_product_wrapper",style:l.normalizeStyle(p.value?"user-select: none;":"")},[l.createVNode(l.unref(uo),{modelValue:l.unref(u).isSectionModifier,"onUpdate:modelValue":T[1]||(T[1]=$=>l.unref(u).isSectionModifier=$),class:"card_product_modifiers_sheet",teleportTo:p.value?"#app":"body"},{default:l.withCtx(()=>[l.createElementVNode("div",Kd,[l.createVNode(fd,{onClose:T[0]||(T[0]=$=>l.unref(u).isSectionModifier=!1)}),l.createVNode(ta,{isSectionModifier:l.unref(u).isSectionModifier,toggleNotRequire:l.unref(i).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue","teleportTo"]),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.unref(u).isModifiedAmount?(l.openBlock(),l.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:l.withModifiers(S,["stop"])},[l.createVNode(qd)])):l.createCommentVNode("",!0)])),l.createElementVNode("div",Qd,[(D=l.unref(u).openCard)!=null&&D.video_link&&l.unref(C)?l.withDirectives((l.openBlock(),l.createElementBlock("video",{key:l.unref(C),loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},[l.createElementVNode("source",{src:l.unref(C)||"",type:"video/webm"},null,8,Jd)])),[[l.unref(zr)]]):(l.openBlock(),l.createElementBlock("img",{key:1,class:"card__pictures_images",src:l.unref(C)||"",alt:"Product image"},null,8,e0)),l.createElementVNode("div",t0,[l.createVNode(Ur,{class:"card_header_back",onClick:y,"aria-label":"Вернуться назад"}),(v=l.unref(u).openCard)!=null&&v.energy_amount?(l.openBlock(),l.createElementBlock("div",n0,[T[3]||(T[3]=l.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),l.createElementVNode("p",null,[l.createElementVNode("b",null,l.toDisplayString((U=l.unref(u).openCard)==null?void 0:U.energy_amount),1),T[2]||(T[2]=l.createTextVNode(" Ккал ",-1))])])):l.createCommentVNode("",!0)]),l.createElementVNode("h4",null,l.toDisplayString((P=l.unref(u).openCard)==null?void 0:P.name),1),l.createElementVNode("div",{class:"card__pictures__gradient",style:l.normalizeStyle(l.unref(h).gradientStyle)},null,4)]),l.createElementVNode("div",r0,[l.createElementVNode("div",i0,[l.createVNode(xd)]),(O=l.unref(u).openCard)!=null&&O.description?(l.openBlock(),l.createElementBlock("p",o0,l.toDisplayString((B=l.unref(u).openCard)==null?void 0:B.description),1)):l.createCommentVNode("",!0),l.unref(u).groupModifiers.length?(l.openBlock(),l.createElementBlock("div",s0,[T[4]||(T[4]=l.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),l.createVNode(ta,{isSectionModifier:l.unref(u).isSectionModifier,toggleNotRequire:l.unref(i).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):l.createCommentVNode("",!0),l.createVNode(Ld,{qr_menu:o.configPage.qr_menu,closeProduct:o.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])],4)}}}),[["__scopeId","data-v-a92cd973"]]),l0={key:0,class:"popupWindowDefault_overlay"},ia=ze(l.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(o,{emit:s}){const i=o,u=s,f=()=>{u("update:visible",!1)};return l.watch(()=>i.visible,async h=>{h&&await l.nextTick(),i.isVisible=h}),(h,m)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(l.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:m[0]||(m[0]=()=>{u("update:visible",!1)})},{default:l.withCtx(()=>[i.visible?(l.openBlock(),l.createElementBlock("div",{key:0,class:"background_black",onClick:f})):l.createCommentVNode("",!0)]),_:1}),l.createVNode(l.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:m[1]||(m[1]=()=>{u("update:visible",!1)})},{default:l.withCtx(()=>[i.visible?(l.openBlock(),l.createElementBlock("div",l0,[l.renderSlot(h.$slots,"default",{},void 0,!0)])):l.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),c0={},u0={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function d0(o,s){return l.openBlock(),l.createElementBlock("svg",u0,[...s[0]||(s[0]=[l.createElementVNode("path",{d:"M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const f0=ze(c0,[["render",d0]]),fo=we.defineStore("modals",()=>{const o=new Map,s=(f,h)=>{const m=u(f).value;m.visible=!0,m.context=h},i=f=>{const h=u(f).value;h.visible=!1},u=f=>(o.has(f)||o.set(f,l.ref({visible:!1})),o.get(f));return{state:u,open:s,close:i}}),h0=["src"],g0={class:"cart_box_content_wrapper"},m0={class:"cart_box_content_info"},p0={class:"cart_amount"},x0={class:"cart_amount_count"},w0={class:"cart_box_info_more"},_0={key:1,class:"cart_modifier_info"},C0={class:"cart_modifier_content"},E0={class:"wrapper_price_count_cart"},y0={class:"count_cart_box"},b0={class:"wrapper_modifiers_discount"},oa=ze(l.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(o,{emit:s}){const i=o,u=lt(),f=It(),h=fo(),{itemThemes:m}=we.storeToRefs(f),x=l.ref(0),_=l.ref(0),p=l.ref(!1),C=l.ref(!1),y=l.ref(!1),{displayNumber:S,update:M}=na(0,800),T=l.computed(()=>{var j,G;const V=((j=i.cardItem)==null?void 0:j.modifiers)??[],ae=(((G=i.cardItem)==null?void 0:G.group_modifiers)??[]).flatMap(z=>z.modifiers??[]);return[...V,...ae]}),{mediaUrl:D}=Fn(()=>{var V;return((V=i.cardItem)==null?void 0:V.id)+"_image"},()=>{var V;return(V=i.cardItem)==null?void 0:V.image_link}),v=l.computed(()=>{var V,ae;return((V=i.cardItem)==null?void 0:V.total_new_price)||dr(i.cardItem)*((ae=i.cardItem)==null?void 0:ae.amount)}),U=()=>h.open("cart-delete-confirm",i.cardItem),P=()=>{y.value=!y.value},O=()=>{u.plusAmount(i.cardItem.idSystem)},B=()=>{i.cardItem.amount>1?u.minusAmount(i.cardItem.idSystem):U()},$=V=>{x.value=V.touches[0].clientX,p.value=!0},K=V=>{p.value&&(_.value=V.touches[0].clientX-x.value,_.value>0&&(_.value=0))},W=()=>{p.value=!1,_.value<-115&&U(),_.value=0};l.onMounted(()=>{i.index===0&&(C.value=!0,setTimeout(()=>{_.value=-90,setTimeout(()=>{_.value=0,C.value=!1},700)},0))});const ie=l.computed(()=>{const V=i.index===0&&C.value?1:`${1-Math.abs(_.value)/200}`;return{transform:`translateX(${_.value}px)`,opacity:V,transition:p.value?"none":"transform 0.7s, opacity 0.7s"}});return l.watch(v,M,{immediate:!0}),(V,ae)=>{var j,G,z,X;return l.openBlock(),l.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:$,onTouchmove:K,onTouchend:W,style:l.normalizeStyle(ie.value)},[ae[2]||(ae[2]=l.createElementVNode("div",{class:"wrapper_cart_delete"},[l.createElementVNode("div",{class:"cart_delete"})],-1)),l.createElementVNode("img",{src:l.unref(D)||"",class:"cart_box_image"},null,8,h0),l.createElementVNode("div",g0,[l.createElementVNode("div",m0,[l.createElementVNode("p",null,l.toDisplayString((j=o.cardItem)==null?void 0:j.name),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(((G=i.cardItem)==null?void 0:G.discounts)||[],(N,Q)=>(l.openBlock(),l.createElementBlock("div",{key:Q,class:"discount_banner"},[l.createElementVNode("p",null,l.toDisplayString(N.name),1),l.createElementVNode("p",null,l.toDisplayString(N.discount)+"₽",1)]))),128)),l.createElementVNode("div",p0,[l.createElementVNode("button",{onClick:B},"-"),l.createElementVNode("p",x0,l.toDisplayString(i.cardItem.amount),1),l.createElementVNode("button",{onClick:O},"+")])]),l.createElementVNode("div",w0,[l.createElementVNode("div",{class:"cart_box_remove_item",onClick:U},[l.createVNode(f0)]),(z=i.cardItem)!=null&&z.new_price?(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass({discount_new_price:(X=i.cardItem)==null?void 0:X.new_price})},l.toDisplayString((i.cardItem.new_price*i.cardItem.amount).toFixed(2)+"₽"),3)):l.createCommentVNode("",!0),l.createElementVNode("p",null,l.toDisplayString(l.unref(S).toFixed(2)+"₽"),1)])]),!y.value&&T.value.length>0?(l.openBlock(),l.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:l.withModifiers(P,["stop"])},[...ae[0]||(ae[0]=[l.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),l.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):l.createCommentVNode("",!0),y.value?(l.openBlock(),l.createElementBlock("div",_0,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(T.value,N=>{var Q;return l.openBlock(),l.createElementBlock("div",{class:"cart_modifier_item",key:N.id},[l.createElementVNode("div",C0,[l.createVNode(so,{id:"plus_orange"}),l.createElementVNode("p",null,l.toDisplayString(N.name),1)]),l.createElementVNode("div",E0,[l.createElementVNode("p",y0,l.toDisplayString(`x${N.amount}`),1),l.createElementVNode("div",b0,[N!=null&&N.new_price?(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass({discount_new_price:(Q=N==null?void 0:N.new_price)==null?void 0:Q.toFixed(2)})},l.toDisplayString((N.new_price*N.amount).toFixed(2)+"₽"),3)):l.createCommentVNode("",!0),l.createElementVNode("p",null,l.toDisplayString((N.total_new_price||N.price*N.amount).toFixed(2)+"₽"),1)])])])}),128)),l.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:l.withModifiers(P,["stop"])},[...ae[1]||(ae[1]=[l.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),l.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):l.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-868411fd"]]),A0={},I0={class:"nfc_x",viewBox:"0 0 48 48"};function S0(o,s){return l.openBlock(),l.createElementBlock("svg",I0,[...s[0]||(s[0]=[l.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),l.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const N0=ze(A0,[["render",S0]]),T0={},k0={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function R0(o,s){return l.openBlock(),l.createElementBlock("svg",k0,[...s[0]||(s[0]=[l.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),l.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),l.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const O0=ze(T0,[["render",R0]]),B0={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},M0=l.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(o){return(s,i)=>o.styleRetry?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("svg",B0,[...i[0]||(i[0]=[l.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),l.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),v0={class:"sheet_header"},D0={class:"sheet_title",id:"sheetTitle"},P0={class:"sheet_body"},L0={class:"sheet_card"},F0={class:"nfc_title"},V0={class:"lead"},U0={class:"wrapper_input_accept"},z0={key:1},H0={key:0,class:"card_phone_auth_wrapper"},G0={class:"sr_only","aria-live":"polite"},sa=l.defineComponent({__name:"CardReader",setup(o){const s=lt(),i=It(),{is_OpenLoyal:u}=we.storeToRefs(s),{itemThemes:f}=we.storeToRefs(i),h=St(),m=l.ref(),x=l.ref(null),_=l.ref(""),p={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},C=l.computed({get:()=>_.value,set:H=>{_.value=H.replace(/\s/g,"")}}),y=l.computed(()=>h.currentState),S=l.computed(()=>h.isDrawerOpen),M=l.computed(()=>{var H;return((H=p[y.value])==null?void 0:H.text)||""}),T=l.computed(()=>{var H;(H=p[y.value])!=null&&H.title}),D=l.computed(()=>y.value==="success"?"Добро пожаловать!":f.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),v=l.computed(()=>({ok:y.value==="success",warn:y.value==="not_found"})),U=l.computed(()=>{const H=[];return y.value==="wait"&&H.push("pulse","show-x"),y.value==="not_found"&&H.push("pulse","show-x"),y.value==="success"&&H.push("pulse","show-ok"),H}),P=l.computed(()=>y.value==="not_found"),O=l.computed(()=>y.value==="success"),B=l.computed(()=>y.value==="not_found"),$=l.computed(()=>["not_found"].includes(y.value)),K=l.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[y.value]||""),W=()=>{h.closeDrawer(),u.value=!0},ie=async H=>{var te,q;h.error="",x.value=null;try{const re=new En;await re.authorizeByCard(H.trim()),await re.getProfile(),s.loadCart(),h.setState("success"),h.isDrawerOpen=!1,h.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(re){h.error=((q=(te=re.response)==null?void 0:te.data)==null?void 0:q.user_friendly_message)||"Ошибка",h.setState("not_found"),x.value=C.value,C.value=""}},V=l.computed(()=>{var te;const H=(te=f.value)==null?void 0:te.kiosk_hide_manual_input_loyalty_card;return H??!1}),ae=()=>{h.setState("wait"),h.error="",C.value="",x.value=null},j=()=>{h.closeDrawer(),x.value=null,C.value=""},G=()=>{var H,te;h.setState("wait"),(te=(H=C.value)==null?void 0:H.trim())!=null&&te.length&&ie(C.value.trim())},z=H=>{H.stopPropagation(),document.activeElement!==m.value&&X()},X=()=>{l.nextTick(()=>{m.value&&(m.value.focus(),_.value&&m.value.select())})},N=H=>{const te=document.activeElement===m.value;if(!S.value||te)return;const q=H.key.toLowerCase();if(q==="backspace")return C.value=C.value.slice(0,-1);if(q==="escape")return j();if(q==="r"&&B.value)return ae();if(q==="c"&&y.value==="success")return j();if(q==="enter")return G();C.value+=q},Q={mounted(H){H==null||H.focus()}};return l.onMounted(()=>{document==null||document.addEventListener("keydown",N)}),l.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",N)}),l.watchEffect(()=>{S.value&&(h.error="")}),(H,te)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[S.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"backdrop show",onClick:j,"aria-hidden":"true"})):l.createCommentVNode("",!0),S.value?(l.openBlock(),l.createElementBlock("section",{key:1,class:l.normalizeClass(["sheet show",{sheet_retry:B.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:z},[l.createElementVNode("header",v0,[l.createElementVNode("div",D0,l.toDisplayString(M.value),1),B.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["sheet_status",v.value])},l.toDisplayString(x.value),3)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"sheet_close",onClick:j,"aria-label":"Закрыть"}," Закрыть ")]),l.createElementVNode("div",P0,[l.createElementVNode("div",L0,[l.createElementVNode("div",{class:l.normalizeClass(["nfc",U.value])},[l.createVNode(M0,{styleRetry:$.value},null,8,["styleRetry"]),P.value?(l.openBlock(),l.createBlock(N0,{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"overlay check",style:l.normalizeStyle({display:O.value?"grid":"none"}),"aria-hidden":"true"},[l.createVNode(O0)],4)],2),l.createElementVNode("h2",F0,l.toDisplayString(T.value),1),l.createElementVNode("p",V0,l.toDisplayString(D.value),1),l.createElementVNode("div",U0,[l.withDirectives(l.createElementVNode("input",{style:l.normalizeStyle(V.value?{position:"absolute",left:"-9999px"}:{}),ref_key:"cardInputManualRef",ref:m,"onUpdate:modelValue":te[0]||(te[0]=q=>C.value=q),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:l.withKeys(G,["enter"])},null,36),[[l.vModelText,C.value],[Q]]),B.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:ae},"Повторить")):(l.openBlock(),l.createElementBlock("div",z0,[V.value?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:te[1]||(te[1]=q=>B.value?j:G())},"Отправить"))]))]),y.value==="wait"&&l.unref(f).kiosk_show_loyalty_phone_input_button?(l.openBlock(),l.createElementBlock("div",H0,[l.createElementVNode("button",{class:"card_phone_auth_button",onClick:W},"Войти по номеру телефона")])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",G0,l.toDisplayString(K.value),1)],2)):l.createCommentVNode("",!0)],64))}});function aa(){const o=ke.useRoute(),s=St(),i=lt(),{isButtonDisabled:u}=we.storeToRefs(s),f=(m,x)=>{const _=m.is_tableservice?"tableservice":m.kiosk_menu?"kiosk":"qr",p=s.createPaymentHandler(_,m.kiosk_menu,m.is_tableservice,x);return p?{...p.config,route:{params:{orgId:String(o.params.orgId)}},handler:p.handler,setButtonDisabled:C=>{u.value=C},on403Kiosk:()=>{localStorage.removeItem("apiKey"),i.is_showApiKey=!0}}:null};return{getCreateOrderConfig:f,makeCreateOrderRequest:async(m,x)=>{const _=f(m,x.paymentMethodId);if(_)return Iu(x.items,x.tableDataId,_,{comment:x.comment,is_authorized:x.isAuthorized,signal:x.signal})}}}const W0="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJJTk5PIGJhbmsgY2FyZCBpY29uIj4NCiAgPGRlZnM+DQogICAgPGxpbmVhckdyYWRpZW50IGlkPSJibGFja0dyYWQiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4NCiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMxQTFBMUEiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPg0KICAgIDwvbGluZWFyR3JhZGllbnQ+DQoNCiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InNoaW5lIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCI+DQogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iNTAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAuMTgiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwIi8+DQogICAgPC9saW5lYXJHcmFkaWVudD4NCg0KICAgIDxmaWx0ZXIgaWQ9InNoYWRvdyIgeD0iLTMwJSIgeT0iLTMwJSIgd2lkdGg9IjE2MCUiIGhlaWdodD0iMTYwJSI+DQogICAgICA8ZmVEcm9wU2hhZG93IGR4PSIwIiBkeT0iNiIgc3RkRGV2aWF0aW9uPSI2IiBmbG9vZC1jb2xvcj0iIzAwMCIgZmxvb2Qtb3BhY2l0eT0iMC4yNSIvPg0KICAgIDwvZmlsdGVyPg0KICA8L2RlZnM+DQoNCiAgPCEtLSBDZW50ZXJlZCBjYXJkIC0tPg0KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg3LjUgMjMpIHJvdGF0ZSgtMTIpIiBmaWx0ZXI9InVybCgjc2hhZG93KSI+DQogICAgPCEtLSBjYXJkIGJvZHkgLS0+DQogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijg1IiBoZWlnaHQ9IjU0IiByeD0iMTAiIGZpbGw9InVybCgjYmxhY2tHcmFkKSIvPg0KDQogICAgPCEtLSB0b3Agc3RyaXBlIC0tPg0KICAgIDxyZWN0IHg9IjAiIHk9IjgiIHdpZHRoPSI4NSIgaGVpZ2h0PSI4IiByeD0iNCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wNSIvPg0KDQogICAgPCEtLSBjaGlwIC0tPg0KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwIDI3KSI+DQogICAgICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTUiIHJ4PSIzIiBmaWxsPSIjQ0ZBRTcwIi8+DQogICAgICA8cmVjdCB4PSIyLjUiIHk9IjMuNSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEuMiIgZmlsbD0iIzlFODM0RSIvPg0KICAgICAgPHJlY3QgeD0iMi41IiB5PSI2LjUiIHdpZHRoPSIxMyIgaGVpZ2h0PSIxLjIiIGZpbGw9IiM5RTgzNEUiLz4NCiAgICAgIDxyZWN0IHg9IjIuNSIgeT0iOS41IiB3aWR0aD0iMTMiIGhlaWdodD0iMS4yIiBmaWxsPSIjOUU4MzRFIi8+DQogICAgICA8cmVjdCB4PSI4LjUiIHk9IjAiIHdpZHRoPSIxLjUiIGhlaWdodD0iMTUiIGZpbGw9IiM5RTgzNEUiIG9wYWNpdHk9IjAuNiIvPg0KICAgIDwvZz4NCg0KICAgIDwhLS0gSU5OTyBsb2dvIC0tPg0KICAgIDx0ZXh0IHg9IjYxIiB5PSIzOSINCiAgICAgICAgICBmb250LWZhbWlseT0ic3lzdGVtLXVpLCAtYXBwbGUtc3lzdGVtLCBTZWdvZSBVSSwgUm9ib3RvLCBBcmlhbCwgc2Fucy1zZXJpZiINCiAgICAgICAgICBmb250LXNpemU9IjEzIg0KICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiDQogICAgICAgICAgbGV0dGVyLXNwYWNpbmc9IjEuMiINCiAgICAgICAgICBmaWxsPSIjRkZGRkZGIg0KICAgICAgICAgIG9wYWNpdHk9IjAuOTUiDQogICAgICAgICAgdGV4dC1hbmNob3I9Im1pZGRsZSI+DQogICAgICBpbm5vDQogICAgPC90ZXh0Pg0KDQogICAgPCEtLSBzaGluZSAtLT4NCiAgICA8cGF0aCBkPSJNLTggNiBMMjUgLTMgTDk0IDQ3IEw2MCA2MiBMLTggMjUgWiIgZmlsbD0idXJsKCNzaGluZSkiLz4NCiAgPC9nPg0KPC9zdmc+",la="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='100'%20height='100'%20fill='none'%3e%3c!--%20Big%20QR%20corners%20(outer%20shape%20with%20inner%20cutout)%20--%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%200H163C202.765%200%20235%2032.235%20235%2072V163C235%20202.765%20202.765%20235%20163%20235H72C32.235%20235%200%20202.765%200%20163V72C0%2032.235%2032.235%200%2072%200Z%20M102%2086H133C141.837%2086%20149%2093.163%20149%20102V133C149%20141.837%20141.837%20149%20133%20149H102C93.163%20149%2086%20141.837%2086%20133V102C86%2093.163%2093.163%2086%20102%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M349%200H440C479.765%200%20512%2032.235%20512%2072V163C512%20202.765%20479.765%20235%20440%20235H349C309.235%20235%20277%20202.765%20277%20163V72C277%2032.235%20309.235%200%20349%200Z%20M379%2086H410C418.837%2086%20426%2093.163%20426%20102V133C426%20141.837%20418.837%20149%20410%20149H379C370.163%20149%20363%20141.837%20363%20133V102C363%2093.163%20370.163%2086%20379%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%20277H163C202.765%20277%20235%20309.235%20235%20349V440C235%20479.765%20202.765%20512%20163%20512H72C32.235%20512%200%20479.765%200%20440V349C0%20309.235%2032.235%20277%2072%20277Z%20M102%20363H133C141.837%20363%20149%20370.163%20149%20379V410C149%20418.837%20141.837%20426%20133%20426H102C93.163%20426%2086%20418.837%2086%20410V379C86%20370.163%2093.163%20363%20102%20363Z%20'/%3e%3c!--%20Small%20modules%20--%3e%3crect%20x='277'%20y='277'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3crect%20x='426'%20y='277'%20width='86'%20height='86'%20rx='28'%20fill='currentColor'/%3e%3crect%20x='277'%20y='426'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3c!--%20Center%20dot%20--%3e%3ccircle%20cx='394.17'%20cy='394.17'%20r='33'%20fill='currentColor'/%3e%3c/svg%3e",X0=["src"],j0={class:"header_description"},q0=ze(l.defineComponent({__name:"PaymentBoxes",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean,default:!1},hideDiscountsButton:{type:Boolean,default:!1},orderId:{default:null},signal:{},provider:{}},emits:["select"],setup(o,{emit:s}){const i=o,u=s,f=St(),h=Rt(),{selectedProvider:m,isButtonDisabled:x}=we.storeToRefs(f),{isAddToCard:_}=we.storeToRefs(h),{makeCreateOrderRequest:p}=aa(),C={default:W0,SBP:la},y=async()=>{m.value=i.provider;const M=i.provider.front_type;M&&(_.value=!1,x.value=!0,u("select",M),i.hasRmsDiscount&&!i.hideDiscountsButton&&i.orderId!=null?Fr(i.orderId,i.provider.type):await p(i.configPage,{paymentMethodId:M,items:i.cartItems,tableDataId:i.configPage.tableDataId,comment:i.comment,isAuthorized:i.isAuthorized,signal:i.signal}))},S=l.computed(()=>C[i.provider.front_type]||C.default);return(M,T)=>(l.openBlock(),l.createElementBlock("div",{class:"payment_boxes_wrapper",onClick:y},[l.createElementVNode("img",{class:"picture",src:S.value},null,8,X0),l.createElementVNode("div",j0,[l.createElementVNode("b",null,l.toDisplayString(o.provider.name),1),l.createElementVNode("p",null,l.toDisplayString(o.provider.description),1)]),l.createVNode(Ur)]))}}),[["__scopeId","data-v-7e25de77"]]),Z0={key:0,class:"wrapper_cart_payment"},Y0={class:"wrapper_paid"},$0={class:"to_be_paid"},K0=ze(l.defineComponent({__name:"CartPayment",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean},hideDiscountsButton:{type:Boolean},orderId:{},signal:{}},emits:["selectPayment"],setup(o,{emit:s}){const i=St(),u=lt(),f=o,{totalPrice_lib:h,countBonus:m}=we.storeToRefs(u),x=s,_=C=>{x("selectPayment",C)},p=()=>{x("selectPayment","")};return(C,y)=>l.unref(i).providerTypes.length>1?(l.openBlock(),l.createElementBlock("div",Z0,[y[2]||(y[2]=l.createElementVNode("h2",null,"Выберите способ оплаты",-1)),y[3]||(y[3]=l.createElementVNode("p",{class:"description_payment"},"Можно изменить позже до оплаты",-1)),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(i).providerTypes,(S,M)=>(l.openBlock(),l.createElementBlock("div",{key:M},[l.createVNode(q0,{provider:S,"config-page":f.configPage,comment:f.comment,"cart-items":f.cartItems,"is-authorized":f.isAuthorized,"has-rms-discount":f.hasRmsDiscount,"hide-discounts-button":f.hideDiscountsButton,"order-id":f.orderId,signal:f.signal,onSelect:_},null,8,["provider","config-page","comment","cart-items","is-authorized","has-rms-discount","hide-discounts-button","order-id","signal"])]))),128)),l.createElementVNode("div",Y0,[l.createElementVNode("p",$0,[y[0]||(y[0]=l.createTextVNode("К оплате ",-1)),l.createVNode(jt,{price:l.unref(h)-l.unref(m),fixedFloat:2},null,8,["price"]),y[1]||(y[1]=l.createTextVNode(" ₽",-1))]),l.createVNode(un,{textButtonDefault:"Назад",onClick:p,class:"btn_payment"})])])):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-93970a62"]]),Q0={class:"start_page"},J0=["src"],e1={class:"wrap"},t1={class:"wrap_box"},n1={class:"title_fiscal_order"},r1={class:"wrapper_accept"},i1={ref:"barRef",class:"bar_complete","aria-hidden":"true"},o1=ze(l.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(o){const s=lt(),i=St(),u=Rt(),f=It(),{cartProducts_lib:h}=we.storeToRefs(s),{orderNumber:m,orderCompleted_lib:x,selectedOrderType:_}=we.storeToRefs(i),{is_startPage:p}=we.storeToRefs(u),{mediaUrl:C}=Fn(()=>f.itemThemes.kiosk_preloader?"preloader":null),y=ke.useRouter(),S=ke.useRoute();let M=null;l.onMounted(()=>{M=setTimeout(()=>{p.value=!f.itemThemes.kiosk_disable_lock_screen,_.value=null,s.isOrderTypeSubmited=!1,y.replace(`/${S.params.orgId}`)},1e4)});const T=()=>{fr(["cart","authTokensAccess","authTokensRefresh"]),h.value=[],x.value=null,_.value=null,s.isOrderTypeSubmited=!1,i.clearCard(),s.profile=null,y.replace(`/${S.params.orgId}`)};return l.onUnmounted(()=>{M&&clearInterval(M)}),(D,v)=>(l.openBlock(),l.createElementBlock("div",Q0,[l.withDirectives((l.openBlock(),l.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:l.unref(C)},[l.createElementVNode("source",{src:l.unref(C)||"",type:"video/webm"},null,8,J0)])),[[l.unref(zr)]]),v[4]||(v[4]=l.createElementVNode("div",{class:"start_img_black"},null,-1)),l.createElementVNode("div",e1,[l.createElementVNode("div",t1,[v[1]||(v[1]=l.createElementVNode("div",{class:"icon","aria-hidden":"true"},[l.createElementVNode("svg",{viewBox:"0 0 24 24"},[l.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),v[2]||(v[2]=l.createElementVNode("h1",null," Заказ успешно оплачен ",-1)),l.createElementVNode("p",n1,"№ "+l.toDisplayString(l.unref(m)),1),v[3]||(v[3]=l.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),l.createElementVNode("div",r1,[l.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:T},[v[0]||(v[0]=l.createElementVNode("span",{class:"label"},"Новый заказ",-1)),l.createElementVNode("span",i1,null,512)])])])])]))}}),[["__scopeId","data-v-79c00acf"]]),s1={};function a1(o,s){return s[0]||(s[0]=l.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-3e03a6dc><i data-v-3e03a6dc></i></div><h1 class="title_fiscal" data-v-3e03a6dc>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-3e03a6dc>Не забудьте <b data-v-3e03a6dc>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-3e03a6dc><div class="printer" data-v-3e03a6dc><div class="led" data-v-3e03a6dc></div><div class="slot" data-v-3e03a6dc></div><div class="receipt" data-v-3e03a6dc><div class="tear" data-v-3e03a6dc></div><div class="line accent" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div></div></div></div>',4))}const l1=ze(s1,[["render",a1],["__scopeId","data-v-3e03a6dc"]]),c1={},u1={class:"center"};function d1(o,s){return l.openBlock(),l.createElementBlock("div",u1,[...s[0]||(s[0]=[l.createStaticVNode('<div class="stack" data-v-f0859fd1><h1 class="title_fiscal" data-v-f0859fd1>Приложите карту для оплаты</h1><p class="reminder" data-v-f0859fd1>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f0859fd1><div class="waves" data-v-f0859fd1><span data-v-f0859fd1></span><span data-v-f0859fd1></span><span data-v-f0859fd1></span></div><div class="nfc" data-v-f0859fd1><svg viewBox="0 0 24 24" data-v-f0859fd1><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f0859fd1></path><path d="M10 6c4 4 4 8 0 12" data-v-f0859fd1></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f0859fd1></path></svg></div><div class="card" data-v-f0859fd1><div class="logo" data-v-f0859fd1>inno.</div><div class="chip" data-v-f0859fd1></div><div class="digits" data-v-f0859fd1>4815 1623 4200 0900</div><div class="holder" data-v-f0859fd1>Гость</div></div></div></div>',1)])])}const f1=ze(c1,[["render",d1],["__scopeId","data-v-f0859fd1"]]);/*!
|
|
6
|
+
`+h):u.stack=h}catch{}}throw u}}_request(s,i){typeof s=="string"?(i=i||{},i.url=s):i=s||{},i=Qn(this.defaults,i);const{transitional:u,paramsSerializer:f,headers:h}=i;u!==void 0&&hi.assertOptions(u,{silentJSONParsing:In.transitional(In.boolean),forcedJSONParsing:In.transitional(In.boolean),clarifyTimeoutError:In.transitional(In.boolean)},!1),f!=null&&(J.isFunction(f)?i.paramsSerializer={serialize:f}:hi.assertOptions(f,{encode:In.function,serialize:In.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),hi.assertOptions(i,{baseUrl:In.spelling("baseURL"),withXsrfToken:In.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let m=h&&J.merge(h.common,h[i.method]);h&&J.forEach(["delete","get","head","post","put","patch","common"],T=>{delete h[T]}),i.headers=$t.concat(m,h);const x=[];let _=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(i)===!1||(_=_&&D.synchronous,x.unshift(D.fulfilled,D.rejected))});const p=[];this.interceptors.response.forEach(function(D){p.push(D.fulfilled,D.rejected)});let C,y=0,S;if(!_){const T=[Hs.bind(this),void 0];for(T.unshift(...x),T.push(...p),S=T.length,C=Promise.resolve(i);y<S;)C=C.then(T[y++],T[y++]);return C}S=x.length;let M=i;for(;y<S;){const T=x[y++],D=x[y++];try{M=T(M)}catch(v){D.call(this,v);break}}try{C=Hs.call(this,M)}catch(T){return Promise.reject(T)}for(y=0,S=p.length;y<S;)C=C.then(p[y++],p[y++]);return C}getUri(s){s=Qn(this.defaults,s);const i=Os(s.baseURL,s.url,s.allowAbsoluteUrls);return ys(i,s.params,s.paramsSerializer)}};J.forEach(["delete","get","head","options"],function(s){Jn.prototype[s]=function(i,u){return this.request(Qn(u||{},{method:s,url:i,data:(u||{}).data}))}}),J.forEach(["post","put","patch"],function(s){function i(u){return function(h,m,x){return this.request(Qn(x||{},{method:s,headers:u?{"Content-Type":"multipart/form-data"}:{},url:h,data:m}))}}Jn.prototype[s]=i(),Jn.prototype[s+"Form"]=i(!0)});let wu=class nl{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(h){i=h});const u=this;this.promise.then(f=>{if(!u._listeners)return;let h=u._listeners.length;for(;h-- >0;)u._listeners[h](f);u._listeners=null}),this.promise.then=f=>{let h;const m=new Promise(x=>{u.subscribe(x),h=x}).then(f);return m.cancel=function(){u.unsubscribe(h)},m},s(function(h,m,x){u.reason||(u.reason=new mr(h,m,x),i(u.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const i=this._listeners.indexOf(s);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const s=new AbortController,i=u=>{s.abort(u)};return this.subscribe(i),s.signal.unsubscribe=()=>this.unsubscribe(i),s.signal}static source(){let s;return{token:new nl(function(f){s=f}),cancel:s}}};function _u(o){return function(i){return o.apply(null,i)}}function Cu(o){return J.isObject(o)&&o.isAxiosError===!0}const to={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(to).forEach(([o,s])=>{to[s]=o});function Xs(o){const s=new Jn(o),i=as(Jn.prototype.request,s);return J.extend(i,Jn.prototype,s,{allOwnKeys:!0}),J.extend(i,s,null,{allOwnKeys:!0}),i.create=function(f){return Xs(Qn(o,f))},i}const nt=Xs(Pr);nt.Axios=Jn,nt.CanceledError=mr,nt.CancelToken=wu,nt.isCancel=Ns,nt.VERSION=Gs,nt.toFormData=li,nt.AxiosError=Be,nt.Cancel=nt.CanceledError,nt.all=function(s){return Promise.all(s)},nt.spread=_u,nt.isAxiosError=Cu,nt.mergeConfig=Qn,nt.AxiosHeaders=$t,nt.formToJSON=o=>Is(J.isHTMLForm(o)?new FormData(o):o),nt.getAdapter=zs.getAdapter,nt.HttpStatusCode=to,nt.default=nt;const{Axios:Wg,AxiosError:Xg,CanceledError:jg,isCancel:qg,CancelToken:Zg,VERSION:Yg,all:$g,Cancel:Kg,isAxiosError:Qg,spread:Jg,toFormData:em,AxiosHeaders:tm,HttpStatusCode:nm,formToJSON:rm,getAdapter:im,mergeConfig:om}=nt;let Sn=null,Gt=null;function Cn(o){o&&o.close(!0)}async function Fr(o,s){const i=St(),u=lt(),f=En.create();try{const h=await f.initPaymentLink(o,s);return i.paymentCostQR=u.totalPrice_lib-u.countBonus,i.linkQR=h.url,Gt==null||Gt.deleteCart(null,Gt==null?void 0:Gt.is_requestKiosk),h}catch(h){throw i.isButtonDisabled=!1,i.showNotification(h==null?void 0:h.response.data.user_friendly_message),h}}function Eu(o,s,i){if(o!=null&&o.params){if(o.error){s.showNotification(o.error),cn(s,null),ro(s);return}i(o,s)}}function no(o,s){const i=St(),u=lt();return s.has_rms_discount?(o.params.new_discounts&&(i.extraDiscount=Number(o.params.new_total_cost)-s.initialCartPrice,u.totalPrice_lib=Number(o.params.new_total_cost),s.showNotification("К заказу были добавлены скидки")),!0):!1}const cn=(o,s)=>{o.updateOrderStatus&&o.updateOrderStatus(s)},yu=o=>{o.loadCart&&o.loadCart()},gi=o=>{o.resetBonuses&&o.resetBonuses()},ro=o=>{o.closeWebSocket&&o.closeWebSocket()},js=(o,s)=>{o.is_tableservice&&(Cn(s),o.resetStores(),o.deleteCart(null,o.is_requestKiosk),o.cartCleanup?o.cartCleanup.cleanupAndNavigate("profile",o.is_requestKiosk):o.deleteCart("profile",o.is_requestKiosk))},qs=(o,s,i,u)=>{const f=s.ws||i;En.create().orderPay(o.params.order_id||"").then(m=>{s.setOrderNumber&&s.setOrderNumber(m.data.order_number)}).catch(m=>{(s.errorHandler||u).handleOrderPayError(m,{...s,closeWebSocket:()=>Cn(f)})})},io=(o,s,i)=>{const u=o.ws||s;(o.errorHandler||i).handleOrderError({...o,closeWebSocket:()=>Cn(u)})},bu=(o,s,i)=>{const u=St(),f=u.getCurrentPaymentMethodId();if(!f||!Ln.getConfig(f)||!Ln.isMethodAvailable(f,o))return null;const m=Ln.createHandler(f);if(!m)return null;const x=u.createPaymentHandler(o,s,i,f);return x?{handler:m,config:x.config}:null},Au=o=>{if(!Gt)return;const s=Gt.context,i=Gt.is_requestKiosk,u=Gt.is_tableservice,f=bu(s,i,u);if(!f){console.warn("handleWebSocketMessageWithDynamicHandler: не удалось получить handler");return}const{handler:h,config:m}=f,x={...m,...Gt};Eu(o,x,h.handleWebSocketStatus)};async function Iu(o,s,i,u){var C,y;const{is_requestKiosk:f,is_tableservice:h}=i,{comment:m,is_authorized:x,signal:_}=u;i.setButtonDisabled(!0);const p=En.create();try{const S=await p.createOrder(o,s,f,m,x,h,_);if((S==null?void 0:S.status)===201&&((C=S==null?void 0:S.data)!=null&&C.id)){const M=S.data.id,T={...i,signal:_};Gt=T;const v=`wss://${T.area||""}/ws/order/${M}/`;Sn=ri(v,{signal:_});const U=()=>{console.warn("WebSocket connection opened (centralized mode)")},P=B=>{var $;console.error("WebSocket error (centralized mode):",B),Cn(Sn),Sn=null,Gt=null,i.setButtonDisabled(!1),($=i.errorHandler)==null||$.handlePaymentError(B,T)},O=B=>{Au(B)};Sn.on("open",U),Sn.on("message",O),Sn.on("error",P),Sn.connect(),Gt.ws=Sn,Gt.closeWebSocket=()=>{Cn(Sn),Sn=null,Gt=null}}return S}catch(S){throw nt.isCancel(S)||((y=i.errorHandler)==null||y.handleCreateOrderError(S,i),i.setButtonDisabled(!1)),S}}const Zs=o=>{var s,i;return((i=(s=o==null?void 0:o.response)==null?void 0:s.data)==null?void 0:i.user_friendly_message)||null};function mi(){const o=St();return{handlePaymentError(s,i){var f,h,m,x,_,p;const u=Zs(s);cn(i,null),yu(i),u?(i.showNotification(u),ro(i),i.is_requestKiosk&&((h=i.orderErrors)!=null&&h.includes((f=s.response)==null?void 0:f.status))&&(i.cartCleanup?i.cartCleanup.cleanupAndNavigate("retryPage",i.is_requestKiosk):i.deleteCart("retryPage",i.is_requestKiosk)),i.is_tableservice?i.resetStores():(gi(i),i.context==="qr"&&i.navigation?i.navigation.redirectToError():i.context==="qr"&&i.redirect&&(o.isButtonDisabled=!1,i.redirect(`/${((x=(m=i.route)==null?void 0:m.params)==null?void 0:x.orgId)||""}/errorPayment`)))):i.context==="qr"&&(gi(i),i.navigation?i.navigation.redirectToError():i.redirect&&i.redirect(`/${((p=(_=i.route)==null?void 0:_.params)==null?void 0:p.orgId)||""}/errorPayment`)),o.isButtonDisabled=!1},handleOrderPayError(s,i){var f,h,m,x;const u=Zs(s);u&&(i.showNotification(u),ro(i),i.is_requestKiosk?((h=i.orderErrors)!=null&&h.includes((f=s.response)==null?void 0:f.status)&&(i.cartCleanup.cleanupAndNavigate("retryPage",i.is_requestKiosk),i.deleteCart("retryPage",i.is_requestKiosk)),cn(i,null)):(gi(i),i.navigation?i.navigation.redirectToError():i.redirect&&i.redirect(`/${((x=(m=i.route)==null?void 0:m.params)==null?void 0:x.orgId)||""}/errorPayment`),cn(i,null)))},handleOrderError(s){var i,u;s.is_requestKiosk?s.cartCleanup?s.cartCleanup.cleanupAndNavigate("retryPage",s.is_requestKiosk):s.deleteCart("retryPage",s.is_requestKiosk):s.is_tableservice?s.showNotification("Ошибка создания заказа. Пожалуйста, попробуйте еще раз"):(gi(s),s.navigation?s.navigation.redirectToError():s.redirect&&(o.isButtonDisabled=!1,s.redirect(`/${((u=(i=s.route)==null?void 0:i.params)==null?void 0:u.orgId)||""}/errorPayment`)))},handleCreateOrderError(s,i){var m,x,_,p,C,y;const{is_requestKiosk:u,is_tableservice:f}=i,h=i.route.params.orgId;u?(((m=s==null?void 0:s.response)==null?void 0:m.status)===403&&((x=i.on403Kiosk)==null||x.call(i),(_=i.redirect)==null||_.call(i,`/${h}/retryPage`)),i.deleteCart("retryPage",u)):f?i.showNotification(((C=(p=s==null?void 0:s.response)==null?void 0:p.data)==null?void 0:C.user_friendly_message)||"Ошибка создания заказа"):(y=i.redirect)==null||y.call(i,`/${h}/errorPayment`)}}}const Su=()=>{const o=St();let s=null;const i=mi(),u=(f,h)=>{var x,_;const m=(x=f.params)==null?void 0:x.status;if(m==="sent"){if(no(f,h)){o.isButtonDisabled=!1;return}Fr(f.params.order_id||"",h.method).catch(p=>{const C=h.errorHandler||i,y=h.ws||s;C.handlePaymentError(p,{...h,closeWebSocket:()=>Cn(y)})})}else if(m==="waiting_for_fiscalization")cn(h,1);else if(m==="payment_initiation_retry"||m==="fiscalized")qs(f,h,s,i);else if(m==="payment_initiation")cn(h,2);else if(m==="paid"){cn(h,3);const p=h.ws||s;Cn(p),localStorage.removeItem("cart")}else(_=h.orderErrors)!=null&&_.includes(m)&&io(h,s,i)};return{handleWebSocketStatus(f,h){u(f,h)}}};function Nu(){const o=St();let s=null;const i=mi(),u=(f,h)=>{var x,_,p,C;const m=(x=f.params)==null?void 0:x.status;if((_=f.params)!=null&&_.number&&(o.orderNumber=(p=f.params)==null?void 0:p.number),m==="sent"){if(no(f,h)){o.isButtonDisabled=!1;return}Fr(f.params.order_id||"",h.method).catch(y=>{const S=h.errorHandler||i,M=h.ws||s;S.handlePaymentError(y,{...h,closeWebSocket:()=>Cn(M)})})}else if(m==="sent_fiscalization")cn(h,1);else if(m==="waiting_payment")cn(h,4);else if(m==="paid"){cn(h,3);const y=h.ws||s;Cn(y),localStorage.removeItem("cart")}else(C=h.orderErrors)!=null&&C.includes(m)&&(o.isButtonDisabled=!1,io(h,s,i))};return{handleWebSocketStatus(f,h){u(f,h)}}}const Tu=()=>{const o=St();let s=null;const i=mi(),u=(f,h)=>{var x,_;const m=(x=f.params)==null?void 0:x.status;if(m==="sent"){if(no(f,h)){o.isButtonDisabled=!1;return}Fr(f.params.order_id||"",h.method).then(p=>{if(h.is_tableservice){const C=h.ws||s;js(h,C)}else p.url&&window.location.replace(p.url)}).catch(p=>{const C=h.errorHandler||i,y=h.ws||s;C.handlePaymentError(p,{...h,closeWebSocket:()=>Cn(y)})})}else if(m==="payment_initiation_retry"||m==="fiscalized")qs(f,h,s,i);else if(m==="payment_initiation")cn(h,2);else if(m==="paid"){cn(h,3);const p=h.ws||s;Cn(p),localStorage.removeItem("cart")}else(_=h.orderErrors)!=null&&_.includes(m)&&(o.isButtonDisabled=!1,io(h,s,i))};return{handleWebSocketStatus(f,h){u(f,h)}}};class Ln{static initialize(){this.register({id:"TERMINAL_BASE",method:"TERMINAL",handlerFactory:Su,availableContexts:["kiosk"]}),this.register({id:"YOOKASSA_BASE",method:"YOOKASSA",handlerFactory:Tu,availableContexts:["qr","tableservice"]}),this.register({id:"SBP",method:"YOOKASSA",handlerFactory:Nu,availableContexts:["kiosk"]})}static register(s){this.methods.set(s.id,s)}static getConfig(s){return this.methods.get(s)??null}static getAvailableMethods(s){return Array.from(this.methods.entries()).filter(([i,u])=>u.availableContexts.includes(s)).map(([i])=>i)}static isMethodAvailable(s,i){const u=this.getConfig(s);return u?u.availableContexts.includes(i):!1}static createHandler(s){const i=this.getConfig(s);return i?i.handlerFactory():(console.warn(`PaymentMethodRegistry: метод оплаты ${s} не зарегистрирован`),null)}}Xe(Ln,"methods",new Map),Ln.initialize();function ku(o){return{cleanupAndNavigate(s,i){o.deleteCart(s,i)},cleanup(s){o.deleteCart(null,s)},clearTokens(){o.deleteCart(null,!0)},resetStores(){o.resetStores()}}}function Ru(o){var i,u;const s=((u=(i=o.route)==null?void 0:i.params)==null?void 0:u.orgId)||"";return{redirectToError(){const f=`/${s}/errorPayment`;o.redirect?o.redirect(f):o.router&&o.router.push(f)},redirectToSuccess(f){const h=f?`/${s}/${f}`:`/${s}/profile`;o.redirect?o.redirect(h):o.router&&o.router.push(h)},redirect(f){o.redirect?o.redirect(f):o.router&&o.router.push(f)},getErrorPath(){return`/${s}/errorPayment`},getSuccessPath(){return`/${s}/profile`}}}const St=we.defineStore("cartLib",()=>{const o=ke.useRouter(),s=ke.useRoute(),i=It(),u=lt(),{config_lib:f,countBonus:h,totalPrice_lib:m,initialCartPrice_lib:x,is18Allowed:_}=we.storeToRefs(u),{itemThemes:p}=we.storeToRefs(i),C=l.ref(!1),y=l.ref(""),S=l.ref(null),M=l.ref("wait"),T=l.ref(!1),D=l.ref(0),v=l.ref(""),U=l.ref([]),P=l.ref([]),O=l.ref(),B=l.ref(0),$=l.ref(!1),K=l.ref(),W=l.ref(null),ie=l.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry","cancelled","failed_after_payment_initiation"]),V=l.ref("Оплатить"),ae=l.ref(),j=l.computed({get:()=>U.value||[],set:Oe=>{(Oe==null?void 0:Oe.length)===1&&(ae.value=Oe[0]),U.value=Oe}}),G=l.ref(!1),z=l.ref(null),X=l.ref(0),N=l.ref(!1),Q=l.ref({textNotification:""}),H=Oe=>{N.value=!0,Q.value.textNotification=Oe},te=()=>{var Oe,qe;return(Oe=O.value)!=null&&Oe.front_type?O.value.front_type:((qe=P.value[0])==null?void 0:qe.front_type)||null},q=(Oe,qe,Qe,Ot)=>{var pt;const ce=Ot??((pt=P.value[0])==null?void 0:pt.front_type);if(!ce)return console.warn("Не удалось определить метод оплаты"),null;const He=Ln.getConfig(ce);if(!He||!Ln.isMethodAvailable(ce,Oe))return console.warn(`Метод ${ce} недоступен для контекста ${Oe}`),null;const $e=Ln.createHandler(ce);return $e?(K.value=re(He.method,Oe,qe,Qe),{handler:$e,config:K.value}):(console.warn(`Не удалось создать обработчик для метода ${ce}`),null)},re=(Oe,qe,Qe,Ot)=>{const ce={method:Oe,context:qe,is_requestKiosk:Qe,is_tableservice:Ot,router:o,route:s,orderErrors:ie.value,area:f.value.area,has_rms_discount:f.value.has_rms_discount,totalPrice:m,initialCartPrice:x,showNotification:H,deleteCart:Ve,resetStores:ct,redirect:Je=>o.push(Je),updateOrderStatus:Je=>{z.value=Je},setOrderNumber:Je=>{W.value=Je},loadCart:()=>u.loadCart(),resetBonuses:()=>{h.value=0}},He=mi(),$e=ku(ce),pt=Ru(ce);return{...ce,errorHandler:He,cartCleanup:$e,navigation:pt}},me=l.computed(()=>!!S.value),xe=Oe=>{M.value=Oe},Ie=Oe=>{S.value=Oe},_e=()=>{p.value.kiosk_show_loyalty_card_button&&p.value.kiosk_show_loyalty_phone_input_button?C.value=!0:!p.value.kiosk_show_loyalty_card_button&&p.value.kiosk_show_loyalty_phone_input_button?u.is_OpenLoyal=!0:C.value=!0,M.value="wait",y.value=""},Me=()=>{C.value=!1,M.value="wait",y.value=""},ge=()=>{S.value=null,y.value="",M.value="wait",Me()},ct=()=>{G.value=!1,z.value=null},Ve=(Oe=null,qe=!1)=>{u.cartProducts_lib=[],fr(["cart"]),qe&&(fr(["authTokensAccess","authTokensRefresh","user"]),u.profile=null,sessionStorage.removeItem("is_adult"),_.value=!1),Oe&&o.push(`/${s.params.orgId}/${Oe}`)};return{isButtonDisabled:G,orderCompleted_lib:z,extraDiscount:D,orderNumber:W,is_notification_lib:N,notificationData_lib:Q,textPaymentBtn_lib:V,count:X,guestInfo:S,error:y,isDrawerOpen:C,currentState:M,isAuthorized:me,discountBtn:T,linkQR:v,orderTypes:j,providerTypes:P,is_paymentCart:$,selectedOrderType:ae,selectedProvider:O,configPayment:K,paymentCostQR:B,deleteCart:Ve,setGuestInfo:Ie,setState:xe,openDrawer:_e,closeDrawer:Me,clearCard:ge,showNotification:H,createPaymentHandler:q,getCurrentPaymentMethodId:te,getAvailablePaymentMethods:Oe=>Ln.getAvailableMethods(Oe)}}),Rt=we.defineStore("cardLib",()=>{var ae;const o=()=>({openCard:null,currentModifier:null,groupModifiers:[],groupModifiersSelected:[],groupCurrentOpen:null,isModifiedAmount:!1,selectedSize:{},productSizes:[],addedProducts:[],plusButtonsRefs:[],modalCount:1,isSectionModifier:!1,isAnimationFly:!0,textErrorRequaired:""}),s=It(),i=l.ref(o()),u=()=>i.value=o(),f=l.ref(!1),h=l.ref(!1),m=l.ref(!1),x=l.ref(),_=l.ref([]),p=l.ref({id:null,visible:!1}),C=l.ref(!((ae=s.itemThemes)!=null&&ae.kiosk_disable_lock_screen)),y=l.computed(()=>{const j=i.value.groupModifiersSelected.findIndex(G=>G.group===i.value.groupCurrentOpen.id);return S(j)}),S=j=>j===-1?0:(i.value.groupModifiersSelected[j].modifiers||[]).reduce((z,X)=>z+(X.amount||0),0),M=l.computed(()=>{var G;const j=(G=i.value.openCard)==null?void 0:G.group_modifiers.findIndex(z=>z.id===i.value.groupCurrentOpen.id);return j===-1||!i.value.openCard?0:i.value.openCard.modifiers.length>0&&j===0?i.value.openCard.modifiers.reduce((z,X)=>z+X.max_amount,0):i.value.groupModifiers[j].max_amount}),T=l.computed(()=>{var G;const j=(i.value.addedProducts??[]).reduce((z,X)=>z+X.price,0);if(i.value.openCard){const z=i.value.openCard,X=dr(z)||0,N=z.amount||1;return(i.value.groupModifiersSelected.reduce((H,te)=>(te.modifiers.forEach(q=>{var re,me;q.sizes&&(q.price=((me=(re=q.sizes)==null?void 0:re.find(xe=>xe.id===i.value.selectedSize.id))==null?void 0:me.price)??q.price),H+=q.price*q.amount}),H),0)+X)*N+j}return(G=i.value.addedProducts)!=null&&G.length?j:0}),D=l.computed(()=>{const j=i.value.groupModifiers,G=i.value.groupModifiersSelected;for(let z=0;z<j.length;z++){const X=j[z],N=G[z];if(X.min_amount>0&&S(z)<X.min_amount)return i.value.textErrorRequaired=`В группе "${X.name}" должно содержаться не меньше ${X.min_amount} модификатора(ов)`,{haveRequaire:!0,group:X};for(const Q of X.group_modifiers)if(Q.min_amount>0){const H=N.modifiers.find(te=>te.id===Q.id);if(!H||H.amount<Q.min_amount)return i.value.textErrorRequaired=`В группе "${X.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:X}}}return{haveRequaire:!1,group:j[0]}}),v=()=>{i.value.groupModifiers.forEach((j,G)=>{i.value.groupCurrentOpen={...j,index:G},j.group_modifiers.forEach(z=>{z.default_amount>0&&(z.amount=z.default_amount,ie(z,!0))})})},U=j=>{i.value.addedProducts.push(j)},P=j=>{i.value.openCard=j},O=j=>{_.value=[...j]},B=(j,G)=>{var X,N;const z=j.id!==((X=i.value.groupCurrentOpen)==null?void 0:X.id);i.value.groupCurrentOpen={...j,index:G},z?i.value.isSectionModifier=!0:i.value.isSectionModifier=!i.value.isSectionModifier,(N=i.value.plusButtonsRefs[G])==null||N.scrollIntoView({behavior:"smooth",block:"start"})},$=()=>{i.value.modalCount>i.value.currentModifier.min_amount&&i.value.modalCount>=2&&(i.value.modalCount-=1)},K=()=>{i.value.groupCurrentOpen&&i.value.modalCount+y.value<M.value&&(i.value.currentModifier.max_amount===0||i.value.currentModifier.max_amount>i.value.modalCount)&&(i.value.modalCount+=1)},W=(j,G)=>{var X;const z=(X=i.value.groupCurrentOpen)==null?void 0:X.id.toUpperCase();if(!j&&!i.value.isModifiedAmount&&G.max_amount!==1){if(z==="Добавки2000"&&G.max_amount>1)return!0;if(Math.abs(M.value-y.value)>1&&z!=="Добавки2000")return!0}return!1},ie=(j,G=!1)=>{i.value.modalCount=1,i.value.currentModifier=j;const z=i.value.groupModifiersSelected.findIndex(X=>X.group===i.value.groupCurrentOpen.id);V(z,j,G)},V=(j,G,z)=>{var N,Q;let X=i.value.groupModifiersSelected;if(G.sizes.length>0&&G.sizes.find(H=>{var te;return H.id===((te=i.value.selectedSize)==null?void 0:te.id)}),j===-1)W(z,G)?i.value.isModifiedAmount=!0:X[i.value.groupCurrentOpen.index]={group:i.value.groupCurrentOpen.id,is_fake:((N=i.value.groupCurrentOpen)==null?void 0:N.is_fake)||!1,is_product_determining:((Q=i.value.groupCurrentOpen)==null?void 0:Q.is_product_determining)||!1,modifier_count:0,modifiers:[{...G,amount:(G==null?void 0:G.amount)??1}]};else{const H=i.value.groupModifiers[j].group_modifiers.findIndex(q=>q.id===G.id);if(X[j].modifiers.findIndex(q=>q.id===G.id)===-1){if(M.value===1)X[j].modifiers=[];else if(y.value>=M.value)return;W(z,G)?i.value.isModifiedAmount=!0:(X[j].modifiers.push({...G,amount:(G==null?void 0:G.amount)??1}),X[j].modifier_count=X[j].modifiers.reduce((q,re)=>q+=re.amount,0),i.value.isAnimationFly=!0)}else X[j].modifiers=X[j].modifiers.filter(q=>q.id!==G.id),X[j].modifier_count=X[j].modifiers.reduce((q,re)=>q+=re.amount,0),i.value.groupModifiers[j].group_modifiers[H].amount=1,i.value.groupModifiers[j].group_modifiers[H].default_amount=0,i.value.isAnimationFly=!1}i.value.groupModifiersSelected=X};return{stateCard:i,totalPrice_libCard:T,recountGroupTotalAmount:y,groupTotalAmount:M,isOpenWindow:f,isUpSale:h,checkedRequiredBtn:D,dataUpSale:x,productCards:_,isAddToCard:m,openProduct:p,is_startPage:C,setProduct:O,summModifierAmount:S,setAddedProducts:U,setCurrentCard:P,minusAmount:$,plusAmount:K,toggleNotRequire:B,modifierSelect:ie,defaultAmountModifiers:v,reset:u}});var pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ys(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var $s={exports:{}};(function(o,s){(function(i,u){o.exports=u()})(pr,function(){var i=1e3,u=6e4,f=36e5,h="millisecond",m="second",x="minute",_="hour",p="day",C="week",y="month",S="quarter",M="year",T="date",D="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(X){var N=["th","st","nd","rd"],Q=X%100;return"["+X+(N[(Q-20)%10]||N[Q]||N[0])+"]"}},O=function(X,N,Q){var H=String(X);return!H||H.length>=N?X:""+Array(N+1-H.length).join(Q)+X},B={s:O,z:function(X){var N=-X.utcOffset(),Q=Math.abs(N),H=Math.floor(Q/60),te=Q%60;return(N<=0?"+":"-")+O(H,2,"0")+":"+O(te,2,"0")},m:function X(N,Q){if(N.date()<Q.date())return-X(Q,N);var H=12*(Q.year()-N.year())+(Q.month()-N.month()),te=N.clone().add(H,y),q=Q-te<0,re=N.clone().add(H+(q?-1:1),y);return+(-(H+(Q-te)/(q?te-re:re-te))||0)},a:function(X){return X<0?Math.ceil(X)||0:Math.floor(X)},p:function(X){return{M:y,y:M,w:C,d:p,D:T,h:_,m:x,s:m,ms:h,Q:S}[X]||String(X||"").toLowerCase().replace(/s$/,"")},u:function(X){return X===void 0}},$="en",K={};K[$]=P;var W="$isDayjsObject",ie=function(X){return X instanceof G||!(!X||!X[W])},V=function X(N,Q,H){var te;if(!N)return $;if(typeof N=="string"){var q=N.toLowerCase();K[q]&&(te=q),Q&&(K[q]=Q,te=q);var re=N.split("-");if(!te&&re.length>1)return X(re[0])}else{var me=N.name;K[me]=N,te=me}return!H&&te&&($=te),te||!H&&$},ae=function(X,N){if(ie(X))return X.clone();var Q=typeof N=="object"?N:{};return Q.date=X,Q.args=arguments,new G(Q)},j=B;j.l=V,j.i=ie,j.w=function(X,N){return ae(X,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var G=function(){function X(Q){this.$L=V(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[W]=!0}var N=X.prototype;return N.parse=function(Q){this.$d=function(H){var te=H.date,q=H.utc;if(te===null)return new Date(NaN);if(j.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var re=te.match(v);if(re){var me=re[2]-1||0,xe=(re[7]||"0").substring(0,3);return q?new Date(Date.UTC(re[1],me,re[3]||1,re[4]||0,re[5]||0,re[6]||0,xe)):new Date(re[1],me,re[3]||1,re[4]||0,re[5]||0,re[6]||0,xe)}}return new Date(te)}(Q),this.init()},N.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},N.$utils=function(){return j},N.isValid=function(){return this.$d.toString()!==D},N.isSame=function(Q,H){var te=ae(Q);return this.startOf(H)<=te&&te<=this.endOf(H)},N.isAfter=function(Q,H){return ae(Q)<this.startOf(H)},N.isBefore=function(Q,H){return this.endOf(H)<ae(Q)},N.$g=function(Q,H,te){return j.u(Q)?this[H]:this.set(te,Q)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(Q,H){var te=this,q=!!j.u(H)||H,re=j.p(Q),me=function(Oe,qe){var Qe=j.w(te.$u?Date.UTC(te.$y,qe,Oe):new Date(te.$y,qe,Oe),te);return q?Qe:Qe.endOf(p)},xe=function(Oe,qe){return j.w(te.toDate()[Oe].apply(te.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(qe)),te)},Ie=this.$W,_e=this.$M,Me=this.$D,ge="set"+(this.$u?"UTC":"");switch(re){case M:return q?me(1,0):me(31,11);case y:return q?me(1,_e):me(0,_e+1);case C:var ct=this.$locale().weekStart||0,Ve=(Ie<ct?Ie+7:Ie)-ct;return me(q?Me-Ve:Me+(6-Ve),_e);case p:case T:return xe(ge+"Hours",0);case _:return xe(ge+"Minutes",1);case x:return xe(ge+"Seconds",2);case m:return xe(ge+"Milliseconds",3);default:return this.clone()}},N.endOf=function(Q){return this.startOf(Q,!1)},N.$set=function(Q,H){var te,q=j.p(Q),re="set"+(this.$u?"UTC":""),me=(te={},te[p]=re+"Date",te[T]=re+"Date",te[y]=re+"Month",te[M]=re+"FullYear",te[_]=re+"Hours",te[x]=re+"Minutes",te[m]=re+"Seconds",te[h]=re+"Milliseconds",te)[q],xe=q===p?this.$D+(H-this.$W):H;if(q===y||q===M){var Ie=this.clone().set(T,1);Ie.$d[me](xe),Ie.init(),this.$d=Ie.set(T,Math.min(this.$D,Ie.daysInMonth())).$d}else me&&this.$d[me](xe);return this.init(),this},N.set=function(Q,H){return this.clone().$set(Q,H)},N.get=function(Q){return this[j.p(Q)]()},N.add=function(Q,H){var te,q=this;Q=Number(Q);var re=j.p(H),me=function(_e){var Me=ae(q);return j.w(Me.date(Me.date()+Math.round(_e*Q)),q)};if(re===y)return this.set(y,this.$M+Q);if(re===M)return this.set(M,this.$y+Q);if(re===p)return me(1);if(re===C)return me(7);var xe=(te={},te[x]=u,te[_]=f,te[m]=i,te)[re]||1,Ie=this.$d.getTime()+Q*xe;return j.w(Ie,this)},N.subtract=function(Q,H){return this.add(-1*Q,H)},N.format=function(Q){var H=this,te=this.$locale();if(!this.isValid())return te.invalidDate||D;var q=Q||"YYYY-MM-DDTHH:mm:ssZ",re=j.z(this),me=this.$H,xe=this.$m,Ie=this.$M,_e=te.weekdays,Me=te.months,ge=te.meridiem,ct=function(qe,Qe,Ot,ce){return qe&&(qe[Qe]||qe(H,q))||Ot[Qe].slice(0,ce)},Ve=function(qe){return j.s(me%12||12,qe,"0")},Oe=ge||function(qe,Qe,Ot){var ce=qe<12?"AM":"PM";return Ot?ce.toLowerCase():ce};return q.replace(U,function(qe,Qe){return Qe||function(Ot){switch(Ot){case"YY":return String(H.$y).slice(-2);case"YYYY":return j.s(H.$y,4,"0");case"M":return Ie+1;case"MM":return j.s(Ie+1,2,"0");case"MMM":return ct(te.monthsShort,Ie,Me,3);case"MMMM":return ct(Me,Ie);case"D":return H.$D;case"DD":return j.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return ct(te.weekdaysMin,H.$W,_e,2);case"ddd":return ct(te.weekdaysShort,H.$W,_e,3);case"dddd":return _e[H.$W];case"H":return String(me);case"HH":return j.s(me,2,"0");case"h":return Ve(1);case"hh":return Ve(2);case"a":return Oe(me,xe,!0);case"A":return Oe(me,xe,!1);case"m":return String(xe);case"mm":return j.s(xe,2,"0");case"s":return String(H.$s);case"ss":return j.s(H.$s,2,"0");case"SSS":return j.s(H.$ms,3,"0");case"Z":return re}return null}(qe)||re.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(Q,H,te){var q,re=this,me=j.p(H),xe=ae(Q),Ie=(xe.utcOffset()-this.utcOffset())*u,_e=this-xe,Me=function(){return j.m(re,xe)};switch(me){case M:q=Me()/12;break;case y:q=Me();break;case S:q=Me()/3;break;case C:q=(_e-Ie)/6048e5;break;case p:q=(_e-Ie)/864e5;break;case _:q=_e/f;break;case x:q=_e/u;break;case m:q=_e/i;break;default:q=_e}return te?q:j.a(q)},N.daysInMonth=function(){return this.endOf(y).$D},N.$locale=function(){return K[this.$L]},N.locale=function(Q,H){if(!Q)return this.$L;var te=this.clone(),q=V(Q,H,!0);return q&&(te.$L=q),te},N.clone=function(){return j.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},X}(),z=G.prototype;return ae.prototype=z,[["$ms",h],["$s",m],["$m",x],["$H",_],["$W",p],["$M",y],["$y",M],["$D",T]].forEach(function(X){z[X[1]]=function(N){return this.$g(N,X[0],X[1])}}),ae.extend=function(X,N){return X.$i||(X(N,G,ae),X.$i=!0),ae},ae.locale=V,ae.isDayjs=ie,ae.unix=function(X){return ae(1e3*X)},ae.en=K[$],ae.Ls=K,ae.p={},ae})})($s);var Ou=$s.exports;const Ks=Ys(Ou),Bu=o=>{const s=ke.useRouter(),i=`${o.domain}/api/`,u=nt.create({baseURL:i}),f=nt.create({baseURL:i}),h=nt.create({baseURL:i}),m=nt.create({baseURL:i}),x=nt.create({baseURL:i}),_=nt.create({baseURL:i}),p=nt.create({baseURL:i}),C=P=>{try{const O=JSON.parse(localStorage.getItem("authTokensAccess")||"");O.length>0&&(P.headers.Authorization=`Bearer ${O}`)}catch{console.warn("accessToken is undefined [useAxios]")}return P},y=P=>{const O=localStorage.getItem("apiKey");return P.headers={"Content-Type":"application/json","x-api-key":O},P},S=async P=>{if(!o.user)return P;const O=o.user.exp??0;if(!(Ks.unix(O).diff(Ks())<3e3))return P;const $=ss("authTokensRefresh",null,"string");try{const K=await nt.post(`${i}user/token/refresh/`,{refresh:$.value});if(!K.data.access)return U(),P;localStorage.setItem("authTokensAccess",JSON.stringify(K.data.access)),D(K.data),v(os(K.data.access)),P.headers={...P.headers,Authorization:`Bearer ${K.data.access}`}}catch(K){console.error("Failed to refresh token:",K),U()}return P},M=P=>{P.interceptors.request.use(O=>S(C(O)),O=>Promise.reject(O))};M(h),M(x),M(p);const T=P=>{P.interceptors.request.use(O=>y(O))};T(_),T(f),T(p);const D=(P,O=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(P.access)),O&&localStorage.setItem("authTokensRefresh",JSON.stringify(P.refresh))},v=P=>{o.user=P,localStorage.setItem("user",JSON.stringify(P))},U=()=>{o.user=null,fr(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),s.replace({name:"home"}).then(()=>window.location.reload())};return{axiosInstanceAuthenticationGet:h,axiosInstanceAuthenticationPost:x,axiosInstanceAuthenticationPostApiKey:p,axiosInstancePost:m,axiosInstanceGet:u,axiosInstanceGetApiKey:f,axiosInstancePostApiKey:_}},Qs=(o="themeConfig")=>{try{const s=localStorage.getItem(o);return s?JSON.parse(s):null}catch{return null}},Le=class Le{constructor(){Xe(this,"axiosInstanceGet");Xe(this,"axiosInstancePost");Xe(this,"axiosInstanceAuthenticationGet");Xe(this,"axiosInstanceAuthenticationPost");Xe(this,"axiosInstanceGetApiKey");Xe(this,"axiosInstancePostApiKey");Xe(this,"axiosInstanceAuthenticationPostApiKey");Xe(this,"currentUpsaleController",null);Xe(this,"controller",new AbortController);this.axiosInstanceGet=Le._axiosGet,this.axiosInstancePost=Le._axiosPost,this.axiosInstanceGetApiKey=Le._axiosPostApiKey,this.axiosInstancePostApiKey=Le._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=Le._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=Le._axiosAuthGet,this.axiosInstanceAuthenticationPost=Le._axiosAuthPost}static create(s){return s&&!Le._config&&Le._initialize(s),Le._config||console.warn("InitConnection не инициализирован"),new Le}static _initialize(s,i=null){const u=lt(),f=Rt(),{config_lib:h}=we.storeToRefs(u),{stateCard:m,recountGroupTotalAmount:x}=we.storeToRefs(f);Le._config=s,Le._cardStore=f,Le._stateCard=m,Le._recountGroupTotalAmount=x,h.value=s;const _=Bu(s);Le._axiosPostApiKey=_.axiosInstanceGetApiKey,Le._axiosPostApiKey=_.axiosInstancePostApiKey,Le._axiosAuthPostApiKey=_.axiosInstanceAuthenticationPostApiKey,Le._axiosGet=_.axiosInstanceGet,Le._axiosPost=_.axiosInstancePost,Le._axiosAuthGet=_.axiosInstanceAuthenticationGet,Le._axiosAuthPost=_.axiosInstanceAuthenticationPost}get config(){return Le._config}get cardStore(){return Le._cardStore}get stateCard(){return Le._stateCard}get recountGroupTotalAmount(){return Le._recountGroupTotalAmount}async updateTheme(){var h,m;const s=Qs(),i=It();if(s!==null){i.updateColor(s);return}const u=lt(),f=await((m=this.axiosInstanceGet)==null?void 0:m.get(`org/organizations/${(h=this.config)==null?void 0:h.orgId}/design/`));u.setStateDrum(f==null?void 0:f.data.hide_barban),u.setKioskTimeout(f==null?void 0:f.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(f.data)),i.updateColor(f.data)}async getGroupByID(s){var i,u;try{const f=await((u=this.axiosInstanceGet)==null?void 0:u.get(`${(i=this.config)==null?void 0:i.pointId}/group/${s}`));return f==null?void 0:f.data}catch(f){throw console.error("Ошибка в request.ts[getGroupByID]",f),f}}async loadGroupProducts(s){var i,u;try{const f=await((u=this.axiosInstanceGet)==null?void 0:u.get(`${(i=this.config)==null?void 0:i.pointId}/products/?group=${s}`)),h=(f==null?void 0:f.data)||[];for(const m of h)m&&await El(m);return await this.cacheImagesInBackground(h),h}catch(f){return console.error("Ошибка загрузки группы:",f),[]}}async getGroup(){var s,i;try{const u=await((i=this.axiosInstanceGet)==null?void 0:i.get(`${(s=this.config)==null?void 0:s.pointId}/groups/`));return u==null?void 0:u.data}catch(u){return console.error("Error fetching products:",u),[]}}async fetchAndCacheAllPages(){var s,i;try{const u=((s=this.config)==null?void 0:s.pointId)||"",f=await Hi(u);if(f)return f.data;const h=await((i=this.axiosInstanceGet)==null?void 0:i.get(`${u}/group/`)),m=(h==null?void 0:h.data)||[],x=[];for(const _ of m){_.products=_.products||[],await Rr(_.id,_),x.push(_);const p=await this.loadGroupProducts(_.id);_.products=p}return await this.cacheImagesInBackground(m),await Rr(u,m),x}catch(u){return console.error("fetchAndCacheAllPages error:",u),[]}}cacheImagesInBackground(s){s.forEach(i=>{var u;i.video_link&&this.loadAndCacheMedia(i.video_link,i.id+"_video"),i.image_link&&this.loadAndCacheMedia(i.image_link,i.id+"_image"),(u=i.products)==null||u.forEach(f=>{f.video_link&&this.loadAndCacheMedia(f.video_link,f.id+"_video"),f.image_link&&this.loadAndCacheMedia(f.image_link,f.id+"_image")})})}async loadAndCacheMedia(s,i){const u=await ur(i);if(u){this.dispatchImageCachedEvent(i,u);return}try{const f=await fetch(s);if(!f.ok)throw new Error("Network error");const h=await f.blob();if(h.size===0)throw new Error("Empty blob");await Gi(i,h),this.dispatchImageCachedEvent(i,h)}catch(f){console.warn(`[ImageCache] Failed for ${i}:`,f)}}dispatchImageCachedEvent(s,i){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:s,blob:i}}))}async getProduct(s=null){var i,u;if(!s)return[];try{const f=await((u=this.axiosInstanceGet)==null?void 0:u.get(`${(i=this.config)==null?void 0:i.pointId}/products/${s}`));return f==null?void 0:f.data}catch(f){return console.error("Error fetching cardProducts:",f),[]}}async getSingleProduct(s){var f;const i=lt(),{config_lib:u}=we.storeToRefs(i);try{let h=await $o(s);if(h)this._fullCardProduct(h);else{const m=await((f=this.axiosInstanceGet)==null?void 0:f.get(`${u.value.pointId}/products/${s}`));(m==null?void 0:m.status)===200&&this._fullCardProduct(m.data)}}catch(h){throw console.warn("store card[getFetchProducts]:",h),h}}_fullCardProduct(s){const i=Rt();i.stateCard.openCard={...s,amount:1},i.stateCard.groupModifiers=s.group_modifiers,s.modifiers.length>0&&i.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:s.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:s.modifiers.reduce((u,f)=>u+=f.min_amount,0),name:"Добавки",required:!1}),i.stateCard.groupModifiersSelected=new Array(i.stateCard.groupModifiers.length).fill({group:"",modifiers:[],is_fake:!1,is_product_determining:!1,modifier_count:0}),i.stateCard.productSizes=s.sizes,i.defaultAmountModifiers(),s.show_recommendations&&this.productUpsale(s.id)}async getTheme(){try{this.updateTheme()}catch(s){return console.error("Error fetching products:",s),[]}}async authorizeByCard(s){var i,u;try{const f=await((u=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:u.post(`${(i=this.config)==null?void 0:i.domain}/api/user/validate-card/`,{card_number:s}));return localStorage.setItem("authTokensAccess",JSON.stringify(f==null?void 0:f.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(f==null?void 0:f.data.refresh)),f==null?void 0:f.data}catch(f){throw console.error("Ошибка авторизации:",f),f}}async getLoyalSmsCode(s){var i,u;try{const f=await((u=this.axiosInstancePostApiKey)==null?void 0:u.post(`${(i=this.config)==null?void 0:i.domain}/api/device/auth/request-otp/`,{phone:s}));return f==null?void 0:f.data}catch(f){throw console.error("Ошибка получения sms-code:",f),f}}async sendSmsCodeForAuth(s,i){var u,f;try{const h=await((f=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:f.post(`${(u=this.config)==null?void 0:u.domain}/api/device/auth/`,{code:s,phone:i}));return h==null?void 0:h.data}catch(h){throw console.error("Ошибка отправки sms-code:",h),h}}async callStaff(s,i,u){var f,h,m,x;try{const _=await((m=this.axiosInstancePost)==null?void 0:m.post(`${(f=this.config)==null?void 0:f.domain}/api/org_unit/${(h=this.config)==null?void 0:h.pointId}/table/${s}/call-staff/`,{...i},u));return(x=_==null?void 0:_.data)==null?void 0:x.response_text}catch(_){throw console.error("Ошибка[callStaff]",_),_}}async createOrder(s,i,u=!0,f,h=!1,m=!1,x){var D,v,U,P,O;const _=St(),p=h?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,C=u?p:this.axiosInstanceAuthenticationPost,y=u?"/device/order/create":"/order/create",S=u?(D=this.config)==null?void 0:D.pointId:(v=this.config)==null?void 0:v.pointId,M={items:s,table:i||null,comment:f};return u&&((U=_.selectedOrderType)!=null&&U.id)&&(M.order_type_id=(P=_.selectedOrderType)==null?void 0:P.id),await(C==null?void 0:C.post(`${(O=this.config)==null?void 0:O.domain}/api/org_unit/${S}${y}`,M,{signal:x}))}async initPaymentLink(s,i){const u=this.axiosInstanceAuthenticationPost,f=lt(),h=await(u==null?void 0:u.post("payment/init",{by_bonuses:f.countBonus,order:s,provider_type:i}));return h==null?void 0:h.data}async orderPay(s){var i;return(i=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:i.post(`order/${s}/pay/`,{order_id:s})}async getProfile(){var i,u;const s=await((u=this.axiosInstanceAuthenticationGet)==null?void 0:u.get(`user/current?organization=${(i=this.config)==null?void 0:i.orgId}`));if((s==null?void 0:s.status)===200){const f=lt();return f.profile=s.data,f.is18Allowed=sessionStorage.getItem("is_adult")==="true",s.data}else return s}async joinLoyalty(){var i;const s=await((i=this.axiosInstanceAuthenticationGet)==null?void 0:i.post("user/join-loyalty/"));return{success:(s==null?void 0:s.status)===200}}async isPhoneExist(s,i={}){var u,f;try{const h=await((f=this.axiosInstanceGet)==null?void 0:f.get("user/check-phone",{...i,params:{organization:(u=this.config)==null?void 0:u.orgId,phone:s}}));return(h==null?void 0:h.status)===200}catch{return!1}}async sendOTP(s,i={}){var f,h;const u=await((h=this.axiosInstancePost)==null?void 0:h.post("user/check-phone",{organization:(f=this.config)==null?void 0:f.orgId,phone:s},i));return u==null?void 0:u.data}async auth(s,i={}){var f,h;return await((h=this.axiosInstancePost)==null?void 0:h.post("user/auth",{organization:(f=this.config)==null?void 0:f.orgId,...s},i))}async signup(s,i={}){var f,h;return await((h=this.axiosInstancePost)==null?void 0:h.post("user/register",{organization:(f=this.config)==null?void 0:f.orgId,...s},i))}async calculateDiscount(s,i=!0,u=!1,f){var p,C;const h=u?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,m=i?h:this.axiosInstanceAuthenticationPost,x=i?(p=this.config)==null?void 0:p.pointId:(C=this.config)==null?void 0:C.pointId,_=await(m==null?void 0:m.post(`/org_unit/${x}/cart/calculate-discount/`,s,{signal:f}));return(_==null?void 0:_.status)===200?_.data:_}async maxPayByBonuses(s,i=!0,u=!1,f){const h=lt(),m=u?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,x=i?m:this.axiosInstanceAuthenticationPost,_=await(x==null?void 0:x.post("/cart/max-pay-by-bonuses/",{total_cart_price:s},{signal:f})),p=_==null?void 0:_.data;return h.profile&&p&&"balance"in p&&(h.profile.balance=p.balance),p}async getDeviceInfo(){var u;const s=St(),i=await((u=this.axiosInstanceGetApiKey)==null?void 0:u.get("/device/current/"));return(i==null?void 0:i.status)===200?(s.orderTypes=i.data.order_types,s.providerTypes=i.data.payment_provider_type,i.data):i}async validateApiKey(s,i){var f,h;const u=await((h=this.axiosInstancePost)==null?void 0:h.post(`/device/org_unit/${(f=this.config)==null?void 0:f.pointId}/validate-api-key/`,{api_key:s},i));return(u==null?void 0:u.status)===200}async productUpsale(s){var h,m,x;const i=Rt(),{dataUpSale:u}=we.storeToRefs(i);(h=this.currentUpsaleController)==null||h.abort();const f=new AbortController;this.currentUpsaleController=f;try{const _=await((x=this.axiosInstanceGet)==null?void 0:x.get(`/${(m=this.config)==null?void 0:m.pointId}/products/${s}/recommendation/`,{signal:f.signal}));f.signal.aborted||(u.value=_==null?void 0:_.data)}catch(_){if(_.name==="AbortError"||_.name==="CanceledError"){console.warn("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",_),_}finally{this.currentUpsaleController===f&&(this.currentUpsaleController=null)}}};Xe(Le,"_config",null),Xe(Le,"_axiosGet"),Xe(Le,"_axiosGetApiKey"),Xe(Le,"_axiosPostApiKey"),Xe(Le,"_axiosAuthPostApiKey"),Xe(Le,"_axiosPost"),Xe(Le,"_axiosAuthGet"),Xe(Le,"_axiosAuthPost"),Xe(Le,"_cardStore",null),Xe(Le,"_stateCard",null),Xe(Le,"_recountGroupTotalAmount",null);let En=Le;const Js=l.ref(!1),ea=l.ref(window.innerWidth),Nn=()=>{const o=l.computed({get:()=>Js.value,set:f=>{Js.value=f}}),s=l.computed(()=>o.value&&ea.value>1024),i=()=>ea.value=window.innerWidth;return l.onMounted(()=>{window.addEventListener("resize",i)}),l.onUnmounted(()=>{window.removeEventListener("resize",i)}),{isDesktop:o,shouldUseDragScroll:s,syncWithRoute:f=>{o.value=f.query.mode==="pdf"}}},Mu=l.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(o,{expose:s}){const i=o,u=lt(),f=l.ref(null),{isDesktop:h}=Nn(),m=async _=>{if(!f.value||!_)return;let p=window;i.container&&(p=typeof i.container=="string"?document.querySelector(i.container)||window:i.container);const C={behavior:i.behavior};if(i.axis==="x"){const y=p===window?window.innerWidth:p.clientWidth,S=_.offsetWidth;let M=_.offsetLeft;if(p!==window){const T=p.getBoundingClientRect();M=_.getBoundingClientRect().left-T.left+p.scrollLeft}M-=(y-S)/2,C.left=Math.max(0,M)}else{const y=p===window?window.innerHeight:p.clientHeight,S=_.offsetHeight;let M=_.offsetTop;if(p!==window){const T=p.getBoundingClientRect();M=_.getBoundingClientRect().top-T.top+p.scrollTop}M-=(y-S)/2,C.top=Math.max(0,M)}try{p===window?window.scrollTo(C):p.scrollTo(C)}catch(y){console.error("Scroll error:",y)}};l.onMounted(async()=>{if(i.autoScroll){let _=null;if(await l.nextTick(),u.activeScrolling_lib){const p=u.activeScrolling_lib.findIndex(C=>C.id===i.idActive);i.idActive?(_=document.getElementById(`scrolling${i.idActive}`),_&&p!==-1&&(u.activeScrolling_lib[p]=_)):u.activeScrolling_lib[p]&&(_=u.activeScrolling_lib[p]),m(_)}}});const x=async _=>{i.clearContainer&&(u.activeScrolling_lib=[]);const p=_.currentTarget;await l.nextTick(),u.activeScrolling_lib.includes(p)||u.activeScrolling_lib.push(p),m(p)};return s({scrollToElement:m}),(_,p)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"wrapperRef",ref:f,class:l.normalizeClass(["scroll-to-wrapper",{scroll_pdf:l.unref(h)}])},[l.renderSlot(_.$slots,"default",{handleTargetClick:x},void 0,!0)],2))}}),ze=(o,s)=>{const i=o.__vccOpts||o;for(const[u,f]of s)i[u]=f;return i},oo=ze(Mu,[["__scopeId","data-v-e47a167d"]]),Vr={mounted(o){let s=!1,i,u,f,h,m,x=0,_=0,p=0,C=0,y=0,S=!1;const M=5;o.style.cursor="grab";const T=U=>{U.button===0&&(m&&(cancelAnimationFrame(m),m=0),s=!0,S=!1,i=U.pageX-o.offsetLeft,u=U.pageY-o.offsetTop,f=o.scrollLeft,h=o.scrollTop,p=U.pageX,C=U.pageY,y=Date.now(),x=0,_=0)},D=U=>{if(!s)return;const P=U.pageX,O=U.pageY,B=Math.abs(P-p),$=Math.abs(O-C);if(!S&&(B>M||$>M)&&(S=!0,o.style.pointerEvents="none"),S){U.stopPropagation(),U.preventDefault();const K=Date.now(),W=K-y;W>0&&(x=(P-p)/W*16,_=(O-C)/W*16),p=P,C=O,y=K;const ie=P-o.offsetLeft,V=O-o.offsetTop,ae=ie-i,j=V-u;o.scrollLeft=f-ae,o.scrollTop=h-j}else p=P,C=O,y=Date.now()},v=U=>{if(s){if(S){if(U.stopPropagation(),U.preventDefault(),o.style.pointerEvents="",Math.abs(x)>.1||Math.abs(_)>.1){const P=()=>{o.scrollLeft-=x,o.scrollTop-=_,x*=.95,_*=.95,Math.abs(x)>.1||Math.abs(_)>.1?m=requestAnimationFrame(P):m=0};m=requestAnimationFrame(P)}}else o.style.pointerEvents="";s=!1,S=!1}};o.addEventListener("mousedown",T),window.addEventListener("mousemove",D),window.addEventListener("mouseup",v),o._dragScrollCleanup=()=>{m&&cancelAnimationFrame(m),o.removeEventListener("mousedown",T),window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",v),o.style.pointerEvents=""}},unmounted(o){o._dragScrollCleanup&&o._dragScrollCleanup()}},vu={},Du={id:"custom_svg_lib",width:"26.000000",height:"26.000000",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Pu(o,s){return l.openBlock(),l.createElementBlock("svg",Du,[...s[0]||(s[0]=[l.createElementVNode("defs",null,null,-1),l.createElementVNode("path",{id:"custom_svg_color",d:"M11.83 26L11.83 14.15L0 14.15L0 11.84L11.83 11.84L11.83 0L14.15 0L14.15 11.84L26 11.84L26 14.15L14.15 14.15L14.15 26L11.83 26Z",fill:"#FF6D2E","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const so=ze(vu,[["render",Pu]]),Lu=["id","onClick"],Fu={class:"modified_plus_btn"},Vu=["src"],Uu={key:2,class:"wrapper_modifier_item"},zu={key:0,class:"modifier_item_n_wrapper"},Hu=["src"],Gu={key:1,class:"modifier_plus_item"},Wu=["src"],Xu=["src"],ta=ze(l.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(o){const s=Rt(),i=It(),{stateCard:u}=we.storeToRefs(s),{itemThemes:f}=we.storeToRefs(i),{shouldUseDragScroll:h}=Nn(),m=l.ref([]),x=l.ref([]),_=l.ref(null),p=l.ref(null),C=S=>{S instanceof HTMLElement&&!m.value.includes(S)&&m.value.push(S)},y=S=>{p.value=S};return l.onMounted(async()=>{await l.nextTick(),u.value.plusButtonsRefs=m.value}),l.watchEffect(()=>{x.value=u.value.groupModifiersSelected,document.body.style.overflow=""}),l.onBeforeUnmount(()=>{m.value=[],u.value.plusButtonsRefs=[]}),(S,M)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({card_modified_wrapper_many:l.unref(u).groupModifiers.length>=5})},[l.unref(u).groupModifiersSelected?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["card_modified_wrapper",[l.unref(u).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:_},[l.createVNode(oo,{axis:"x",behavior:"smooth",container:_.value,autoScroll:!0,idActive:p.value,clearContainer:!0},{default:l.withCtx(({handleTargetClick:T})=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(u).groupModifiers,(D,v)=>{var U,P;return l.openBlock(),l.createElementBlock("div",{class:"button_modified",key:D.id,ref_for:!0,ref:C,id:"scrolling"+D.id,"data-clickable":"true",onClick:O=>{o.toggleNotRequire&&o.toggleNotRequire(D,v),y(D.id),T(O)}},[l.createElementVNode("div",Fu,[x.value[v].modifiers.length===0?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass([{modified_plus_btn_active:D.id===((U=l.unref(u).groupCurrentOpen)==null?void 0:U.id)&&o.isSectionModifier},"modified_plus_active"])},[l.createVNode(so,{"aria-label":`Открыть группу модификаторов ${D.name}`},null,8,["aria-label"])],2)):x.value[v].modifiers.length===1?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:D.id===((P=l.unref(u).groupCurrentOpen)==null?void 0:P.id)&&o.isSectionModifier}])},[l.createElementVNode("img",{src:x.value[v].modifiers[0].image_link||l.unref(f).fallback_image||"",alt:"Модификатор"},null,8,Vu)],2)):(l.openBlock(),l.createElementBlock("div",Uu,[x.value[v].modifiers.length>2?(l.openBlock(),l.createElementBlock("div",zu,[x.value[v].modifiers.length===3?(l.openBlock(),l.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:x.value[v].modifiers[2].image_link||l.unref(f).fallback_image||""},null,8,Hu)):(l.openBlock(),l.createElementBlock("p",Gu," + "+l.toDisplayString(x.value[v].modifiers.length-2),1))])):l.createCommentVNode("",!0),l.createElementVNode("div",null,[x.value[v].modifiers.length>0?(l.openBlock(),l.createElementBlock("img",{key:0,src:x.value[v].modifiers[0].image_link||l.unref(f).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,Wu)):l.createCommentVNode("",!0),x.value[v].modifiers.length>1?(l.openBlock(),l.createElementBlock("img",{key:1,src:x.value[v].modifiers[1].image_link||l.unref(f).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,Xu)):l.createCommentVNode("",!0)])]))]),l.createElementVNode("p",null,l.toDisplayString(D.name),1)],8,Lu)}),128))]),_:1},8,["container","idActive"])],2)),[[l.unref(Vr),l.unref(h)?{}:!1]]):l.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-c850b1ab"]]),ju={},qu={id:"custom_svg_lib",width:"21.847656",height:"21.846924",viewBox:"0 0 21.8477 21.8469",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Zu(o,s){return l.openBlock(),l.createElementBlock("svg",qu,[...s[0]||(s[0]=[l.createElementVNode("desc",null," Created with Pixso. ",-1),l.createElementVNode("defs",null,null,-1),l.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),l.createElementVNode("path",{id:"Vector",d:"M12.38 15.9L12.89 15.39C12.96 15.33 13 15.25 13 15.16C13 15.08 12.96 15 12.89 14.93L8.84 11L12.89 7.06C12.96 6.99 13 6.91 13 6.83C13 6.74 12.96 6.66 12.89 6.6L12.38 6.1C12.31 6.03 12.23 6 12.14 6C12.05 6 11.97 6.03 11.9 6.1L7.1 10.76C7.03 10.83 7 10.91 7 11C7 11.08 7.03 11.16 7.1 11.23L11.9 15.9C11.97 15.96 12.05 16 12.14 16C12.23 16 12.31 15.96 12.38 15.9Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const Ur=ze(ju,[["render",Zu]]),zr={mounted(o){o.muted=!0,o.setAttribute("muted","")}},Yu={class:"wrapper_modifiers"},$u={class:"wrapper_nutritional_value"},Ku={class:"nutritional_scheme"},Qu={key:0,class:"nutritional_parameters"},Ju={key:1,class:"nutritional_parameters"},ed={key:2,class:"nutritional_parameters"},td={key:3,class:"nutritional_parameters"},nd={ref:"modifierBody",class:"modifier_shadow"},rd={class:"wrapper_modifiers_title"},id={class:"wrapper_text_count_modifiers"},od=["id","aria-label","onClick","onKeydown"],sd={key:0,class:"counter_modifier"},ad={class:"hide_image_corners"},ld=["src","alt"],cd={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},ud=["src"],dd={class:"modifier_title"},fd=ze(l.defineComponent({__name:"SectionModifiers",emits:["close"],setup(o,{emit:s}){const i=s,u=It(),f=Rt(),{itemThemes:h}=we.storeToRefs(u),{stateCard:m,recountGroupTotalAmount:x,groupTotalAmount:_}=we.storeToRefs(f),{isDesktop:p,shouldUseDragScroll:C}=Nn(),y=l.ref(null),S=Xt.useTemplateRefsList(),M=T=>{if(!T)return;const D=m.value.groupModifiers.findIndex(B=>B.id===m.value.groupCurrentOpen.id),v=m.value.plusButtonsRefs[D]||m.value.plusButtonsRefs[0];if(!v)return;const U=T.getBoundingClientRect(),P=v.getBoundingClientRect(),O=T.cloneNode(!0);O.classList.add("flyer"),Object.assign(O.style,{width:`${U.width}px`,height:`${U.height}px`,left:`${U.left}px`,top:`${U.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(O),y.value=O,requestAnimationFrame(()=>{const B=P.left+P.width/3-(U.left+U.width/2),$=P.top+P.height/4-(U.top+U.height/2),K=P.width/U.width*.2;O.style.transform=`translate(${B}px, ${$}px) scale(${K})`,O.style.opacity="0.4",O.style.transition="transform 0.5s ease, opacity 0.5s ease"}),O.addEventListener("transitionend",()=>{O.remove(),y.value=null,v.classList.add("bump"),setTimeout(()=>v.classList.remove("bump"),300)},{once:!0})};return l.watch(()=>m.value.isAnimationFly,T=>{T===!0&&m.value.currentModifier&&(M(S.value.find(D=>D.id===m.value.currentModifier.id)),m.value.isAnimationFly=!1)}),(T,D)=>{var v,U,P,O,B,$,K,W,ie,V,ae,j,G;return l.openBlock(),l.createElementBlock("div",Yu,[l.createElementVNode("div",$u,[l.createElementVNode("div",{class:l.normalizeClass(["card_header_inner_back",[(v=l.unref(m).openCard)!=null&&v.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:D[0]||(D[0]=z=>i("close"))},[l.createVNode(Ur,{class:"arrow_bottom"})],2),l.createElementVNode("div",Ku,[(U=l.unref(m).openCard)!=null&&U.energy_amount?(l.openBlock(),l.createElementBlock("div",Qu,[l.createElementVNode("b",null,l.toDisplayString((P=l.unref(m).openCard)==null?void 0:P.energy_amount),1),D[1]||(D[1]=l.createElementVNode("p",null,"Килокалории",-1))])):l.createCommentVNode("",!0),(O=l.unref(m).openCard)!=null&&O.proteins_amount?(l.openBlock(),l.createElementBlock("div",Ju,[l.createElementVNode("b",null,l.toDisplayString((B=l.unref(m).openCard)==null?void 0:B.proteins_amount),1),D[2]||(D[2]=l.createElementVNode("p",null,"Белки",-1))])):l.createCommentVNode("",!0),($=l.unref(m).openCard)!=null&&$.fat_amount?(l.openBlock(),l.createElementBlock("div",ed,[l.createElementVNode("b",null,l.toDisplayString((K=l.unref(m).openCard)==null?void 0:K.fat_amount),1),D[3]||(D[3]=l.createElementVNode("p",null,"Жиры",-1))])):l.createCommentVNode("",!0),(W=l.unref(m).openCard)!=null&&W.carbohydrates_amount?(l.openBlock(),l.createElementBlock("div",td,[l.createElementVNode("b",null,l.toDisplayString((ie=l.unref(m).openCard)==null?void 0:ie.carbohydrates_amount),1),D[4]||(D[4]=l.createElementVNode("p",null,"Углеводы",-1))])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",nd,[l.createElementVNode("p",rd,l.toDisplayString((V=l.unref(m).groupCurrentOpen)==null?void 0:V.name),1),l.createElementVNode("p",id,"Выбрано "+l.toDisplayString(l.unref(x))+" из "+l.toDisplayString(l.unref(_)),1),l.withDirectives((l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass((ae=l.unref(m).groupModifiers.find(z=>{var X;return z.id===((X=l.unref(m).groupCurrentOpen)==null?void 0:X.id)}))!=null&&ae.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(((j=l.unref(m).groupCurrentOpen)==null?void 0:j.group_modifiers)||[],z=>{var X,N,Q;return l.openBlock(),l.createElementBlock("div",{key:z.id,ref_for:!0,ref:l.unref(S).set,id:z.id,style:l.normalizeStyle({pointerEvents:l.unref(p)?"none":"auto"}),class:l.normalizeClass(["modifier_card",{hidden_modifier_card:z.default_amount===0&&((X=l.unref(m).groupCurrentOpen)==null?void 0:X.id)==="Добавки2000"&&z.min_amount===0&&z.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${z.name}`,onClick:H=>l.unref(f).modifierSelect(z),onKeydown:l.withKeys(H=>l.unref(f).modifierSelect(z),["enter"])},[l.createElementVNode("div",{class:l.normalizeClass([{modifier_card_active:l.unref(m).groupModifiersSelected.some(H=>{var te;return H.group===((te=l.unref(m).groupCurrentOpen)==null?void 0:te.id)&&H.modifiers.some(q=>q.id===z.id)})},"wrapper_image_corners"])},[z.amount>1?(l.openBlock(),l.createElementBlock("div",sd,l.toDisplayString(z.amount),1)):l.createCommentVNode("",!0),l.createElementVNode("div",ad,[z.video_link?l.withDirectives((l.openBlock(),l.createElementBlock("video",cd,[l.createElementVNode("source",{src:z.video_link||"",type:"video/webm"},null,8,ud)])),[[l.unref(zr)]]):(l.openBlock(),l.createElementBlock("img",{key:0,class:"modifier_image",src:z.image_link||l.unref(h).fallback_image||"",alt:z.name},null,8,ld)),l.createElementVNode("div",{class:l.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:z.min_amount>0||z.required}])},[l.createElementVNode("h3",dd,l.toDisplayString(z.name),1),l.createElementVNode("p",null,"+"+l.toDisplayString(((Q=(N=z.sizes)==null?void 0:N.find(H=>H.id===l.unref(m).selectedSize.id))==null?void 0:Q.price)||z.price||0)+"₽",1)],2)])],2)],46,od)}),128))],2)),[[l.unref(Vr),(G=l.unref(m).groupModifiers.find(z=>{var X;return z.id===((X=l.unref(m).groupCurrentOpen)==null?void 0:X.id)}))!=null&&G.group_modifiers.length?{}:!1]])],512)])}}}),[["__scopeId","data-v-2ce24a7a"]]),hd={key:0,class:"card_size_place"},gd=["onClick","onKeydown","aria-label"],md={key:1,class:"card_size static"},pd=["onClick","onKeydown","aria-label"],ao=3,xd=ze(l.defineComponent({__name:"SizeModifier",setup(o){const s=Rt(),{stateCard:i}=we.storeToRefs(s),u=l.ref(null),{isDesktop:f}=Nn(),h=l.ref(50),m=l.ref(),x=l.ref(0),_=l.ref(0),p=l.ref(null),C=l.computed(()=>{var B;if(i.value.productSizes.length<=3)return i.value.productSizes[m.value.index]||i.value.productSizes[0];const P=x.value+1,O=((B=S.value[P])==null?void 0:B.originalIndex)??1;return i.value.productSizes[O]}),y=()=>{p.value&&i.value.productSizes.length>=3&&(_.value=p.value.offsetWidth/ao)},S=l.computed(()=>{if(i.value.productSizes.length<=3)return i.value.productSizes;const P=i.value.productSizes;return[...P.map((O,B)=>({...O,originalIndex:B})),...P.map((O,B)=>({...O,originalIndex:B})),...P.map((O,B)=>({...O,originalIndex:B}))]}),M=(P,O)=>{if(m.value={id:P.id,title:P.name,index:O,is_default:P.is_default},P.price!==null&&i.value.openCard&&(i.value.openCard={...i.value.openCard,price:P.price}),i.value.selectedSize=P,i.value.productSizes.length>3){y();const B=x.value+1;O<B?T():O>B&&D()}else{const B=i.value.productSizes.length,$=(O+.5)*(100/B);h.value=$}},T=()=>{var P;if(!(i.value.productSizes.length<=3)){if(x.value--,x.value<i.value.productSizes.length-ao+1){x.value+=i.value.productSizes.length;const O=(P=p.value)==null?void 0:P.querySelector(".card_size");O&&(O.style.transition="none",O.style.transform=`translateX(-${x.value*_.value}px)`,O.offsetHeight,O.style.transition="transform 0.2s ease-in-out")}v()}},D=()=>{var P;if(!(i.value.productSizes.length<=3)){if(x.value++,x.value>=i.value.productSizes.length*2){x.value-=i.value.productSizes.length;const O=(P=p.value)==null?void 0:P.querySelector(".card_size");O&&(O.style.transition="none",O.style.transform=`translateX(-${x.value*_.value}px)`,O.offsetHeight,O.style.transition="transform 0.2s ease-in-out")}v()}},v=()=>{var $;if(i.value.productSizes.length<=3)return;const P=x.value+1,O=(($=S.value[P])==null?void 0:$.originalIndex)??0,B=i.value.productSizes[O];m.value={id:B.id,title:B.name,index:O,is_default:B.is_default}};l.watch(()=>[i.value.productSizes,p.value],([P=[],O])=>{if(Array.isArray(P)&&P.length>0&&O!==null){let B=P.findIndex($=>$.is_default===!0);P.length<3&&u.value&&parseInt(u.value.style.minWidth)<767&&(u.value.style.width="100px"),B>-1?(x.value=B,M(P[B],B),_.value=120/ao):P.length===2||P.length===1?(M(P[0],0),h.value=(0+.5)*(100/2)):(M(P[1],1),h.value=(1+.5)*(100/3))}}),l.watch(()=>{var P;return[(P=i.value.selectedSize)==null?void 0:P.id,i.value.groupModifiersSelected]},([P,O])=>{if(!P||!Array.isArray(O))return;const B=O.map($=>({...$,modifiers:$.modifiers.map(K=>{if(!K.sizes||K.sizes.length===0)return K;const W=K.sizes.find(ie=>ie.id===P);return W?{...K,size:W,price:W.price??K.price}:K})}));JSON.stringify(B)!==JSON.stringify(i.value.groupModifiersSelected)&&(i.value.groupModifiersSelected=B)},{deep:!0});const U={mounted:y};return l.onBeforeUnmount(()=>{window.removeEventListener("resize",y)}),(P,O)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:u},[l.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:p},[l.unref(i).productSizes.length>1&&m.value?(l.openBlock(),l.createElementBlock("div",hd,[l.unref(i).productSizes.length>3?(l.openBlock(),l.createElementBlock("ul",{key:0,class:"card_size",style:l.normalizeStyle({transform:`translateX(-${x.value*_.value}px)`})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,(B,$)=>(l.openBlock(),l.createElementBlock("li",{key:`${B.id}-${$}`,onClick:K=>M(B,$),onKeydown:l.withKeys(K=>M(B,$),["enter"]),class:l.normalizeClass({active:m.value.id===B.id&&m.value.index===B.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${B.name}`},l.toDisplayString(B.alt_name?B.alt_name:B.name),43,gd))),128))],4)):(l.openBlock(),l.createElementBlock("ul",md,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(i).productSizes,(B,$)=>(l.openBlock(),l.createElementBlock("li",{key:`${B.id}-${$}`,onClick:K=>M(B,$),onKeydown:l.withKeys(K=>M(B,$),["enter"]),class:l.normalizeClass({active:m.value.id===B.id&&m.value.index===$}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${B.name}`},l.toDisplayString(B.alt_name?B.alt_name:B.name),43,pd))),128))])),C.value?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:2,class:"size_active",style:l.normalizeStyle(l.unref(i).productSizes.length<=3?{left:`${h.value}%`}:{})},[l.createElementVNode("p",null,l.toDisplayString(C.value.alt_name?C.value.alt_name:C.value.name),1)],4)),[[U]]):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],512)],512)),[[l.vShow,l.unref(i).productSizes.length>1&&m.value]])}}),[["__scopeId","data-v-2fab37e4"]]),wd="data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.3063%2019.7525C8.12104%2019.7525%208.78152%2019.1097%208.78152%2018.3167C8.78152%2017.5236%208.12104%2016.8808%207.3063%2016.8808C6.49156%2016.8808%205.83108%2017.5236%205.83108%2018.3167C5.83108%2019.1097%206.49156%2019.7525%207.3063%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M7.3063%2019.2525C7.83733%2019.2525%208.26782%2018.8335%208.26782%2018.3167C8.26782%2017.7998%207.83733%2017.3808%207.3063%2017.3808C6.77526%2017.3808%206.34478%2017.7998%206.34478%2018.3167C6.34478%2018.8335%206.77526%2019.2525%207.3063%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M14.4716%2019.7525C15.2864%2019.7525%2015.9469%2019.1097%2015.9469%2018.3167C15.9469%2017.5236%2015.2864%2016.8808%2014.4716%2016.8808C13.6569%2016.8808%2012.9964%2017.5236%2012.9964%2018.3167C12.9964%2019.1097%2013.6569%2019.7525%2014.4716%2019.7525Z'%20fill='%23808080'/%3e%3cpath%20d='M14.4716%2019.2525C15.0027%2019.2525%2015.4332%2018.8335%2015.4332%2018.3167C15.4332%2017.7998%2015.0027%2017.3808%2014.4716%2017.3808C13.9406%2017.3808%2013.5101%2017.7998%2013.5101%2018.3167C13.5101%2018.8335%2013.9406%2019.2525%2014.4716%2019.2525Z'%20stroke='%23F2F7FF'%20stroke-width='0.999998'/%3e%3cpath%20d='M0.770536%203.75L4.56158%206.21L6.66771%2015.23H15.1025L17.2086%208.26'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.19507%2011.95H12.2669H15.945'%20stroke='%23F2F7FF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.1908%200.830648V7.34648L8.26615%204.49981C8.03242%204.27231%207.64886%204.27231%207.41513%204.49981C7.35957%204.55378%207.3155%204.61788%207.28542%204.68845C7.25535%204.75902%207.23987%204.83467%207.23987%204.91106C7.23987%204.98746%207.25535%205.06311%207.28542%205.13368C7.3155%205.20425%207.35957%205.26835%207.41513%205.32231L11.3646%209.16648C11.5983%209.39398%2011.9759%209.39398%2012.2096%209.16648L16.159%205.32231C16.2145%205.26831%2016.2585%205.20419%2016.2885%205.13363C16.3186%205.06307%2016.334%204.98744%2016.334%204.91106C16.334%204.83469%2016.3186%204.75906%2016.2885%204.6885C16.2585%204.61794%2016.2145%204.55382%2016.159%204.49981C16.1035%204.44581%2016.0377%204.40297%2015.9652%204.37374C15.8927%204.34451%2015.815%204.32947%2015.7365%204.32947C15.658%204.32947%2015.5803%204.34451%2015.5078%204.37374C15.4353%204.40297%2015.3695%204.44581%2015.314%204.49981L12.3894%207.34648V0.830648C12.3894%200.509814%2012.1197%200.247314%2011.7901%200.247314C11.4604%200.247314%2011.1908%200.509814%2011.1908%200.830648Z'%20fill='%23F2F7FF'/%3e%3c/svg%3e",_d={class:"counter_container"},Cd={class:"card_size_place_wrapper",ref:"sliderWrapper"},Ed={class:"cart_amount_counter"},yd={class:"button_circle_number"},bd=ze(l.defineComponent({__name:"NumberModifier",props:{qr_menu:{type:Boolean}},setup(o){const s=Rt(),{stateCard:i}=we.storeToRefs(s),u=ke.useRouter(),f=o,h=()=>{var x,_,p,C;(_=(x=u.options.history.state)==null?void 0:x.back)!=null&&_.includes("mode=pdf")&&f.qr_menu||(p=i.value.openCard)!=null&&p.amount&&((C=i.value.openCard)==null?void 0:C.amount)>1&&(i.value.openCard.amount-=1)},m=()=>{var x,_,p;(_=(x=u.options.history.state)==null?void 0:x.back)!=null&&_.includes("mode=pdf")&&f.qr_menu||(p=i.value.openCard)!=null&&p.amount&&(i.value.openCard.amount+=1)};return(x,_)=>{var p,C;return l.openBlock(),l.createElementBlock("div",_d,[l.createElementVNode("div",Cd,[l.createElementVNode("div",Ed,[l.createElementVNode("p",{class:l.normalizeClass(["cart_circle_minus",[((p=l.unref(i).openCard)==null?void 0:p.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:l.withModifiers(h,["stop","prevent"])},[..._[0]||(_[0]=[l.createElementVNode("span",null,null,-1)])],2),l.createElementVNode("p",yd,l.toDisplayString((C=l.unref(i).openCard)==null?void 0:C.amount),1),l.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:l.withModifiers(m,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-50b09b8c"]]);function na(o,s=800){const i=l.ref(o),u=l.ref(o);let f=null,h=null,m=o;const x=_=>{h||(h=_);const p=_-h,C=Math.min(p/s,1),y=C<.5?4*C*C*C:1-Math.pow(-2*C+2,3)/2;i.value=Math.round(m+(u.value-m)*y),C<1?f=requestAnimationFrame(x):(i.value=u.value,f=null)};return l.watch(u,()=>{f&&cancelAnimationFrame(f),m=i.value,h=null,f=requestAnimationFrame(x)},{immediate:!0}),l.onUnmounted(()=>{f&&cancelAnimationFrame(f)}),{displayNumber:i,targetNumber:u,update:_=>{u.value=_}}}const jt=l.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(o){const s=o,{displayNumber:i,update:u}=na(s.price||0,s.duration||800);return l.watchEffect(()=>{u(s.price)}),(f,h)=>(l.openBlock(),l.createElementBlock("span",null,l.toDisplayString(l.unref(i).toFixed(o.fixedFloat)),1))}}),Ad=["disabled","id"],un=l.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(o){const s=o,i=()=>{s.onClick()};return(u,f)=>(l.openBlock(),l.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:o.disabled,onClick:i,id:o.disabled?"buttonDefaultDisabled":""},l.toDisplayString(o.textButtonDefault),9,Ad))}}),Id={class:"notification_info"},Sd={key:0,class:"notification_18plus"},Nd={class:"notification_18plus_image"},Td=["src"],kd={class:"notification_18plus_text"},Rd={class:"notification_18plus_accept"},Od={key:1,class:"notification_text"},Bd={key:0,class:"wrapper_button_accept"},lo=l.defineComponent({__name:"NotificationWindow",props:l.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean},is_qr:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(o){const s=o,i=It(),u=lt(),{is18Allowed:f,notificationData_lib:h}=we.storeToRefs(u),{itemThemes:m}=we.storeToRefs(i),x=l.computed(()=>s.backgroundColor||"rgba(50, 50, 50, 0.9)"),_=l.computed(()=>{var T;return!!((T=m.value)!=null&&T.kiosk_hide_menu_update_notification)});let p;const C=l.useModel(o,"visible"),y=()=>{h.value.fastAdd&&(u.addToCart(h.value.fastAdd),h.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),f.value=!0,C.value=!1,h.value.callback&&(h.value.callback(),h.value.callback=null)},S=()=>{C.value=!1},M=()=>{C.value=!1,clearTimeout(p)};return l.watch([C,()=>s.textNotificationDefault,_],([T,D,v],[U,P])=>{p&&(!T||T!==U||D!==P)&&clearTimeout(p),v&&T&&(p=setTimeout(M,4e3))},{immediate:!0}),l.onUnmounted(()=>{p&&M()}),(T,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[!_.value&&C.value?(l.openBlock(),l.createBlock(l.Transition,{key:0,name:"notificationBlack",appear:""},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"notification_background_black",onClick:S})]),_:1})):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"notification"},{default:l.withCtx(()=>{var v;return[C.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"notification_overlay",onClick:S},[l.createElementVNode("div",{class:"notification_wrapper",style:l.normalizeStyle({"background-color":x.value,border:`2px solid ${x.value}`})},[l.createElementVNode("div",Id,[o.type?(l.openBlock(),l.createElementBlock("div",Sd,[l.createElementVNode("div",Nd,[l.createElementVNode("img",{src:l.unref(m).adult_disclaimer_image||l.unref(m).fallback_image,alt:"Дисклеймер"},null,8,Td)]),l.createElementVNode("div",kd,l.toDisplayString(l.unref(m).adult_disclaimer_text),1),l.createElementVNode("div",Rd,[D[0]||(D[0]=l.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой. ",-1)),l.createVNode(un,{textButtonDefault:"Мне есть 18",onClick:y,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(l.openBlock(),l.createElementBlock("div",Od,[l.createTextVNode(l.toDisplayString(o.textNotificationDefault)+" ",1),(v=o.buttonAccept)!=null&&v.state?(l.openBlock(),l.createElementBlock("div",Bd,[l.createVNode(un,{class:"button_accept",textButtonDefault:o.buttonAccept.text,onClick:o.buttonAccept.acceptBtn,disabled:o.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):l.createCommentVNode("",!0)]))])],4)])):l.createCommentVNode("",!0)]}),_:1})],64))}}),Md={class:"button_price button_price_modifiers"},vd=["src"],Dd={class:"button_text_container"},Pd={class:"button_text_price"},Ld=ze(l.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(o){const s=ke.useRouter(),i=ke.useRoute(),u=Rt(),f=lt(),h=It(),m=l.ref([]),x=l.ref([]),_=o,{stateCard:p,totalPrice_libCard:C,isOpenWindow:y,isAddToCard:S}=we.storeToRefs(u),{isDesktop:M}=Nn(),{itemThemes:T}=we.storeToRefs(h),D=l.ref(!0),v=l.ref(!1),U=l.computed(()=>M.value?!1:D.value),P=()=>{var B,$,K,W,ie;if(($=(B=s.options.history.state)==null?void 0:B.back)!=null&&$.includes("mode=pdf")&&_.qr_menu)return;if(D.value){u.setCurrentCard(p.value.openCard),v.value=!0;const V=p.value.groupModifiers.findIndex(ae=>u.checkedRequiredBtn.group.id===ae.id);u.checkedRequiredBtn.haveRequaire&&u.toggleNotRequire(u.checkedRequiredBtn.group,V);return}const O=p.value.groupModifiersSelected||[];if(m.value=[],x.value=[],Array.isArray(O)&&O.length>0&&O.forEach(V=>{const ae=V.group,j=V.modifiers||[];ae==="Добавки2000"?m.value=j.map(G=>{var z;return{...G,old_price:G.price,size:Array.isArray(G.size)?G.size.map(X=>X.id).filter(Boolean):(z=G.size)!=null&&z.id?G.size.id:void 0}}):j.length>0&&x.value.push({group:ae,is_fake:V.is_fake||!1,is_product_determining:V.is_product_determining||!1,modifiers:j.map(G=>{var z;return{...G,old_price:G.price,size:Array.isArray(G.size)?G.size.map(X=>X.id).filter(Boolean):(z=G.size)!=null&&z.id?G.size.id:void 0}})})}),document.body.style.overflow="",p.value.openCard){const V={id:p.value.openCard.id,is_fake:p.value.openCard.is_fake||!1,is_od_united_product:p.value.openCard.is_od_united_product||!1,amount:p.value.openCard.amount,name:p.value.openCard.name,image_link:p.value.openCard.image_link,price:p.value.openCard.price,old_price:p.value.openCard.price,size:((K=p.value.selectedSize)==null?void 0:K.id)??((ie=(W=p.value.openCard.sizes)==null?void 0:W.find(ae=>ae.is_default))==null?void 0:ie.id),sizes:p.value.openCard.sizes||[],modifiers:m.value,groups:p.value.openCard.groups,group_modifiers:x.value,energy_amount:p.value.openCard.energy_amount??0,proteins_amount:p.value.openCard.proteins_amount??0,fat_amount:p.value.openCard.fat_amount??0,carbohydrates_amount:p.value.openCard.carbohydrates_amount??0};_.closeProduct&&_.closeProduct(),f.addToCart(V),S.value=!0}y.value=!1,_.qr_menu&&s.push(`/${i.params.orgId}/`)};return l.watch(()=>p.value.productSizes,O=>{!O||O.length===0||!p.value.selectedSize||(p.value.selectedSize={...p.value.selectedSize})},{immediate:!0}),l.watchEffect(()=>{u.checkedRequiredBtn.haveRequaire?D.value=!0:D.value=!1}),l.onMounted(()=>{S.value=!1}),(O,B)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(lo,{visible:v.value,textNotificationDefault:l.unref(p).textErrorRequaired,backgroundColor:l.unref(T).accent_color?l.unref(T).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":B[0]||(B[0]=$=>v.value=$)},null,8,["visible","textNotificationDefault","backgroundColor"])])),l.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:B[3]||(B[3]=l.withModifiers(()=>{},["stop"])),onPointerdown:B[4]||(B[4]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",Md,[l.unref(M)?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(bd,{key:0,qr_menu:o.qr_menu},null,8,["qr_menu"])),l.createElementVNode("div",{class:l.normalizeClass(["card_product_button_buy",{buy_active:!U.value}]),"data-clickable":"true",onClick:P,onTouchstart:B[1]||(B[1]=l.withModifiers(()=>{},["stop"])),onPointerdown:B[2]||(B[2]=l.withModifiers(()=>{},["stop"]))},[l.unref(M)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("img",{key:0,src:l.unref(wd),class:"card_product_button_icon"},null,8,vd)),l.createElementVNode("div",Dd,[l.createElementVNode("p",Pd,[l.createVNode(jt,{price:+l.unref(C),fixedFloat:2},null,8,["price"]),B[5]||(B[5]=l.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-4ebdaed7"]]),Fd={class:"modified_amount"},Vd={class:"hide_image_corners"},Ud=["src"],zd={class:"wrapper_modifier_title"},Hd={class:"amount_title"},Gd={class:"wrapper_amount_counter"},Wd={class:"amount_count"},Xd={class:"amount_wrapper"},jd={class:"add_counter_amount"},qd=ze(l.defineComponent({__name:"ModalAmount",setup(o){const s=Rt(),i=It(),{itemThemes:u}=we.storeToRefs(i),{stateCard:f}=we.storeToRefs(s),h=l.computed(()=>{var _,p,C;return((C=(p=(_=f.value.currentModifier)==null?void 0:_.sizes)==null?void 0:p.find(y=>y.id===f.value.selectedSize.id))==null?void 0:C.price)??dr(f.value.currentModifier)}),m=()=>{f.value.currentModifier&&(f.value.currentModifier.amount=f.value.modalCount),s.modifierSelect(f.value.currentModifier),f.value.isModifiedAmount=!1},x=()=>{f.value.modalCount=1,f.value.currentModifier.amount=1};return(_,p)=>{var C,y;return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",Fd,[l.createElementVNode("div",Vd,[l.createElementVNode("img",{class:"modifier_image",src:((C=l.unref(f).currentModifier)==null?void 0:C.image_link)||l.unref(u).fallback_image||""},null,8,Ud),l.createElementVNode("div",zd,[l.createElementVNode("p",Hd,l.toDisplayString((y=l.unref(f).currentModifier)==null?void 0:y.name),1),l.createElementVNode("p",null,"+ "+l.toDisplayString(h.value)+"₽",1)])])]),l.createElementVNode("div",Gd,[l.createElementVNode("div",{class:"amount_mines",onClick:p[0]||(p[0]=l.withModifiers((...S)=>l.unref(s).minusAmount&&l.unref(s).minusAmount(...S),["stop"]))},[...p[1]||(p[1]=[l.createElementVNode("div",null,null,-1)])]),l.createElementVNode("p",Wd,l.toDisplayString(l.unref(f).modalCount),1),l.createElementVNode("div",Xd,[l.createVNode(so,{onClick:l.withModifiers(l.unref(s).plusAmount,["stop"])},null,8,["onClick"])])]),l.createElementVNode("p",{class:"clear_count",onClick:l.withModifiers(x,["stop"])},"Убрать все"),l.createElementVNode("div",jd,[l.createVNode(un,{textButtonDefault:"Добавить",onClick:m,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-84debd5d"]]),Zd=(o,s,i)=>Math.max(s,Math.min(o,i)),Yd=(o,s)=>Math.pow(o,s*5),ra=(o,s,i)=>s===0||Math.abs(s)===1/0?Yd(o,i):o*s*i/(s+i*o),pi=(o,s)=>s*parseFloat(o)/100,co=(o,s,i,u=.15)=>u===0?Zd(o,s,i):o<s?-ra(s-o,i-s,u)+s:o>i?+ra(o-i,i-s,u)+i:o,sn=(o,{min:s,max:i})=>s!==void 0&&o<s?s:i!==void 0&&o>i?i:o;function $d(o,s,i){const u=l.ref(0),f=l.computed(()=>o.value.map(_=>typeof _=="string"?pi(_,i.value):_)),h=l.computed(()=>Math.min(...f.value)),m=l.computed(()=>Math.max(...f.value)),x=l.computed(()=>{const _=f.value.reduce((p,C)=>Math.abs(C-s.value)<Math.abs(p-s.value)?C:p);return f.value.indexOf(_)});return{currentSnapPointIndex:u,flattenedSnapPoints:f,minSnapPoint:h,maxSnapPoint:m,closestSnapPointIndex:x}}const uo=ze(l.defineComponent({__name:"BottomSheet",props:{duration:{default:250},snapPoints:{},initialSnapPoint:{},blocking:{type:Boolean,default:!0},canSwipeClose:{type:Boolean,default:!0},swipeCloseThreshold:{},canBackdropClose:{type:Boolean,default:!0},expandOnContentDrag:{type:Boolean,default:!0},modelValue:{type:Boolean},teleportTo:{default:"body"},teleportDefer:{type:Boolean,default:!1},headerClass:{},contentClass:{},footerClass:{}},emits:["opened","opening-started","closed","closing-started","ready","dragging-up","dragging-down","snapped","instinctHeight","update:modelValue"],setup(o,{expose:s,emit:i}){const u=o,f=i;let h=null;const m=l.ref(0),x=Xt.useVModel(u,"modelValue",f,{passive:!0});l.watch(x,ce=>{ce&&me()}),l.onMounted(()=>{x.value&&me()});const _=l.ref(),p=l.ref(null),C=l.ref(null),y=l.ref(null),S=l.ref(null),M=l.ref(u.expandOnContentDrag),{height:T}=Xt.useWindowSize(),{height:D}=Xt.useElementBounding(_),{height:v}=Xt.useElementBounding(p),{height:U}=Xt.useElementBounding(S),{height:P}=Xt.useElementBounding(C),O=l.computed({get(){return sn(Math.ceil(U.value+v.value+P.value),{max:T.value})},set(ce){[v.value,U.value,P.value]=ce}}),B=l.ref(0),$=l.ref(0),K=At.useMotionValue(0),W=At.useMotionValue(0),{snapPoints:ie}=l.toRefs(u),V=l.computed(()=>ie.value??[O.value]),{flattenedSnapPoints:ae,currentSnapPointIndex:j,closestSnapPointIndex:G,minSnapPoint:z,maxSnapPoint:X}=$d(V,B,T);let N;function Q(ce){M.value=!0,H(ce)}function H(ce){M.value&&ce.preventDefault()}const te=ce=>{ce.key==="Escape"&&Ie()},q=()=>{u.canBackdropClose&&Ie()};let re=!1;const me=async()=>{var ce;if(!re){xe&&(xe=!1,h&&(clearTimeout(h),h=null)),m.value++,x.value=!0,re=!0,f("opening-started");try{await l.nextTick(),await l.nextTick();const He=(ce=_.value)==null?void 0:ce.$el;if(!He){console.warn("[BottomSheet] sheet not ready, aborting"),x.value=!1;return}D.value=He.getBoundingClientRect().height;const $e=He.querySelector("[data-vsbs-content]"),pt=He.querySelector("[data-vsbs-header]"),Je=He.querySelector("[data-vsbs-footer]");if(O.value=[pt.getBoundingClientRect().height,$e.getBoundingClientRect().height,Je.getBoundingClientRect().height],await l.nextTick(),j.value=ae.value.findIndex(Re=>Re===z.value),u.initialSnapPoint){const Re=u.initialSnapPoint;if(Re<0||Re>=V.value.length)return console.warn("Index out of bounds");B.value=typeof V.value[Re]=="number"?sn(V.value[Re],{max:T.value}):pi(V.value[Re],T.value)}else B.value=sn(z.value,{max:T.value});$.value=B.value,K.jump(B.value),W.jump(B.value),requestAnimationFrame(()=>{N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut"}),N=At.animate(W,0,{duration:u.duration/1e3,ease:"easeInOut",onComplete:()=>{u.blocking&&f("opened")}})}),window.addEventListener("keydown",te)}finally{re=!1}}};let xe=!1;const Ie=()=>{xe||(re&&(re=!1),N&&N.stop(),x.value=!1,xe=!0,f("closing-started"),window.removeEventListener("keydown",te),h&&clearTimeout(h),h=setTimeout(()=>{f("closed"),xe=!1,h=null},u.duration))},_e=ce=>{if(V.value){if(ce<0||ce>=V.value.length){console.warn("Index out of bounds");return}j.value=ce,B.value=typeof V.value[ce]=="number"?sn(V.value[ce],{max:T.value}):pi(V.value[ce],T.value),N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut",onComplete:()=>f("snapped",V.value.indexOf(V.value[ce]))})}};function Me(ce){ce>0?f("dragging-down"):ce<0&&f("dragging-up")}const ge=()=>{B.value=D.value,$.value=W.get(),K.jump(B.value),W.jump($.value)},ct=async(ce,He)=>{await l.nextTick(),_.value&&($.value<=0&&(B.value-=He.delta.y),B.value<=z.value&&(B.value=z.value,$.value+=He.delta.y,W.set(u.canSwipeClose?sn($.value,{min:0}):sn(co($.value,-D.value,0,.5),{min:0}))),K.set(sn(co(B.value,0,X.value,.25),{min:0,max:T.value})),Me(He.delta.y))},Ve=()=>{if(u.canSwipeClose){let ce=B.value/2;u.swipeCloseThreshold&&typeof u.swipeCloseThreshold=="number"&&(ce=u.swipeCloseThreshold),u.swipeCloseThreshold&&typeof u.swipeCloseThreshold=="string"&&u.swipeCloseThreshold.includes("%")&&(ce=B.value*(Number(u.swipeCloseThreshold.replace("%",""))/100)),Math.abs($.value)>ce&&($.value=B.value)}else $.value=0;if(N=At.animate(W,$.value,{duration:u.duration/1e3,ease:"easeInOut"}),$.value===B.value){$.value=0,Ie();return}j.value=G.value,B.value=typeof V.value[G.value]=="number"?sn(V.value[G.value],{max:T.value}):pi(V.value[G.value],T.value),N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut",onComplete:()=>f("snapped",V.value.indexOf(V.value[G.value]))}),N=At.animate(W,0,{duration:u.duration/1e3,ease:"easeInOut"})},Oe=(ce,He)=>{if(B.value=D.value,$.value=W.get(),N&&N.stop(),!y.value)return;const $e=y.value.scrollTop===0,pt=He.delta.y>0,Je=ae.value.length===1,Re=.5>Math.abs(B.value-X.value);if(Je){if(!u.expandOnContentDrag)return M.value=!1;W.get()===0&&$e&&pt&&(M.value=!0),W.get()===0&&$e&&!pt&&(M.value=!1)}else{if(!u.expandOnContentDrag)return M.value=!1;M.value=!0,Re&&(pt&&$e&&(M.value=!0),!pt&&$e&&(M.value=!1),$e||(M.value=!1))}},qe=async(ce,He)=>{if(await l.nextTick(),!u.expandOnContentDrag)return M.value=!1;if(!_.value)return;$.value===0&&M.value&&u.expandOnContentDrag&&(B.value-=He.delta.y),B.value<=z.value&&(B.value=z.value,M.value&&u.expandOnContentDrag&&($.value+=He.delta.y),$.value=sn($.value,{min:0,max:z.value}),W.set(u.canSwipeClose?sn($.value,{min:0}):sn(co($.value,-D.value,0,.5),{min:0}))),B.value>X.value&&(B.value=X.value),B.value=sn(B.value,{max:T.value}),!(ae.value.length===1)&&B.value===X.value&&(M.value=!1),K.set(B.value),Me(He.delta.y)},Qe=()=>{if(!y.value)return;const ce=y.value.scrollTop===0;M.value=ce},Ot=Xt.useDebounceFn(ce=>_e(ce),u.duration);return l.watch(V,(ce,He)=>{if(x.value===!1||!ce||!He)return;const $e=ce[j.value],pt=He[j.value];typeof $e!="string"&&typeof pt!="string"&&(B.value=sn($e,{max:T.value}),$e!==pt&&(N=At.animate(K,B.value,{duration:u.duration/1e3,ease:"easeInOut"})))}),l.watch(T,()=>Ot(j.value)),s({open:me,close:Ie,snapToPoint:_e}),l.onUnmounted(()=>{h&&clearTimeout(h)}),(ce,He)=>(l.openBlock(),l.createBlock(l.Teleport,{to:o.teleportTo,defer:o.teleportDefer},[l.createElementVNode("div",l.mergeProps(ce.$attrs,{"data-vsbs-container":""}),[l.createVNode(l.unref(At.AnimatePresence),null,{default:l.withCtx(()=>[l.unref(x)&&o.blocking?(l.openBlock(),l.createBlock(l.unref(At.Motion),{ref:"backdrop",key:"backdrop-"+m.value,"data-vsbs-backdrop":"",onClick:He[0]||(He[0]=$e=>q()),transition:{ease:"easeInOut",duration:o.duration/1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},null,8,["transition"])):l.createCommentVNode("",!0)]),_:1}),l.createVNode(l.unref(At.AnimatePresence),null,{default:l.withCtx(()=>[l.unref(x)?(l.openBlock(),l.createBlock(l.unref(At.Motion),{ref_key:"sheet",ref:_,exit:{y:"100%",height:l.unref(D),opacity:0},initial:!1,key:m.value,style:l.normalizeStyle({y:l.unref(W),z:1,height:l.unref(K)}),"data-vsbs-shadow":!o.blocking,"data-vsbs-sheet-show":l.unref(x),"aria-modal":"true","data-vsbs-sheet":"",tabindex:"-1"},{default:l.withCtx(()=>[l.createVNode(l.unref(At.Motion),{ref_key:"sheetHeader",ref:p,"data-vsbs-header":"",onPanStart:ge,onPan:ct,onPanEnd:Ve,onTouchmove:Q,class:l.normalizeClass(o.headerClass)},{default:l.withCtx(()=>[l.renderSlot(ce.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),l.createElementVNode("div",{ref_key:"sheetScroll",ref:y,"data-vsbs-scroll":"",onScrollend:Qe},[l.createVNode(l.unref(At.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:Oe,onPan:qe,onPanEnd:Ve,onTouchmove:H},{default:l.withCtx(()=>[l.createElementVNode("div",{ref_key:"sheetContent",ref:S,"data-vsbs-content":"",class:l.normalizeClass(o.contentClass)},[l.renderSlot(ce.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),l.createVNode(l.unref(At.Motion),{ref_key:"sheetFooter",ref:C,"data-vsbs-footer":"",onPanStart:ge,onPan:ct,onPanEnd:Ve,onTouchmove:Q,class:l.normalizeClass(o.footerClass)},{default:l.withCtx(()=>[l.renderSlot(ce.$slots,"footer",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["exit","style","data-vsbs-shadow","data-vsbs-sheet-show"])):l.createCommentVNode("",!0)]),_:3})],16)],8,["to","defer"]))}}),[["__scopeId","data-v-5acf0656"]]);function Fn(o,s=null){const i=ti();i.initCacheSingle("defaultImage");const u=l.computed(()=>i.cache.defaultImage||null),f=l.shallowRef(!1),h=l.computed(()=>{var p;return((p=l.toValue(o))==null?void 0:p.toString())||null}),m=Xt.computedAsync(async()=>{const p=h.value;return p?(await i.initCacheSingle(p),i.cache[p]||null):null},null,{evaluating:f}),x=l.computed(()=>f.value&&h.value!==null);return{mediaUrl:l.computed(()=>m.value||l.toValue(s)||u.value||null),isLoading:x}}const Kd={class:"card_product_modifiers_sheet_body"},Qd={class:"card__pictures"},Jd=["src"],e0=["src"],t0={class:"card_header_wrapper"},n0={key:0,class:"card_fire_kkal_wrapper"},r0={class:"card_content"},i0={class:"wrapper_size"},o0={key:0,class:"description"},s0={key:1},a0=ze(l.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(o){const s=It(),i=Rt(),{stateCard:u,isOpenWindow:f}=we.storeToRefs(i),{itemThemes:h}=we.storeToRefs(s),m=ke.useRouter(),x=ke.useRoute(),_=o,p=l.computed(()=>!!(x.query.mode==="pdf"&&_.configPage.qr_menu)),{mediaUrl:C}=Fn(()=>{var M,T;return(M=u.value.openCard)!=null&&M.video_link?`${u.value.openCard.id}_video`:(T=u.value.openCard)!=null&&T.image_link?`${u.value.openCard.id}_image`:null},()=>{var M,T;return((M=u.value.openCard)==null?void 0:M.video_link)||((T=u.value.openCard)==null?void 0:T.image_link)||null}),y=()=>{_.configPage.qr_menu?p.value?m.push(`/${x.params.orgId}?mode=pdf`):m.push(`/${x.params.orgId}`):_.configPage.closeProduct()},S=()=>{u.value.isModifiedAmount=!1};return l.watch(()=>_.configPage.data,i.setCurrentCard),l.watch(()=>u.value.isSectionModifier,M=>{p.value&&document.body.classList.toggle("pdf_hidden",M)},{immediate:!0}),l.watchEffect(()=>{f.value||(f.value=_.configPage.is_closeProduct)}),l.onBeforeUnmount(()=>i.reset()),(M,T)=>{var D,v,U,P,O,B;return l.openBlock(),l.createElementBlock("div",{class:"card_product_wrapper",style:l.normalizeStyle(p.value?"user-select: none;":"")},[l.createVNode(l.unref(uo),{modelValue:l.unref(u).isSectionModifier,"onUpdate:modelValue":T[1]||(T[1]=$=>l.unref(u).isSectionModifier=$),class:"card_product_modifiers_sheet",teleportTo:p.value?"#app":"body"},{default:l.withCtx(()=>[l.createElementVNode("div",Kd,[l.createVNode(fd,{onClose:T[0]||(T[0]=$=>l.unref(u).isSectionModifier=!1)}),l.createVNode(ta,{isSectionModifier:l.unref(u).isSectionModifier,toggleNotRequire:l.unref(i).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue","teleportTo"]),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.unref(u).isModifiedAmount?(l.openBlock(),l.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:l.withModifiers(S,["stop"])},[l.createVNode(qd)])):l.createCommentVNode("",!0)])),l.createElementVNode("div",Qd,[(D=l.unref(u).openCard)!=null&&D.video_link&&l.unref(C)?l.withDirectives((l.openBlock(),l.createElementBlock("video",{key:l.unref(C),loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},[l.createElementVNode("source",{src:l.unref(C)||"",type:"video/webm"},null,8,Jd)])),[[l.unref(zr)]]):(l.openBlock(),l.createElementBlock("img",{key:1,class:"card__pictures_images",src:l.unref(C)||"",alt:"Product image"},null,8,e0)),l.createElementVNode("div",t0,[l.createVNode(Ur,{class:"card_header_back",onClick:y,"aria-label":"Вернуться назад"}),(v=l.unref(u).openCard)!=null&&v.energy_amount?(l.openBlock(),l.createElementBlock("div",n0,[T[3]||(T[3]=l.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),l.createElementVNode("p",null,[l.createElementVNode("b",null,l.toDisplayString((U=l.unref(u).openCard)==null?void 0:U.energy_amount),1),T[2]||(T[2]=l.createTextVNode(" Ккал ",-1))])])):l.createCommentVNode("",!0)]),l.createElementVNode("h4",null,l.toDisplayString((P=l.unref(u).openCard)==null?void 0:P.name),1),l.createElementVNode("div",{class:"card__pictures__gradient",style:l.normalizeStyle(l.unref(h).gradientStyle)},null,4)]),l.createElementVNode("div",r0,[l.createElementVNode("div",i0,[l.createVNode(xd)]),(O=l.unref(u).openCard)!=null&&O.description?(l.openBlock(),l.createElementBlock("p",o0,l.toDisplayString((B=l.unref(u).openCard)==null?void 0:B.description),1)):l.createCommentVNode("",!0),l.unref(u).groupModifiers.length?(l.openBlock(),l.createElementBlock("div",s0,[T[4]||(T[4]=l.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),l.createVNode(ta,{isSectionModifier:l.unref(u).isSectionModifier,toggleNotRequire:l.unref(i).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):l.createCommentVNode("",!0),l.createVNode(Ld,{qr_menu:o.configPage.qr_menu,closeProduct:o.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])],4)}}}),[["__scopeId","data-v-a92cd973"]]),l0={key:0,class:"popupWindowDefault_overlay"},ia=ze(l.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(o,{emit:s}){const i=o,u=s,f=()=>{u("update:visible",!1)};return l.watch(()=>i.visible,async h=>{h&&await l.nextTick(),i.isVisible=h}),(h,m)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(l.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:m[0]||(m[0]=()=>{u("update:visible",!1)})},{default:l.withCtx(()=>[i.visible?(l.openBlock(),l.createElementBlock("div",{key:0,class:"background_black",onClick:f})):l.createCommentVNode("",!0)]),_:1}),l.createVNode(l.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:m[1]||(m[1]=()=>{u("update:visible",!1)})},{default:l.withCtx(()=>[i.visible?(l.openBlock(),l.createElementBlock("div",l0,[l.renderSlot(h.$slots,"default",{},void 0,!0)])):l.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),c0={},u0={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function d0(o,s){return l.openBlock(),l.createElementBlock("svg",u0,[...s[0]||(s[0]=[l.createElementVNode("path",{d:"M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const f0=ze(c0,[["render",d0]]),fo=we.defineStore("modals",()=>{const o=new Map,s=(f,h)=>{const m=u(f).value;m.visible=!0,m.context=h},i=f=>{const h=u(f).value;h.visible=!1},u=f=>(o.has(f)||o.set(f,l.ref({visible:!1})),o.get(f));return{state:u,open:s,close:i}}),h0=["src"],g0={class:"cart_box_content_wrapper"},m0={class:"cart_box_content_info"},p0={class:"cart_amount"},x0={class:"cart_amount_count"},w0={class:"cart_box_info_more"},_0={key:1,class:"cart_modifier_info"},C0={class:"cart_modifier_content"},E0={class:"wrapper_price_count_cart"},y0={class:"count_cart_box"},b0={class:"wrapper_modifiers_discount"},oa=ze(l.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(o,{emit:s}){const i=o,u=lt(),f=It(),h=fo(),{itemThemes:m}=we.storeToRefs(f),x=l.ref(0),_=l.ref(0),p=l.ref(!1),C=l.ref(!1),y=l.ref(!1),{displayNumber:S,update:M}=na(0,800),T=l.computed(()=>{var j,G;const V=((j=i.cardItem)==null?void 0:j.modifiers)??[],ae=(((G=i.cardItem)==null?void 0:G.group_modifiers)??[]).flatMap(z=>z.modifiers??[]);return[...V,...ae]}),{mediaUrl:D}=Fn(()=>{var V;return((V=i.cardItem)==null?void 0:V.id)+"_image"},()=>{var V;return(V=i.cardItem)==null?void 0:V.image_link}),v=l.computed(()=>{var V,ae;return((V=i.cardItem)==null?void 0:V.total_new_price)||dr(i.cardItem)*((ae=i.cardItem)==null?void 0:ae.amount)}),U=()=>h.open("cart-delete-confirm",i.cardItem),P=()=>{y.value=!y.value},O=()=>{u.plusAmount(i.cardItem.idSystem)},B=()=>{i.cardItem.amount>1?u.minusAmount(i.cardItem.idSystem):U()},$=V=>{x.value=V.touches[0].clientX,p.value=!0},K=V=>{p.value&&(_.value=V.touches[0].clientX-x.value,_.value>0&&(_.value=0))},W=()=>{p.value=!1,_.value<-115&&U(),_.value=0};l.onMounted(()=>{i.index===0&&(C.value=!0,setTimeout(()=>{_.value=-90,setTimeout(()=>{_.value=0,C.value=!1},700)},0))});const ie=l.computed(()=>{const V=i.index===0&&C.value?1:`${1-Math.abs(_.value)/200}`;return{transform:`translateX(${_.value}px)`,opacity:V,transition:p.value?"none":"transform 0.7s, opacity 0.7s"}});return l.watch(v,M,{immediate:!0}),(V,ae)=>{var j,G,z,X;return l.openBlock(),l.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:$,onTouchmove:K,onTouchend:W,style:l.normalizeStyle(ie.value)},[ae[2]||(ae[2]=l.createElementVNode("div",{class:"wrapper_cart_delete"},[l.createElementVNode("div",{class:"cart_delete"})],-1)),l.createElementVNode("img",{src:l.unref(D)||"",class:"cart_box_image"},null,8,h0),l.createElementVNode("div",g0,[l.createElementVNode("div",m0,[l.createElementVNode("p",null,l.toDisplayString((j=o.cardItem)==null?void 0:j.name),1),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(((G=i.cardItem)==null?void 0:G.discounts)||[],(N,Q)=>(l.openBlock(),l.createElementBlock("div",{key:Q,class:"discount_banner"},[l.createElementVNode("p",null,l.toDisplayString(N.name),1),l.createElementVNode("p",null,l.toDisplayString(N.discount)+"₽",1)]))),128)),l.createElementVNode("div",p0,[l.createElementVNode("button",{onClick:B},"-"),l.createElementVNode("p",x0,l.toDisplayString(i.cardItem.amount),1),l.createElementVNode("button",{onClick:O},"+")])]),l.createElementVNode("div",w0,[l.createElementVNode("div",{class:"cart_box_remove_item",onClick:U},[l.createVNode(f0)]),(z=i.cardItem)!=null&&z.new_price?(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass({discount_new_price:(X=i.cardItem)==null?void 0:X.new_price})},l.toDisplayString((i.cardItem.new_price*i.cardItem.amount).toFixed(2)+"₽"),3)):l.createCommentVNode("",!0),l.createElementVNode("p",null,l.toDisplayString(l.unref(S).toFixed(2)+"₽"),1)])]),!y.value&&T.value.length>0?(l.openBlock(),l.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:l.withModifiers(P,["stop"])},[...ae[0]||(ae[0]=[l.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),l.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):l.createCommentVNode("",!0),y.value?(l.openBlock(),l.createElementBlock("div",_0,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(T.value,N=>{var Q;return l.openBlock(),l.createElementBlock("div",{class:"cart_modifier_item",key:N.id},[l.createElementVNode("div",C0,[l.createVNode(so,{id:"plus_orange"}),l.createElementVNode("p",null,l.toDisplayString(N.name),1)]),l.createElementVNode("div",E0,[l.createElementVNode("p",y0,l.toDisplayString(`x${N.amount}`),1),l.createElementVNode("div",b0,[N!=null&&N.new_price?(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass({discount_new_price:(Q=N==null?void 0:N.new_price)==null?void 0:Q.toFixed(2)})},l.toDisplayString((N.new_price*N.amount).toFixed(2)+"₽"),3)):l.createCommentVNode("",!0),l.createElementVNode("p",null,l.toDisplayString((N.total_new_price||N.price*N.amount).toFixed(2)+"₽"),1)])])])}),128)),l.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:l.withModifiers(P,["stop"])},[...ae[1]||(ae[1]=[l.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),l.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):l.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-868411fd"]]),A0={},I0={class:"nfc_x",viewBox:"0 0 48 48"};function S0(o,s){return l.openBlock(),l.createElementBlock("svg",I0,[...s[0]||(s[0]=[l.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),l.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const N0=ze(A0,[["render",S0]]),T0={},k0={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function R0(o,s){return l.openBlock(),l.createElementBlock("svg",k0,[...s[0]||(s[0]=[l.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),l.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),l.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const O0=ze(T0,[["render",R0]]),B0={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},M0=l.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(o){return(s,i)=>o.styleRetry?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("svg",B0,[...i[0]||(i[0]=[l.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),l.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),v0={class:"sheet_header"},D0={class:"sheet_title",id:"sheetTitle"},P0={class:"sheet_body"},L0={class:"sheet_card"},F0={class:"nfc_title"},V0={class:"lead"},U0={class:"wrapper_input_accept"},z0={key:1},H0={key:0,class:"card_phone_auth_wrapper"},G0={class:"sr_only","aria-live":"polite"},sa=l.defineComponent({__name:"CardReader",setup(o){const s=lt(),i=It(),{is_OpenLoyal:u}=we.storeToRefs(s),{itemThemes:f}=we.storeToRefs(i),h=St(),m=l.ref(),x=l.ref(null),_=l.ref(""),p={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},C=l.computed({get:()=>_.value,set:H=>{_.value=H.replace(/\s/g,"")}}),y=l.computed(()=>h.currentState),S=l.computed(()=>h.isDrawerOpen),M=l.computed(()=>{var H;return((H=p[y.value])==null?void 0:H.text)||""}),T=l.computed(()=>{var H;(H=p[y.value])!=null&&H.title}),D=l.computed(()=>y.value==="success"?"Добро пожаловать!":f.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),v=l.computed(()=>({ok:y.value==="success",warn:y.value==="not_found"})),U=l.computed(()=>{const H=[];return y.value==="wait"&&H.push("pulse","show-x"),y.value==="not_found"&&H.push("pulse","show-x"),y.value==="success"&&H.push("pulse","show-ok"),H}),P=l.computed(()=>y.value==="not_found"),O=l.computed(()=>y.value==="success"),B=l.computed(()=>y.value==="not_found"),$=l.computed(()=>["not_found"].includes(y.value)),K=l.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[y.value]||""),W=()=>{h.closeDrawer(),u.value=!0},ie=async H=>{var te,q;h.error="",x.value=null;try{const re=new En;await re.authorizeByCard(H.trim()),await re.getProfile(),s.loadCart(),h.setState("success"),h.isDrawerOpen=!1,h.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(re){h.error=((q=(te=re.response)==null?void 0:te.data)==null?void 0:q.user_friendly_message)||"Ошибка",h.setState("not_found"),x.value=C.value,C.value=""}},V=l.computed(()=>{var te;const H=(te=f.value)==null?void 0:te.kiosk_hide_manual_input_loyalty_card;return H??!1}),ae=()=>{h.setState("wait"),h.error="",C.value="",x.value=null},j=()=>{h.closeDrawer(),x.value=null,C.value=""},G=()=>{var H,te;h.setState("wait"),(te=(H=C.value)==null?void 0:H.trim())!=null&&te.length&&ie(C.value.trim())},z=H=>{H.stopPropagation(),document.activeElement!==m.value&&X()},X=()=>{l.nextTick(()=>{m.value&&(m.value.focus(),_.value&&m.value.select())})},N=H=>{const te=document.activeElement===m.value;if(!S.value||te)return;const q=H.key.toLowerCase();if(q==="backspace")return C.value=C.value.slice(0,-1);if(q==="escape")return j();if(q==="r"&&B.value)return ae();if(q==="c"&&y.value==="success")return j();if(q==="enter")return G();C.value+=q},Q={mounted(H){H==null||H.focus()}};return l.onMounted(()=>{document==null||document.addEventListener("keydown",N)}),l.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",N)}),l.watchEffect(()=>{S.value&&(h.error="")}),(H,te)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[S.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"backdrop show",onClick:j,"aria-hidden":"true"})):l.createCommentVNode("",!0),S.value?(l.openBlock(),l.createElementBlock("section",{key:1,class:l.normalizeClass(["sheet show",{sheet_retry:B.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:z},[l.createElementVNode("header",v0,[l.createElementVNode("div",D0,l.toDisplayString(M.value),1),B.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["sheet_status",v.value])},l.toDisplayString(x.value),3)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"sheet_close",onClick:j,"aria-label":"Закрыть"}," Закрыть ")]),l.createElementVNode("div",P0,[l.createElementVNode("div",L0,[l.createElementVNode("div",{class:l.normalizeClass(["nfc",U.value])},[l.createVNode(M0,{styleRetry:$.value},null,8,["styleRetry"]),P.value?(l.openBlock(),l.createBlock(N0,{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"overlay check",style:l.normalizeStyle({display:O.value?"grid":"none"}),"aria-hidden":"true"},[l.createVNode(O0)],4)],2),l.createElementVNode("h2",F0,l.toDisplayString(T.value),1),l.createElementVNode("p",V0,l.toDisplayString(D.value),1),l.createElementVNode("div",U0,[l.withDirectives(l.createElementVNode("input",{style:l.normalizeStyle(V.value?{position:"absolute",left:"-9999px"}:{}),ref_key:"cardInputManualRef",ref:m,"onUpdate:modelValue":te[0]||(te[0]=q=>C.value=q),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:l.withKeys(G,["enter"])},null,36),[[l.vModelText,C.value],[Q]]),B.value?(l.openBlock(),l.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:ae},"Повторить")):(l.openBlock(),l.createElementBlock("div",z0,[V.value?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:te[1]||(te[1]=q=>B.value?j:G())},"Отправить"))]))]),y.value==="wait"&&l.unref(f).kiosk_show_loyalty_phone_input_button?(l.openBlock(),l.createElementBlock("div",H0,[l.createElementVNode("button",{class:"card_phone_auth_button",onClick:W},"Войти по номеру телефона")])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",G0,l.toDisplayString(K.value),1)],2)):l.createCommentVNode("",!0)],64))}});function aa(){const o=ke.useRoute(),s=St(),i=lt(),{isButtonDisabled:u}=we.storeToRefs(s),f=(m,x)=>{const _=m.is_tableservice?"tableservice":m.kiosk_menu?"kiosk":"qr",p=s.createPaymentHandler(_,m.kiosk_menu,m.is_tableservice,x);return p?{...p.config,route:{params:{orgId:String(o.params.orgId)}},handler:p.handler,setButtonDisabled:C=>{u.value=C},on403Kiosk:()=>{localStorage.removeItem("apiKey"),i.is_showApiKey=!0}}:null};return{getCreateOrderConfig:f,makeCreateOrderRequest:async(m,x)=>{const _=f(m,x.paymentMethodId);if(_)return Iu(x.items,x.tableDataId,_,{comment:x.comment,is_authorized:x.isAuthorized,signal:x.signal})}}}const W0="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJJTk5PIGJhbmsgY2FyZCBpY29uIj4NCiAgPGRlZnM+DQogICAgPGxpbmVhckdyYWRpZW50IGlkPSJibGFja0dyYWQiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4NCiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMxQTFBMUEiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPg0KICAgIDwvbGluZWFyR3JhZGllbnQ+DQoNCiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InNoaW5lIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCI+DQogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iNTAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAuMTgiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwIi8+DQogICAgPC9saW5lYXJHcmFkaWVudD4NCg0KICAgIDxmaWx0ZXIgaWQ9InNoYWRvdyIgeD0iLTMwJSIgeT0iLTMwJSIgd2lkdGg9IjE2MCUiIGhlaWdodD0iMTYwJSI+DQogICAgICA8ZmVEcm9wU2hhZG93IGR4PSIwIiBkeT0iNiIgc3RkRGV2aWF0aW9uPSI2IiBmbG9vZC1jb2xvcj0iIzAwMCIgZmxvb2Qtb3BhY2l0eT0iMC4yNSIvPg0KICAgIDwvZmlsdGVyPg0KICA8L2RlZnM+DQoNCiAgPCEtLSBDZW50ZXJlZCBjYXJkIC0tPg0KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg3LjUgMjMpIHJvdGF0ZSgtMTIpIiBmaWx0ZXI9InVybCgjc2hhZG93KSI+DQogICAgPCEtLSBjYXJkIGJvZHkgLS0+DQogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijg1IiBoZWlnaHQ9IjU0IiByeD0iMTAiIGZpbGw9InVybCgjYmxhY2tHcmFkKSIvPg0KDQogICAgPCEtLSB0b3Agc3RyaXBlIC0tPg0KICAgIDxyZWN0IHg9IjAiIHk9IjgiIHdpZHRoPSI4NSIgaGVpZ2h0PSI4IiByeD0iNCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wNSIvPg0KDQogICAgPCEtLSBjaGlwIC0tPg0KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwIDI3KSI+DQogICAgICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTUiIHJ4PSIzIiBmaWxsPSIjQ0ZBRTcwIi8+DQogICAgICA8cmVjdCB4PSIyLjUiIHk9IjMuNSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEuMiIgZmlsbD0iIzlFODM0RSIvPg0KICAgICAgPHJlY3QgeD0iMi41IiB5PSI2LjUiIHdpZHRoPSIxMyIgaGVpZ2h0PSIxLjIiIGZpbGw9IiM5RTgzNEUiLz4NCiAgICAgIDxyZWN0IHg9IjIuNSIgeT0iOS41IiB3aWR0aD0iMTMiIGhlaWdodD0iMS4yIiBmaWxsPSIjOUU4MzRFIi8+DQogICAgICA8cmVjdCB4PSI4LjUiIHk9IjAiIHdpZHRoPSIxLjUiIGhlaWdodD0iMTUiIGZpbGw9IiM5RTgzNEUiIG9wYWNpdHk9IjAuNiIvPg0KICAgIDwvZz4NCg0KICAgIDwhLS0gSU5OTyBsb2dvIC0tPg0KICAgIDx0ZXh0IHg9IjYxIiB5PSIzOSINCiAgICAgICAgICBmb250LWZhbWlseT0ic3lzdGVtLXVpLCAtYXBwbGUtc3lzdGVtLCBTZWdvZSBVSSwgUm9ib3RvLCBBcmlhbCwgc2Fucy1zZXJpZiINCiAgICAgICAgICBmb250LXNpemU9IjEzIg0KICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiDQogICAgICAgICAgbGV0dGVyLXNwYWNpbmc9IjEuMiINCiAgICAgICAgICBmaWxsPSIjRkZGRkZGIg0KICAgICAgICAgIG9wYWNpdHk9IjAuOTUiDQogICAgICAgICAgdGV4dC1hbmNob3I9Im1pZGRsZSI+DQogICAgICBpbm5vDQogICAgPC90ZXh0Pg0KDQogICAgPCEtLSBzaGluZSAtLT4NCiAgICA8cGF0aCBkPSJNLTggNiBMMjUgLTMgTDk0IDQ3IEw2MCA2MiBMLTggMjUgWiIgZmlsbD0idXJsKCNzaGluZSkiLz4NCiAgPC9nPg0KPC9zdmc+",la="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='100'%20height='100'%20fill='none'%3e%3c!--%20Big%20QR%20corners%20(outer%20shape%20with%20inner%20cutout)%20--%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%200H163C202.765%200%20235%2032.235%20235%2072V163C235%20202.765%20202.765%20235%20163%20235H72C32.235%20235%200%20202.765%200%20163V72C0%2032.235%2032.235%200%2072%200Z%20M102%2086H133C141.837%2086%20149%2093.163%20149%20102V133C149%20141.837%20141.837%20149%20133%20149H102C93.163%20149%2086%20141.837%2086%20133V102C86%2093.163%2093.163%2086%20102%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M349%200H440C479.765%200%20512%2032.235%20512%2072V163C512%20202.765%20479.765%20235%20440%20235H349C309.235%20235%20277%20202.765%20277%20163V72C277%2032.235%20309.235%200%20349%200Z%20M379%2086H410C418.837%2086%20426%2093.163%20426%20102V133C426%20141.837%20418.837%20149%20410%20149H379C370.163%20149%20363%20141.837%20363%20133V102C363%2093.163%20370.163%2086%20379%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%20277H163C202.765%20277%20235%20309.235%20235%20349V440C235%20479.765%20202.765%20512%20163%20512H72C32.235%20512%200%20479.765%200%20440V349C0%20309.235%2032.235%20277%2072%20277Z%20M102%20363H133C141.837%20363%20149%20370.163%20149%20379V410C149%20418.837%20141.837%20426%20133%20426H102C93.163%20426%2086%20418.837%2086%20410V379C86%20370.163%2093.163%20363%20102%20363Z%20'/%3e%3c!--%20Small%20modules%20--%3e%3crect%20x='277'%20y='277'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3crect%20x='426'%20y='277'%20width='86'%20height='86'%20rx='28'%20fill='currentColor'/%3e%3crect%20x='277'%20y='426'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3c!--%20Center%20dot%20--%3e%3ccircle%20cx='394.17'%20cy='394.17'%20r='33'%20fill='currentColor'/%3e%3c/svg%3e",X0=["src"],j0={class:"header_description"},q0=ze(l.defineComponent({__name:"PaymentBoxes",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean,default:!1},hideDiscountsButton:{type:Boolean,default:!1},orderId:{default:null},signal:{},provider:{}},emits:["select"],setup(o,{emit:s}){const i=o,u=s,f=St(),h=Rt(),{selectedProvider:m,isButtonDisabled:x}=we.storeToRefs(f),{isAddToCard:_}=we.storeToRefs(h),{makeCreateOrderRequest:p}=aa(),C={default:W0,SBP:la},y=async()=>{m.value=i.provider;const M=i.provider.front_type;M&&(_.value=!1,x.value=!0,u("select",M),i.hasRmsDiscount&&!i.hideDiscountsButton&&i.orderId!=null?Fr(i.orderId,i.provider.type):await p(i.configPage,{paymentMethodId:M,items:i.cartItems,tableDataId:i.configPage.tableDataId,comment:i.comment,isAuthorized:i.isAuthorized,signal:i.signal}))},S=l.computed(()=>C[i.provider.front_type]||C.default);return(M,T)=>(l.openBlock(),l.createElementBlock("div",{class:"payment_boxes_wrapper",onClick:y},[l.createElementVNode("img",{class:"picture",src:S.value},null,8,X0),l.createElementVNode("div",j0,[l.createElementVNode("b",null,l.toDisplayString(o.provider.name),1),l.createElementVNode("p",null,l.toDisplayString(o.provider.description),1)]),l.createVNode(Ur)]))}}),[["__scopeId","data-v-7e25de77"]]),Z0={key:0,class:"wrapper_cart_payment"},Y0={class:"wrapper_paid"},$0={class:"to_be_paid"},K0=ze(l.defineComponent({__name:"CartPayment",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean},hideDiscountsButton:{type:Boolean},orderId:{},signal:{}},emits:["selectPayment"],setup(o,{emit:s}){const i=St(),u=lt(),f=o,{totalPrice_lib:h,countBonus:m}=we.storeToRefs(u),x=s,_=C=>{x("selectPayment",C)},p=()=>{x("selectPayment","")};return(C,y)=>l.unref(i).providerTypes.length>1?(l.openBlock(),l.createElementBlock("div",Z0,[y[2]||(y[2]=l.createElementVNode("h2",null,"Выберите способ оплаты",-1)),y[3]||(y[3]=l.createElementVNode("p",{class:"description_payment"},"Можно изменить позже до оплаты",-1)),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(i).providerTypes,(S,M)=>(l.openBlock(),l.createElementBlock("div",{key:M},[l.createVNode(q0,{provider:S,"config-page":f.configPage,comment:f.comment,"cart-items":f.cartItems,"is-authorized":f.isAuthorized,"has-rms-discount":f.hasRmsDiscount,"hide-discounts-button":f.hideDiscountsButton,"order-id":f.orderId,signal:f.signal,onSelect:_},null,8,["provider","config-page","comment","cart-items","is-authorized","has-rms-discount","hide-discounts-button","order-id","signal"])]))),128)),l.createElementVNode("div",Y0,[l.createElementVNode("p",$0,[y[0]||(y[0]=l.createTextVNode("К оплате ",-1)),l.createVNode(jt,{price:l.unref(h)-l.unref(m),fixedFloat:2},null,8,["price"]),y[1]||(y[1]=l.createTextVNode(" ₽",-1))]),l.createVNode(un,{textButtonDefault:"Назад",onClick:p,class:"btn_payment"})])])):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-93970a62"]]),Q0={class:"start_page"},J0=["src"],e1={class:"wrap"},t1={class:"wrap_box"},n1={class:"title_fiscal_order"},r1={class:"wrapper_accept"},i1={ref:"barRef",class:"bar_complete","aria-hidden":"true"},o1=ze(l.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(o){const s=lt(),i=St(),u=Rt(),f=It(),{cartProducts_lib:h}=we.storeToRefs(s),{orderNumber:m,orderCompleted_lib:x,selectedOrderType:_}=we.storeToRefs(i),{is_startPage:p}=we.storeToRefs(u),{mediaUrl:C}=Fn(()=>f.itemThemes.kiosk_preloader?"preloader":null),y=ke.useRouter(),S=ke.useRoute();let M=null;l.onMounted(()=>{M=setTimeout(()=>{p.value=!f.itemThemes.kiosk_disable_lock_screen,_.value=null,s.isOrderTypeSubmited=!1,y.replace(`/${S.params.orgId}`)},1e4)});const T=()=>{fr(["cart","authTokensAccess","authTokensRefresh"]),h.value=[],x.value=null,_.value=null,s.isOrderTypeSubmited=!1,i.clearCard(),s.profile=null,y.replace(`/${S.params.orgId}`)};return l.onUnmounted(()=>{M&&clearInterval(M)}),(D,v)=>(l.openBlock(),l.createElementBlock("div",Q0,[l.withDirectives((l.openBlock(),l.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:l.unref(C)},[l.createElementVNode("source",{src:l.unref(C)||"",type:"video/webm"},null,8,J0)])),[[l.unref(zr)]]),v[4]||(v[4]=l.createElementVNode("div",{class:"start_img_black"},null,-1)),l.createElementVNode("div",e1,[l.createElementVNode("div",t1,[v[1]||(v[1]=l.createElementVNode("div",{class:"icon","aria-hidden":"true"},[l.createElementVNode("svg",{viewBox:"0 0 24 24"},[l.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),v[2]||(v[2]=l.createElementVNode("h1",null," Заказ успешно оплачен ",-1)),l.createElementVNode("p",n1,"№ "+l.toDisplayString(l.unref(m)),1),v[3]||(v[3]=l.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),l.createElementVNode("div",r1,[l.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:T},[v[0]||(v[0]=l.createElementVNode("span",{class:"label"},"Новый заказ",-1)),l.createElementVNode("span",i1,null,512)])])])])]))}}),[["__scopeId","data-v-79c00acf"]]),s1={};function a1(o,s){return s[0]||(s[0]=l.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-3e03a6dc><i data-v-3e03a6dc></i></div><h1 class="title_fiscal" data-v-3e03a6dc>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-3e03a6dc>Не забудьте <b data-v-3e03a6dc>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-3e03a6dc><div class="printer" data-v-3e03a6dc><div class="led" data-v-3e03a6dc></div><div class="slot" data-v-3e03a6dc></div><div class="receipt" data-v-3e03a6dc><div class="tear" data-v-3e03a6dc></div><div class="line accent" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div></div></div></div>',4))}const l1=ze(s1,[["render",a1],["__scopeId","data-v-3e03a6dc"]]),c1={},u1={class:"center"};function d1(o,s){return l.openBlock(),l.createElementBlock("div",u1,[...s[0]||(s[0]=[l.createStaticVNode('<div class="stack" data-v-f0859fd1><h1 class="title_fiscal" data-v-f0859fd1>Приложите карту для оплаты</h1><p class="reminder" data-v-f0859fd1>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f0859fd1><div class="waves" data-v-f0859fd1><span data-v-f0859fd1></span><span data-v-f0859fd1></span><span data-v-f0859fd1></span></div><div class="nfc" data-v-f0859fd1><svg viewBox="0 0 24 24" data-v-f0859fd1><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f0859fd1></path><path d="M10 6c4 4 4 8 0 12" data-v-f0859fd1></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f0859fd1></path></svg></div><div class="card" data-v-f0859fd1><div class="logo" data-v-f0859fd1>inno.</div><div class="chip" data-v-f0859fd1></div><div class="digits" data-v-f0859fd1>4815 1623 4200 0900</div><div class="holder" data-v-f0859fd1>Гость</div></div></div></div>',1)])])}const f1=ze(c1,[["render",d1],["__scopeId","data-v-f0859fd1"]]);/*!
|
|
7
7
|
* qrcode.vue v3.6.0
|
|
8
8
|
* A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
|
|
9
9
|
* © 2017-PRESENT @scopewu(https://github.com/scopewu)
|