@inno_user/inno_clouds_lib 8.3.0 → 8.3.1
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.
|
@@ -5722,7 +5722,7 @@ const A_ = /* @__PURE__ */ Re(T_, [["render", M_]]), E_ = (i) => {
|
|
|
5722
5722
|
(J = c.value) != null && J.balance ? c.value.balance >= 1 && (R.value = !R.value) : t.showNotification("У Вас пока нет бонусов");
|
|
5723
5723
|
}, _e = () => {
|
|
5724
5724
|
var J, j;
|
|
5725
|
-
(((J = l.value) == null ? void 0 : J.loyalty) === "IIKO"
|
|
5725
|
+
l.value.has_rms_discount ? (D.value = null, x.value = !0) : ((J = l.value) == null ? void 0 : J.loyalty) === "IIKO" && (l.value.has_loyalty_default_user || c.value) && s.configPage.kiosk_menu || ((j = l.value) == null ? void 0 : j.loyalty) === "IIKO" && s.configPage.qr_menu && c.value ? x.value = !0 : x.value = !1;
|
|
5726
5726
|
};
|
|
5727
5727
|
return gn(async () => {
|
|
5728
5728
|
_.value = s.textPaymentBtn, e.loadCart(), p.value = null, o.value = null, m.value = 0, u.value.splice(0, u.value.length, ...u.value.map(e.makeProductFullyReactive));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[Qs]=this[Qs]={accessors:{}}).accessors,r=this.prototype;function s(a){const l=yr(a);n[l]||(xd(r,a),n[l]=!0)}return D.isArray(e)?e.forEach(s):s(e),this}};Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(Ze.prototype,({value:i},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>i,set(n){this[t]=n}}}),D.freezeMethods(Ze);function ji(i,e){const t=this||gr,n=e||t,r=Ze.from(n.headers);let s=n.data;return D.forEach(i,function(l){s=l.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function ea(i){return!!(i&&i.__CANCEL__)}function qn(i,e,t){oe.call(this,i??"canceled",oe.ERR_CANCELED,e,t),this.name="CanceledError"}D.inherits(qn,oe,{__CANCEL__:!0});function ta(i,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?i(t):e(new oe("Request failed with status code "+t.status,[oe.ERR_BAD_REQUEST,oe.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function kd(i){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}function Sd(i,e){i=i||10;const t=new Array(i),n=new Array(i);let r=0,s=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=n[s];a||(a=u),t[r]=c,n[r]=u;let h=s,_=0;for(;h!==r;)_+=t[h++],h=h%i;if(r=(r+1)%i,r===s&&(s=(s+1)%i),u-a<e)return;const f=d&&u-d;return f?Math.round(_*1e3/f):void 0}}function Cd(i,e){let t=0,n=1e3/e,r,s;const a=(u,d=Date.now())=>{t=d,r=null,s&&(clearTimeout(s),s=null),i(...u)};return[(...u)=>{const d=Date.now(),h=d-t;h>=n?a(u,d):(r=u,s||(s=setTimeout(()=>{s=null,a(r)},n-h)))},()=>r&&a(r)]}const ri=(i,e,t=3)=>{let n=0;const r=Sd(50,250);return Cd(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,c=a-n,u=r(c),d=a<=l;n=a;const h={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-a)/u:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};i(h)},t)},na=(i,e)=>{const t=i!=null;return[n=>e[0]({lengthComputable:t,total:i,loaded:n}),e[1]]},ra=i=>(...e)=>D.asap(()=>i(...e)),Ed=He.hasStandardBrowserEnv?((i,e)=>t=>(t=new URL(t,He.origin),i.protocol===t.protocol&&i.host===t.host&&(e||i.port===t.port)))(new URL(He.origin),He.navigator&&/(msie|trident)/i.test(He.navigator.userAgent)):()=>!0,Td=He.hasStandardBrowserEnv?{write(i,e,t,n,r,s,a){if(typeof document>"u")return;const l=[`${i}=${encodeURIComponent(e)}`];D.isNumber(t)&&l.push(`expires=${new Date(t).toUTCString()}`),D.isString(n)&&l.push(`path=${n}`),D.isString(r)&&l.push(`domain=${r}`),s===!0&&l.push("secure"),D.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(i){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+i+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(i){this.write(i,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function vd(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function Nd(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}function ia(i,e,t){let n=!vd(e);return i&&(n||t==!1)?Nd(i,e):e}const oa=i=>i instanceof Ze?{...i}:i;function yn(i,e){e=e||{};const t={};function n(u,d,h,_){return D.isPlainObject(u)&&D.isPlainObject(d)?D.merge.call({caseless:_},u,d):D.isPlainObject(d)?D.merge({},d):D.isArray(d)?d.slice():d}function r(u,d,h,_){if(D.isUndefined(d)){if(!D.isUndefined(u))return n(void 0,u,h,_)}else return n(u,d,h,_)}function s(u,d){if(!D.isUndefined(d))return n(void 0,d)}function a(u,d){if(D.isUndefined(d)){if(!D.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function l(u,d,h){if(h in e)return n(u,d);if(h in i)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(u,d,h)=>r(oa(u),oa(d),h,!0)};return D.forEach(Object.keys({...i,...e}),function(d){const h=c[d]||r,_=h(i[d],e[d],d);D.isUndefined(_)&&h!==l||(t[d]=_)}),t}const sa=i=>{const e=yn({},i);let{data:t,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:l}=e;if(e.headers=a=Ze.from(a),e.url=Gs(ia(e.baseURL,e.url,e.allowAbsoluteUrls),i.params,i.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),D.isFormData(t)){if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(D.isFunction(t.getHeaders)){const c=t.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([d,h])=>{u.includes(d.toLowerCase())&&a.set(d,h)})}}if(He.hasStandardBrowserEnv&&(n&&D.isFunction(n)&&(n=n(e)),n||n!==!1&&Ed(e.url))){const c=r&&s&&Td.read(s);c&&a.set(r,c)}return e},Md=typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(t,n){const r=sa(i);let s=r.data;const a=Ze.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=r,d,h,_,f,m;function p(){f&&f(),m&&m(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let g=new XMLHttpRequest;g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout;function y(){if(!g)return;const x=Ze.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:x,config:i,request:g};ta(function(k){t(k),p()},function(k){n(k),p()},S),g=null}"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(y)},g.onabort=function(){g&&(n(new oe("Request aborted",oe.ECONNABORTED,i,g)),g=null)},g.onerror=function(T){const S=T&&T.message?T.message:"Network Error",B=new oe(S,oe.ERR_NETWORK,i,g);B.event=T||null,n(B),g=null},g.ontimeout=function(){let T=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||Js;r.timeoutErrorMessage&&(T=r.timeoutErrorMessage),n(new oe(T,S.clarifyTimeoutError?oe.ETIMEDOUT:oe.ECONNABORTED,i,g)),g=null},s===void 0&&a.setContentType(null),"setRequestHeader"in g&&D.forEach(a.toJSON(),function(T,S){g.setRequestHeader(S,T)}),D.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),l&&l!=="json"&&(g.responseType=r.responseType),u&&([_,m]=ri(u,!0),g.addEventListener("progress",_)),c&&g.upload&&([h,f]=ri(c),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",f)),(r.cancelToken||r.signal)&&(d=x=>{g&&(n(!x||x.type?new qn(null,i,g):x),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const w=kd(r.url);if(w&&He.protocols.indexOf(w)===-1){n(new oe("Unsupported protocol "+w+":",oe.ERR_BAD_REQUEST,i));return}g.send(s||null)})},Pd=(i,e)=>{const{length:t}=i=i?i.filter(Boolean):[];if(e||t){let n=new AbortController,r;const s=function(u){if(!r){r=!0,l();const d=u instanceof Error?u:this.reason;n.abort(d instanceof oe?d:new qn(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,s(new oe(`timeout ${e} of ms exceeded`,oe.ETIMEDOUT))},e);const l=()=>{i&&(a&&clearTimeout(a),a=null,i.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),i=null)};i.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>D.asap(l),c}},Ad=function*(i,e){let t=i.byteLength;if(t<e){yield i;return}let n=0,r;for(;n<t;)r=n+e,yield i.slice(n,r),n=r},Bd=async function*(i,e){for await(const t of Rd(i))yield*Ad(t,e)},Rd=async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}const e=i.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},aa=(i,e,t,n)=>{const r=Bd(i,e);let s=0,a,l=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){l(),c.close();return}let h=d.byteLength;if(t){let _=s+=h;t(_)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),r.return()}},{highWaterMark:2})},la=64*1024,{isFunction:ii}=D,Dd=(({Request:i,Response:e})=>({Request:i,Response:e}))(D.global),{ReadableStream:ca,TextEncoder:ua}=D.global,da=(i,...e)=>{try{return!!i(...e)}catch{return!1}},Od=i=>{i=D.merge.call({skipUndefined:!0},Dd,i);const{fetch:e,Request:t,Response:n}=i,r=e?ii(e):typeof fetch=="function",s=ii(t),a=ii(n);if(!r)return!1;const l=r&&ii(ca),c=r&&(typeof ua=="function"?(m=>p=>m.encode(p))(new ua):async m=>new Uint8Array(await new t(m).arrayBuffer())),u=s&&l&&da(()=>{let m=!1;const p=new t(He.origin,{body:new ca,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!p}),d=a&&l&&da(()=>D.isReadableStream(new n("").body)),h={stream:d&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!h[m]&&(h[m]=(p,g)=>{let y=p&&p[m];if(y)return y.call(p);throw new oe(`Response type '${m}' is not supported`,oe.ERR_NOT_SUPPORT,g)})});const _=async m=>{if(m==null)return 0;if(D.isBlob(m))return m.size;if(D.isSpecCompliantForm(m))return(await new t(He.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(D.isArrayBufferView(m)||D.isArrayBuffer(m))return m.byteLength;if(D.isURLSearchParams(m)&&(m=m+""),D.isString(m))return(await c(m)).byteLength},f=async(m,p)=>{const g=D.toFiniteNumber(m.getContentLength());return g??_(p)};return async m=>{let{url:p,method:g,data:y,signal:w,cancelToken:x,timeout:T,onDownloadProgress:S,onUploadProgress:B,responseType:k,headers:b,withCredentials:C="same-origin",fetchOptions:P}=sa(m),O=e||fetch;k=k?(k+"").toLowerCase():"text";let H=Pd([w,x&&x.toAbortSignal()],T),R=null;const N=H&&H.unsubscribe&&(()=>{H.unsubscribe()});let E;try{if(B&&u&&g!=="get"&&g!=="head"&&(E=await f(b,y))!==0){let z=new t(p,{method:"POST",body:y,duplex:"half"}),W;if(D.isFormData(y)&&(W=z.headers.get("content-type"))&&b.setContentType(W),z.body){const[Z,K]=na(E,ri(ra(B)));y=aa(z.body,la,Z,K)}}D.isString(C)||(C=C?"include":"omit");const M=s&&"credentials"in t.prototype,A={...P,signal:H,method:g.toUpperCase(),headers:b.normalize().toJSON(),body:y,duplex:"half",credentials:M?C:void 0};R=s&&new t(p,A);let $=await(s?O(R,P):O(p,A));const V=d&&(k==="stream"||k==="response");if(d&&(S||V&&N)){const z={};["status","statusText","headers"].forEach(ue=>{z[ue]=$[ue]});const W=D.toFiniteNumber($.headers.get("content-length")),[Z,K]=S&&na(W,ri(ra(S),!0))||[];$=new n(aa($.body,la,Z,()=>{K&&K(),N&&N()}),z)}k=k||"text";let F=await h[D.findKey(h,k)||"text"]($,m);return!V&&N&&N(),await new Promise((z,W)=>{ta(z,W,{data:F,headers:Ze.from($.headers),status:$.status,statusText:$.statusText,config:m,request:R})})}catch(M){throw N&&N(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new oe("Network Error",oe.ERR_NETWORK,m,R),{cause:M.cause||M}):oe.from(M,M&&M.code,m,R)}}},$d=new Map,fa=i=>{let e=i&&i.env||{};const{fetch:t,Request:n,Response:r}=e,s=[n,r,t];let a=s.length,l=a,c,u,d=$d;for(;l--;)c=s[l],u=d.get(c),u===void 0&&d.set(c,u=l?new Map:Od(e)),d=u;return u};fa();const Xi={http:id,xhr:Md,fetch:{get:fa}};D.forEach(Xi,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});const ha=i=>`- ${i}`,Id=i=>D.isFunction(i)||i===null||i===!1;function Vd(i,e){i=D.isArray(i)?i:[i];const{length:t}=i;let n,r;const s={};for(let a=0;a<t;a++){n=i[a];let l;if(r=n,!Id(n)&&(r=Xi[(l=String(n)).toLowerCase()],r===void 0))throw new oe(`Unknown adapter '${l}'`);if(r&&(D.isFunction(r)||(r=r.get(e))))break;s[l||"#"+a]=r}if(!r){const a=Object.entries(s).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=t?a.length>1?`since :
|
|
4
4
|
`+a.map(ha).join(`
|
|
5
5
|
`):" "+ha(a[0]):"as no adapter specified";throw new oe("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r}const pa={getAdapter:Vd,adapters:Xi};function Yi(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new qn(null,i)}function ma(i){return Yi(i),i.headers=Ze.from(i.headers),i.data=ji.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),pa.getAdapter(i.adapter||gr.adapter,i)(i).then(function(n){return Yi(i),n.data=ji.call(i,i.transformResponse,n),n.headers=Ze.from(n.headers),n},function(n){return ea(n)||(Yi(i),n&&n.response&&(n.response.data=ji.call(i,i.transformResponse,n.response),n.response.headers=Ze.from(n.response.headers))),Promise.reject(n)})}const _a="1.13.2",oi={};["object","boolean","number","function","string","symbol"].forEach((i,e)=>{oi[i]=function(n){return typeof n===i||"a"+(e<1?"n ":" ")+i}});const ga={};oi.transitional=function(e,t,n){function r(s,a){return"[Axios v"+_a+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,l)=>{if(e===!1)throw new oe(r(a," has been removed"+(t?" in "+t:"")),oe.ERR_DEPRECATED);return t&&!ga[a]&&(ga[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,l):!0}},oi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ld(i,e,t){if(typeof i!="object")throw new oe("options must be an object",oe.ERR_BAD_OPTION_VALUE);const n=Object.keys(i);let r=n.length;for(;r-- >0;){const s=n[r],a=e[s];if(a){const l=i[s],c=l===void 0||a(l,s,i);if(c!==!0)throw new oe("option "+s+" must be "+c,oe.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new oe("Unknown option "+s,oe.ERR_BAD_OPTION)}}const si={assertOptions:Ld,validators:oi},Ot=si.validators;let bn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ks,response:new Ks}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
-
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=yn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;n!==void 0&&si.assertOptions(n,{silentJSONParsing:Ot.transitional(Ot.boolean),forcedJSONParsing:Ot.transitional(Ot.boolean),clarifyTimeoutError:Ot.transitional(Ot.boolean)},!1),r!=null&&(D.isFunction(r)?t.paramsSerializer={serialize:r}:si.assertOptions(r,{encode:Ot.function,serialize:Ot.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),si.assertOptions(t,{baseUrl:Ot.spelling("baseURL"),withXsrfToken:Ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&D.merge(s.common,s[t.method]);s&&D.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),t.headers=Ze.concat(a,s);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,h=0,_;if(!c){const m=[ma.bind(this),void 0];for(m.unshift(...l),m.push(...u),_=m.length,d=Promise.resolve(t);h<_;)d=d.then(m[h++],m[h++]);return d}_=l.length;let f=t;for(;h<_;){const m=l[h++],p=l[h++];try{f=m(f)}catch(g){p.call(this,g);break}}try{d=ma.call(this,f)}catch(m){return Promise.reject(m)}for(h=0,_=u.length;h<_;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=yn(this.defaults,e);const t=ia(e.baseURL,e.url,e.allowAbsoluteUrls);return Gs(t,e.params,e.paramsSerializer)}};D.forEach(["delete","get","head","options"],function(e){bn.prototype[e]=function(t,n){return this.request(yn(n||{},{method:e,url:t,data:(n||{}).data}))}}),D.forEach(["post","put","patch"],function(e){function t(n){return function(s,a,l){return this.request(yn(l||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}bn.prototype[e]=t(),bn.prototype[e+"Form"]=t(!0)});let Fd=class Vc{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(l=>{n.subscribe(l),s=l}).then(r);return a.cancel=function(){n.unsubscribe(s)},a},e(function(s,a,l){n.reason||(n.reason=new qn(s,a,l),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Vc(function(r){e=r}),cancel:e}}};function zd(i){return function(t){return i.apply(null,t)}}function Ud(i){return D.isObject(i)&&i.isAxiosError===!0}const Gi={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(Gi).forEach(([i,e])=>{Gi[e]=i});function ya(i){const e=new bn(i),t=Ds(bn.prototype.request,e);return D.extend(t,bn.prototype,e,{allOwnKeys:!0}),D.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return ya(yn(i,r))},t}const be=ya(gr);be.Axios=bn,be.CanceledError=qn,be.CancelToken=Fd,be.isCancel=ea,be.VERSION=_a,be.toFormData=ti,be.AxiosError=oe,be.Cancel=be.CanceledError,be.all=function(e){return Promise.all(e)},be.spread=zd,be.isAxiosError=Ud,be.mergeConfig=yn,be.AxiosHeaders=Ze,be.formToJSON=i=>Zs(D.isHTMLForm(i)?new FormData(i):i),be.getAdapter=pa.getAdapter,be.HttpStatusCode=Gi,be.default=be;const{Axios:Tg,AxiosError:vg,CanceledError:Ng,isCancel:Mg,CancelToken:Pg,VERSION:Ag,all:Bg,Cancel:Rg,isAxiosError:Dg,spread:Og,toFormData:$g,AxiosHeaders:Ig,HttpStatusCode:Vg,formToJSON:Lg,getAdapter:Fg,mergeConfig:zg}=be;var Hd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qd(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ba={exports:{}};(function(i,e){(function(t,n){i.exports=n()})(Hd,function(){var t=1e3,n=6e4,r=36e5,s="millisecond",a="second",l="minute",c="hour",u="day",d="week",h="month",_="quarter",f="year",m="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,w={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(N){var E=["th","st","nd","rd"],M=N%100;return"["+N+(E[(M-20)%10]||E[M]||E[0])+"]"}},x=function(N,E,M){var A=String(N);return!A||A.length>=E?N:""+Array(E+1-A.length).join(M)+N},T={s:x,z:function(N){var E=-N.utcOffset(),M=Math.abs(E),A=Math.floor(M/60),$=M%60;return(E<=0?"+":"-")+x(A,2,"0")+":"+x($,2,"0")},m:function N(E,M){if(E.date()<M.date())return-N(M,E);var A=12*(M.year()-E.year())+(M.month()-E.month()),$=E.clone().add(A,h),V=M-$<0,F=E.clone().add(A+(V?-1:1),h);return+(-(A+(M-$)/(V?$-F:F-$))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:h,y:f,w:d,d:u,D:m,h:c,m:l,s:a,ms:s,Q:_}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},S="en",B={};B[S]=w;var k="$isDayjsObject",b=function(N){return N instanceof H||!(!N||!N[k])},C=function N(E,M,A){var $;if(!E)return S;if(typeof E=="string"){var V=E.toLowerCase();B[V]&&($=V),M&&(B[V]=M,$=V);var F=E.split("-");if(!$&&F.length>1)return N(F[0])}else{var z=E.name;B[z]=E,$=z}return!A&&$&&(S=$),$||!A&&S},P=function(N,E){if(b(N))return N.clone();var M=typeof E=="object"?E:{};return M.date=N,M.args=arguments,new H(M)},O=T;O.l=C,O.i=b,O.w=function(N,E){return P(N,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var H=function(){function N(M){this.$L=C(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[k]=!0}var E=N.prototype;return E.parse=function(M){this.$d=function(A){var $=A.date,V=A.utc;if($===null)return new Date(NaN);if(O.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var F=$.match(g);if(F){var z=F[2]-1||0,W=(F[7]||"0").substring(0,3);return V?new Date(Date.UTC(F[1],z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)):new Date(F[1],z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)}}return new Date($)}(M),this.init()},E.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},E.$utils=function(){return O},E.isValid=function(){return this.$d.toString()!==p},E.isSame=function(M,A){var $=P(M);return this.startOf(A)<=$&&$<=this.endOf(A)},E.isAfter=function(M,A){return P(M)<this.startOf(A)},E.isBefore=function(M,A){return this.endOf(A)<P(M)},E.$g=function(M,A,$){return O.u(M)?this[A]:this.set($,M)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(M,A){var $=this,V=!!O.u(A)||A,F=O.p(M),z=function(_e,ce){var ye=O.w($.$u?Date.UTC($.$y,ce,_e):new Date($.$y,ce,_e),$);return V?ye:ye.endOf(u)},W=function(_e,ce){return O.w($.toDate()[_e].apply($.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(ce)),$)},Z=this.$W,K=this.$M,ue=this.$D,Y="set"+(this.$u?"UTC":"");switch(F){case f:return V?z(1,0):z(31,11);case h:return V?z(1,K):z(0,K+1);case d:var U=this.$locale().weekStart||0,ie=(Z<U?Z+7:Z)-U;return z(V?ue-ie:ue+(6-ie),K);case u:case m:return W(Y+"Hours",0);case c:return W(Y+"Minutes",1);case l:return W(Y+"Seconds",2);case a:return W(Y+"Milliseconds",3);default:return this.clone()}},E.endOf=function(M){return this.startOf(M,!1)},E.$set=function(M,A){var $,V=O.p(M),F="set"+(this.$u?"UTC":""),z=($={},$[u]=F+"Date",$[m]=F+"Date",$[h]=F+"Month",$[f]=F+"FullYear",$[c]=F+"Hours",$[l]=F+"Minutes",$[a]=F+"Seconds",$[s]=F+"Milliseconds",$)[V],W=V===u?this.$D+(A-this.$W):A;if(V===h||V===f){var Z=this.clone().set(m,1);Z.$d[z](W),Z.init(),this.$d=Z.set(m,Math.min(this.$D,Z.daysInMonth())).$d}else z&&this.$d[z](W);return this.init(),this},E.set=function(M,A){return this.clone().$set(M,A)},E.get=function(M){return this[O.p(M)]()},E.add=function(M,A){var $,V=this;M=Number(M);var F=O.p(A),z=function(K){var ue=P(V);return O.w(ue.date(ue.date()+Math.round(K*M)),V)};if(F===h)return this.set(h,this.$M+M);if(F===f)return this.set(f,this.$y+M);if(F===u)return z(1);if(F===d)return z(7);var W=($={},$[l]=n,$[c]=r,$[a]=t,$)[F]||1,Z=this.$d.getTime()+M*W;return O.w(Z,this)},E.subtract=function(M,A){return this.add(-1*M,A)},E.format=function(M){var A=this,$=this.$locale();if(!this.isValid())return $.invalidDate||p;var V=M||"YYYY-MM-DDTHH:mm:ssZ",F=O.z(this),z=this.$H,W=this.$m,Z=this.$M,K=$.weekdays,ue=$.months,Y=$.meridiem,U=function(ce,ye,ge,se){return ce&&(ce[ye]||ce(A,V))||ge[ye].slice(0,se)},ie=function(ce){return O.s(z%12||12,ce,"0")},_e=Y||function(ce,ye,ge){var se=ce<12?"AM":"PM";return ge?se.toLowerCase():se};return V.replace(y,function(ce,ye){return ye||function(ge){switch(ge){case"YY":return String(A.$y).slice(-2);case"YYYY":return O.s(A.$y,4,"0");case"M":return Z+1;case"MM":return O.s(Z+1,2,"0");case"MMM":return U($.monthsShort,Z,ue,3);case"MMMM":return U(ue,Z);case"D":return A.$D;case"DD":return O.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return U($.weekdaysMin,A.$W,K,2);case"ddd":return U($.weekdaysShort,A.$W,K,3);case"dddd":return K[A.$W];case"H":return String(z);case"HH":return O.s(z,2,"0");case"h":return ie(1);case"hh":return ie(2);case"a":return _e(z,W,!0);case"A":return _e(z,W,!1);case"m":return String(W);case"mm":return O.s(W,2,"0");case"s":return String(A.$s);case"ss":return O.s(A.$s,2,"0");case"SSS":return O.s(A.$ms,3,"0");case"Z":return F}return null}(ce)||F.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(M,A,$){var V,F=this,z=O.p(A),W=P(M),Z=(W.utcOffset()-this.utcOffset())*n,K=this-W,ue=function(){return O.m(F,W)};switch(z){case f:V=ue()/12;break;case h:V=ue();break;case _:V=ue()/3;break;case d:V=(K-Z)/6048e5;break;case u:V=(K-Z)/864e5;break;case c:V=K/r;break;case l:V=K/n;break;case a:V=K/t;break;default:V=K}return $?V:O.a(V)},E.daysInMonth=function(){return this.endOf(h).$D},E.$locale=function(){return B[this.$L]},E.locale=function(M,A){if(!M)return this.$L;var $=this.clone(),V=C(M,A,!0);return V&&($.$L=V),$},E.clone=function(){return O.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},N}(),R=H.prototype;return P.prototype=R,[["$ms",s],["$s",a],["$m",l],["$H",c],["$W",u],["$M",h],["$y",f],["$D",m]].forEach(function(N){R[N[1]]=function(E){return this.$g(E,N[0],N[1])}}),P.extend=function(N,E){return N.$i||(N(E,H,P),N.$i=!0),P},P.locale=C,P.isDayjs=b,P.unix=function(N){return P(1e3*N)},P.en=B[S],P.Ls=B,P.p={},P})})(ba);var Wd=ba.exports;const wa=qd(Wd),jd=i=>{const e=re.useRouter(),t=re.useRoute(),n=`${i.domain}/api/`,r=be.create({baseURL:n}),s=be.create({baseURL:n}),a=be.create({baseURL:n}),l=be.create({baseURL:n}),c=be.create({baseURL:n}),u=be.create({baseURL:n}),d=be.create({baseURL:n}),h=x=>{try{const T=JSON.parse(localStorage.getItem("authTokensAccess")||"");T.length>0&&(x.headers.Authorization=`Bearer ${T}`)}catch{console.warn("accessToken is undefined [useAxios]")}return x},_=x=>{const T=localStorage.getItem("apiKey"),S=(T==null?void 0:T.replace(/^.(.*).$/,"$1"))||"";return x.headers={"Content-Type":"application/json","x-api-key":S},x},f=async x=>{if(!i.user)return x;const T=i.user.exp??0;if(!(wa.unix(T).diff(wa())<3e3))return x;const B=Cs("authTokensRefresh",null,"string");try{const k=await be.post(`${n}user/token/refresh/`,{refresh:B.value});if(!k.data.access)return w(),x;localStorage.setItem("authTokensAccess",JSON.stringify(k.data.access)),g(k.data),y(Ss(k.data.access)),x.headers={...x.headers,Authorization:`Bearer ${k.data.access}`}}catch(k){console.error("Failed to refresh token:",k),w()}return x},m=x=>{x.interceptors.request.use(T=>f(h(T)),T=>Promise.reject(T))};m(a),m(c),m(d);const p=x=>{x.interceptors.request.use(T=>_(T))};p(u),p(s),p(d);const g=(x,T=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(x.access)),T&&localStorage.setItem("authTokensRefresh",JSON.stringify(x.refresh))},y=x=>{i.user=x,localStorage.setItem("user",JSON.stringify(x))},w=()=>{i.user=null,Fn(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),e.push(`/${t.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:a,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:d,axiosInstancePost:l,axiosInstanceGet:r,axiosInstanceGetApiKey:s,axiosInstancePostApiKey:u}},Ki=(i,e)=>e.some(t=>i instanceof t);let xa,ka;function Xd(){return xa||(xa=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Yd(){return ka||(ka=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ji=new WeakMap,Zi=new WeakMap,ai=new WeakMap;function Gd(i){const e=new Promise((t,n)=>{const r=()=>{i.removeEventListener("success",s),i.removeEventListener("error",a)},s=()=>{t(wn(i.result)),r()},a=()=>{n(i.error),r()};i.addEventListener("success",s),i.addEventListener("error",a)});return ai.set(e,i),e}function Kd(i){if(Ji.has(i))return;const e=new Promise((t,n)=>{const r=()=>{i.removeEventListener("complete",s),i.removeEventListener("error",a),i.removeEventListener("abort",a)},s=()=>{t(),r()},a=()=>{n(i.error||new DOMException("AbortError","AbortError")),r()};i.addEventListener("complete",s),i.addEventListener("error",a),i.addEventListener("abort",a)});Ji.set(i,e)}let Qi={get(i,e,t){if(i instanceof IDBTransaction){if(e==="done")return Ji.get(i);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return wn(i[e])},set(i,e,t){return i[e]=t,!0},has(i,e){return i instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in i}};function Sa(i){Qi=i(Qi)}function Jd(i){return Yd().includes(i)?function(...e){return i.apply(eo(this),e),wn(this.request)}:function(...e){return wn(i.apply(eo(this),e))}}function Zd(i){return typeof i=="function"?Jd(i):(i instanceof IDBTransaction&&Kd(i),Ki(i,Xd())?new Proxy(i,Qi):i)}function wn(i){if(i instanceof IDBRequest)return Gd(i);if(Zi.has(i))return Zi.get(i);const e=Zd(i);return e!==i&&(Zi.set(i,e),ai.set(e,i)),e}const eo=i=>ai.get(i);function Qd(i,e,{blocked:t,upgrade:n,blocking:r,terminated:s}={}){const a=indexedDB.open(i,e),l=wn(a);return n&&a.addEventListener("upgradeneeded",c=>{n(wn(a.result),c.oldVersion,c.newVersion,wn(a.transaction),c)}),t&&a.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),r&&c.addEventListener("versionchange",u=>r(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const ef=["get","getKey","getAll","getAllKeys","count"],tf=["put","add","delete","clear"],to=new Map;function Ca(i,e){if(!(i instanceof IDBDatabase&&!(e in i)&&typeof e=="string"))return;if(to.get(e))return to.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,r=tf.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(r||ef.includes(t)))return;const s=async function(a,...l){const c=this.transaction(a,r?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(l.shift())),(await Promise.all([u[t](...l),r&&c.done]))[0]};return to.set(e,s),s}Sa(i=>({...i,get:(e,t,n)=>Ca(e,t)||i.get(e,t,n),has:(e,t)=>!!Ca(e,t)||i.has(e,t)}));const nf=["continue","continuePrimaryKey","advance"],Ea={},no=new WeakMap,Ta=new WeakMap,rf={get(i,e){if(!nf.includes(e))return i[e];let t=Ea[e];return t||(t=Ea[e]=function(...n){no.set(this,Ta.get(this)[e](...n))}),t}};async function*of(...i){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...i)),!e)return;e=e;const t=new Proxy(e,rf);for(Ta.set(t,e),ai.set(t,eo(e));e;)yield t,e=await(no.get(t)||e.continue()),no.delete(t)}function va(i,e){return e===Symbol.asyncIterator&&Ki(i,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&Ki(i,[IDBIndex,IDBObjectStore])}Sa(i=>({...i,get(e,t,n){return va(e,t)?of:i.get(e,t,n)},has(e,t){return va(e,t)||i.has(e,t)}}));let ro;async function li(){return ro||(ro=Qd("products",2,{upgrade(i,e){e<1&&(i.objectStoreNames.contains("data")||i.createObjectStore("data",{keyPath:"key"})),e<2&&(i.objectStoreNames.contains("images")||i.createObjectStore("images",{keyPath:"id"}))}})),ro}async function sf(i){return(await li()).transaction("data","readonly").objectStore("data").get(i)}async function Na(i,e){const n=(await li()).transaction("data","readwrite");await n.objectStore("data").put({key:i,data:e,timestamp:Date.now()}),await n.done}async function af(i,e){const n=(await li()).transaction("images","readwrite");await n.objectStore("images").put({id:i,blob:e,timestamp:Date.now()}),await n.done}async function Ma(i){const r=await(await li()).transaction("images","readonly").objectStore("images").get(i);return r==null?void 0:r.blob}const ae=class ae{constructor(){me(this,"axiosInstanceGet");me(this,"axiosInstancePost");me(this,"axiosInstanceAuthenticationGet");me(this,"axiosInstanceAuthenticationPost");me(this,"axiosInstanceGetApiKey");me(this,"axiosInstancePostApiKey");me(this,"axiosInstanceAuthenticationPostApiKey");me(this,"currentUpsaleController",null);me(this,"controller",new AbortController);this.axiosInstanceGet=ae._axiosGet,this.axiosInstancePost=ae._axiosPost,this.axiosInstanceGetApiKey=ae._axiosPostApiKey,this.axiosInstancePostApiKey=ae._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=ae._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=ae._axiosAuthGet,this.axiosInstanceAuthenticationPost=ae._axiosAuthPost}static create(e){return e&&!ae._config&&ae._initialize(e),ae._config||console.warn("InitConnection не инициализирован"),new ae}static _initialize(e,t=null){const n=Le(),r=Ke(),{config_lib:s}=J.storeToRefs(n),{stateCard:a,recountGroupTotalAmount:l}=J.storeToRefs(r);ae._config=e,ae._cardStore=r,ae._stateCard=a,ae._recountGroupTotalAmount=l,s.value=e;const c=jd(e);ae._axiosPostApiKey=c.axiosInstanceGetApiKey,ae._axiosPostApiKey=c.axiosInstancePostApiKey,ae._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,ae._axiosGet=c.axiosInstanceGet,ae._axiosPost=c.axiosInstancePost,ae._axiosAuthGet=c.axiosInstanceAuthenticationGet,ae._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return ae._config}get cardStore(){return ae._cardStore}get stateCard(){return ae._stateCard}get recountGroupTotalAmount(){return ae._recountGroupTotalAmount}async updateTheme(){var s,a;const e=JSON.parse(localStorage.getItem("themeConfig"))??null,t=Ge();if(e!==null){t.updateColor(e);return}const n=Le(),r=await((a=this.axiosInstanceGet)==null?void 0:a.get(`org/organizations/${(s=this.config)==null?void 0:s.orgId}/design/`));n.setStateDrum(r==null?void 0:r.data.hide_barban),n.setKioskTimeout(r==null?void 0:r.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(r.data)),t.updateColor(r.data)}async getGroup(){var e,t;try{const n=await((t=this.axiosInstanceGet)==null?void 0:t.get(`${(e=this.config)==null?void 0:e.pointId}/groups/`));return n==null?void 0:n.data}catch(n){return console.error("Error fetching products:",n),[]}}async fetchPage(e){var n,r;const t=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(n=this.config)==null?void 0:n.pointId}/groups/products/?page=${e}`));return(t==null?void 0:t.data.results)||[]}async fetchPageWithInfo(e){var n,r;if(!e||e<1)throw new Error("Пагинация не с 1");const t=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(n=this.config)==null?void 0:n.pointId}/groups/products/?page=${e}`));return(t==null?void 0:t.data)||{count:0,results:[]}}async fetchAndCacheAllPages(){try{const e=bu(1),t=await this.fetchPageWithInfo(1),{count:n=0,results:r=[]}=t;if(n===0)return console.warn("Нет продуктов: count=0"),[];const s=r.length,a=Math.ceil(n/s);await Na("page_1",t);const l=Array.from({length:a-1},(f,m)=>sf(`page_${m+2}`).then(p=>{var g;return((g=p==null?void 0:p.data)==null?void 0:g.results)||[]})),c=await Promise.all(l);if(c.every(f=>f.length>0))return[r,...c].flat();const d=Array.from({length:a-1},(f,m)=>{var g;const p=m+2;return((g=c[m])==null?void 0:g.length)>0?Promise.resolve(c[m]):e(()=>this.fetchPage(p).then(async y=>(await Na(`page_${p}`,{results:y}),y)).catch(y=>(console.error(`Page ${p} failed`,y),[])))}),h=await Promise.all(d),_=[r,...h].flat();return this.cacheImagesInBackground(_),_}catch(e){return console.error("Ошибка в fetchAndCacheAllPages:",e),[]}}cacheImagesInBackground(e){e.forEach(t=>{var s;const n=t.video_link||t.image_link,r=t.id;n&&r&&this.loadAndCacheImage(n,r),(s=t.products)==null||s.forEach(a=>{const l=a.video_link||a.image_link,c=a.id;l&&c&&this.loadAndCacheImage(l,c)})})}async loadAndCacheImage(e,t){const n=await Ma(t);if(n){this.dispatchImageCachedEvent(t,n);return}try{const r=await fetch(e);if(!r.ok)throw new Error("Network error");const s=await r.blob();if(s.size===0)throw new Error("Empty blob");await af(t,s),this.dispatchImageCachedEvent(t,s)}catch(r){console.warn(`[ImageCache] Failed for ${t}:`,r)}}dispatchImageCachedEvent(e,t){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:e,blob:t}}))}async getProduct(e=null){var t,n;if(!e)return[];try{const r=await((n=this.axiosInstanceGet)==null?void 0:n.get(`${(t=this.config)==null?void 0:t.pointId}/products/${e}`));return r==null?void 0:r.data}catch(r){return console.error("Error fetching cardProducts:",r),[]}}async getSingleProduct(e){var s;const t=Le(),n=Ke(),{config_lib:r}=J.storeToRefs(t);try{const a=await((s=this.axiosInstanceGet)==null?void 0:s.get(`${r.value.pointId}/products/${e}`));(a==null?void 0:a.status)===200&&(n.stateCard.openCard={...a.data,amount:1},n.stateCard.groupModifiers=a.data.group_modifiers,a.data.modifiers.length>0&&n.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:a.data.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:a.data.modifiers.reduce((l,c)=>l+=c.min_amount,0),name:"Добавки",required:!1}),n.stateCard.groupModifiersSelected=new Array(n.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),n.stateCard.productSizes=a.data.sizes,n.defaultAmountModifiers(),a.data.show_recommendations&&this.productUpsale(a.data.id))}catch(a){throw console.log("store card[getFetchProducts]:",a),a}}async getTheme(){try{this.updateTheme()}catch(e){return console.error("Error fetching products:",e),[]}}async authorizeByCard(e){var t,n;try{const r=await((n=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:n.post(`${(t=this.config)==null?void 0:t.domain}/api/user/validate-card/`,{card_number:e}));return localStorage.setItem("authTokensAccess",JSON.stringify(r==null?void 0:r.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(r==null?void 0:r.data.refresh)),r==null?void 0:r.data}catch(r){throw console.error("Ошибка авторизации:",r),r}}async getLoyalSmsCode(e){var t,n;try{const r=await((n=this.axiosInstancePostApiKey)==null?void 0:n.post(`${(t=this.config)==null?void 0:t.domain}/api/device/auth/request-otp/`,{phone:e}));return r==null?void 0:r.data}catch(r){throw console.error("Ошибка получения sms-code:",r),r}}async sendSmsCodeForAuth(e,t){var n,r;try{const s=await((r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`${(n=this.config)==null?void 0:n.domain}/api/device/auth/`,{code:e,phone:t}));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка отправки sms-code:",s),s}}async callStaff(e,t){var n,r,s,a;try{const l=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(n=this.config)==null?void 0:n.domain}/api/org_unit/${(r=this.config)==null?void 0:r.pointId}/table/${e}/call-staff/`,{reason:t}));return(a=l==null?void 0:l.data)==null?void 0:a.response_text}catch(l){throw console.error("Ошибка[callWaiter]",l),l}}async createOrder(e,t,n=!0,r,s=!1,a=!1){var f,m,p;const l=zn(),c=s?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,u=n?c:this.axiosInstanceAuthenticationPost,d=n?"/device/order/create":"/order/create",h=n?(f=this.config)==null?void 0:f.pointId:(m=this.config)==null?void 0:m.pointId,_=await(u==null?void 0:u.post(`${(p=this.config)==null?void 0:p.domain}/api/org_unit/${h}${d}`,{items:e,table:t||null,comment:r}));return(_==null?void 0:_.status)===201&&l.orderSocket(_==null?void 0:_.data.id,n,a),_}async initPaymentLink(e,t=!0){const n=t?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,r=Le(),s=t?"TERMINAL":"YOOKASSA",a=await(n==null?void 0:n.post("payment/init",{by_bonuses:r.countBonus,order:e,provider_type:s}));return a==null?void 0:a.data}async orderPay(e){var t;return(t=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:t.post(`order/${e}/pay/`,{order_id:e})}async getProfile(){var t,n;const e=await((n=this.axiosInstanceAuthenticationGet)==null?void 0:n.get(`user/current?organization=${(t=this.config)==null?void 0:t.orgId}`));if((e==null?void 0:e.status)===200){const r=Le();return r.profile=e.data,r.is18Allowed=sessionStorage.getItem("is_adult")==="true",e.data}else return e}async calculateDiscount(e,t=!0,n=!1){var c,u;const r=n?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=t?r:this.axiosInstanceAuthenticationPost,a=t?(c=this.config)==null?void 0:c.pointId:(u=this.config)==null?void 0:u.pointId,l=await(s==null?void 0:s.post(`/org_unit/${a}/cart/calculate-discount/`,e));return(l==null?void 0:l.status)===200?l.data:l}async productUpsale(e){var s,a,l;const t=Ke(),{dataUpSale:n}=J.storeToRefs(t);(s=this.currentUpsaleController)==null||s.abort();const r=new AbortController;this.currentUpsaleController=r;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(a=this.config)==null?void 0:a.pointId}/products/${e}/recommendation/`,{signal:r.signal}));r.signal.aborted||(n.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.log("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===r&&(this.currentUpsaleController=null)}}};me(ae,"_config",null),me(ae,"_axiosGet"),me(ae,"_axiosGetApiKey"),me(ae,"_axiosPostApiKey"),me(ae,"_axiosAuthPostApiKey"),me(ae,"_axiosPost"),me(ae,"_axiosAuthGet"),me(ae,"_axiosAuthPost"),me(ae,"_cardStore",null),me(ae,"_stateCard",null),me(ae,"_recountGroupTotalAmount",null);let Qt=ae;const lf=o.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(i,{expose:e}){const t=i,n=Le(),r=o.ref(null),s=async l=>{if(!r.value||!l)return;let c=window;t.container&&(c=typeof t.container=="string"?document.querySelector(t.container)||window:t.container);const u={behavior:t.behavior};if(t.axis==="x"){const d=c===window?window.innerWidth:c.clientWidth,h=l.offsetWidth;let _=l.offsetLeft;if(c!==window){const f=c.getBoundingClientRect();_=l.getBoundingClientRect().left-f.left+c.scrollLeft}_-=(d-h)/2,u.left=Math.max(0,_)}else{const d=c===window?window.innerHeight:c.clientHeight,h=l.offsetHeight;let _=l.offsetTop;if(c!==window){const f=c.getBoundingClientRect();_=l.getBoundingClientRect().top-f.top+c.scrollTop}_-=(d-h)/2,u.top=Math.max(0,_)}try{c===window?window.scrollTo(u):c.scrollTo(u)}catch(d){console.error("Scroll error:",d)}};o.onMounted(async()=>{if(t.autoScroll){let l=null;if(await o.nextTick(),n.activeScrolling_lib){const c=n.activeScrolling_lib.findIndex(u=>u.id===t.idActive);t.idActive?(l=document.getElementById(`scrolling${t.idActive}`),l&&c!==-1&&(n.activeScrolling_lib[c]=l)):n.activeScrolling_lib[c]&&(l=n.activeScrolling_lib[c]),s(l)}}});const a=async l=>{t.clearContainer&&(n.activeScrolling_lib=[]);const c=l.currentTarget;await o.nextTick(),n.activeScrolling_lib.includes(c)||n.activeScrolling_lib.push(c),s(c)};return e({scrollToElement:s}),(l,c)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:"scroll-to-wrapper"},[o.renderSlot(l.$slots,"default",{handleTargetClick:a},void 0,!0)],512))}}),ke=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t},io=ke(lf,[["__scopeId","data-v-b510c3f1"]]),cf={},uf={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 df(i,e){return o.openBlock(),o.createElementBlock("svg",uf,[...e[0]||(e[0]=[o.createElementVNode("defs",null,null,-1),o.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 oo=ke(cf,[["render",df]]),ff=["id","onClick"],hf={class:"modified_plus_btn"},pf=["src"],mf={key:2,class:"wrapper_modifier_item"},_f={key:0,class:"modifier_item_n_wrapper"},gf=["src"],yf={key:1,class:"modifier_plus_item"},bf=["src"],wf=["src"],xf=ke(o.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(i){const e=Ke(),t=Ge(),{stateCard:n}=J.storeToRefs(e),{itemThemes:r}=J.storeToRefs(t),s=o.ref([]),a=o.ref([]),l=o.ref(null),c=o.ref(null),u=h=>{h instanceof HTMLElement&&!s.value.includes(h)&&s.value.push(h)},d=h=>{c.value=h};return o.onMounted(async()=>{await o.nextTick(),n.value.plusButtonsRefs=s.value}),o.watchEffect(()=>{a.value=n.value.groupModifiersSelected,document.body.style.overflow=""}),o.onBeforeUnmount(()=>{s.value=[],n.value.plusButtonsRefs=[]}),(h,_)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass({card_modified_wrapper_many:o.unref(n).groupModifiers.length>=5})},[o.unref(n).groupModifiersSelected?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["card_modified_wrapper",[o.unref(n).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l,onTouchstart:_[0]||(_[0]=o.withModifiers(()=>{},["stop"])),onPointerdown:_[1]||(_[1]=o.withModifiers(()=>{},["stop"]))},[o.createVNode(io,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:o.withCtx(({handleTargetClick:f})=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(n).groupModifiers,(m,p)=>{var g,y;return o.openBlock(),o.createElementBlock("div",{class:"button_modified",key:m.id,ref_for:!0,ref:u,id:"scrolling"+m.id,"data-clickable":"true",onClick:w=>{i.toggleNotRequire&&i.toggleNotRequire(m,p),d(m.id),f(w)}},[o.createElementVNode("div",hf,[a.value[p].modifiers.length===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass([{modified_plus_btn_active:m.id===((g=o.unref(n).groupCurrentOpen)==null?void 0:g.id)&&i.isSectionModifier},"modified_plus_active"])},[o.createVNode(oo,{"aria-label":`Открыть группу модификаторов ${m.name}`},null,8,["aria-label"])],2)):a.value[p].modifiers.length===1?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:m.id===((y=o.unref(n).groupCurrentOpen)==null?void 0:y.id)&&i.isSectionModifier}])},[o.createElementVNode("img",{src:a.value[p].modifiers[0].image_link||o.unref(r).fallback_image||"",alt:"Модификатор"},null,8,pf)],2)):(o.openBlock(),o.createElementBlock("div",mf,[a.value[p].modifiers.length>2?(o.openBlock(),o.createElementBlock("div",_f,[a.value[p].modifiers.length===3?(o.openBlock(),o.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:a.value[p].modifiers[2].image_link||o.unref(r).fallback_image||""},null,8,gf)):(o.openBlock(),o.createElementBlock("p",yf," + "+o.toDisplayString(a.value[p].modifiers.length-2),1))])):o.createCommentVNode("",!0),o.createElementVNode("div",null,[a.value[p].modifiers.length>0?(o.openBlock(),o.createElementBlock("img",{key:0,src:a.value[p].modifiers[0].image_link||o.unref(r).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,bf)):o.createCommentVNode("",!0),a.value[p].modifiers.length>1?(o.openBlock(),o.createElementBlock("img",{key:1,src:a.value[p].modifiers[1].image_link||o.unref(r).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,wf)):o.createCommentVNode("",!0)])]))]),o.createElementVNode("p",null,o.toDisplayString(m.name),1)],8,ff)}),128))]),_:1},8,["container","idActive"])],34)):o.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-65ff3a99"]]),kf={},Sf={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 Cf(i,e){return o.openBlock(),o.createElementBlock("svg",Sf,[...e[0]||(e[0]=[o.createElementVNode("desc",null," Created with Pixso. ",-1),o.createElementVNode("defs",null,null,-1),o.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),o.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 so=ke(kf,[["render",Cf]]),Ef={key:0,class:"wrapper_modifiers"},Tf={class:"wrapper_nutritional_value"},vf={class:"nutritional_scheme"},Nf={key:0,class:"nutritional_parameters"},Mf={key:1,class:"nutritional_parameters"},Pf={key:2,class:"nutritional_parameters"},Af={key:3,class:"nutritional_parameters"},Bf={class:"modifier_shadow"},Rf={class:"wrapper_modifiers_title"},Df={class:"wrapper_text_count_modifiers"},Of=["onClick","onKeydown","aria-label"],$f={key:0,class:"counter_modifier"},If={class:"hide_image_corners"},Vf=["src","alt"],Lf={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},Ff=["src"],zf={class:"modifier_title"},Uf=ke(o.defineComponent({__name:"SectionModifiers",props:{isModified:{type:Boolean}},setup(i){const e=Ge(),t=Ke(),{itemThemes:n}=J.storeToRefs(e),{stateCard:r,recountGroupTotalAmount:s,groupTotalAmount:a}=J.storeToRefs(t),l=o.ref(null),c=o.ref({}),u=(_,f)=>{f instanceof HTMLElement?c.value[_]=f:c.value[_]=null};o.watch(()=>r.value.isAnimationFly,_=>{_===!0&&r.value.currentModifier&&(h(c.value[r.value.currentModifier.id]),r.value.isAnimationFly=!1),document.body.style.overflow=""});const d=()=>{r.value.isSectionModifier=!1,document.body.style.overflow="scroll"},h=_=>{if(!_)return;const f=r.value.groupModifiers.findIndex(w=>w.id===r.value.groupCurrentOpen.id),m=r.value.plusButtonsRefs[f]||r.value.plusButtonsRefs[0];if(!m)return;const p=_.getBoundingClientRect(),g=m.getBoundingClientRect(),y=_.cloneNode(!0);y.classList.add("flyer"),Object.assign(y.style,{width:`${p.width}px`,height:`${p.height}px`,left:`${p.left}px`,top:`${p.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(y),l.value=y,requestAnimationFrame(()=>{const w=g.left+g.width/3-(p.left+p.width/2),x=g.top+g.height/4-(p.top+p.height/2),T=g.width/p.width*.2;y.style.transform=`translate(${w}px, ${x}px) scale(${T})`,y.style.opacity="0.4",y.style.transition="transform 0.5s ease, opacity 0.5s ease"}),y.addEventListener("transitionend",()=>{y.remove(),l.value=null,m.classList.add("bump"),setTimeout(()=>m.classList.remove("bump"),300)},{once:!0})};return(_,f)=>(o.openBlock(),o.createBlock(o.Transition,{name:"modifiers"},{default:o.withCtx(()=>{var m,p,g,y,w,x,T,S,B,k,b,C;return[i.isModified?(o.openBlock(),o.createElementBlock("div",Ef,[o.createElementVNode("div",Tf,[o.createElementVNode("div",{class:o.normalizeClass(["card_header_inner_back",[(m=o.unref(r).openCard)!=null&&m.proteins_amount?"card_header_inner_back_nutrients":""]]),onClick:d,"aria-label":"Закрыть выбор модификаторов"},[o.createVNode(so,{class:"arrow_bottom"})],2),o.createElementVNode("div",vf,[(p=o.unref(r).openCard)!=null&&p.energy_amount?(o.openBlock(),o.createElementBlock("div",Nf,[o.createElementVNode("b",null,o.toDisplayString((g=o.unref(r).openCard)==null?void 0:g.energy_amount),1),f[2]||(f[2]=o.createElementVNode("p",null,"Килокалории",-1))])):o.createCommentVNode("",!0),(y=o.unref(r).openCard)!=null&&y.proteins_amount?(o.openBlock(),o.createElementBlock("div",Mf,[o.createElementVNode("b",null,o.toDisplayString((w=o.unref(r).openCard)==null?void 0:w.proteins_amount),1),f[3]||(f[3]=o.createElementVNode("p",null,"Белки",-1))])):o.createCommentVNode("",!0),(x=o.unref(r).openCard)!=null&&x.fat_amount?(o.openBlock(),o.createElementBlock("div",Pf,[o.createElementVNode("b",null,o.toDisplayString((T=o.unref(r).openCard)==null?void 0:T.fat_amount),1),f[4]||(f[4]=o.createElementVNode("p",null,"Жиры",-1))])):o.createCommentVNode("",!0),(S=o.unref(r).openCard)!=null&&S.carbohydrates_amount?(o.openBlock(),o.createElementBlock("div",Af,[o.createElementVNode("b",null,o.toDisplayString((B=o.unref(r).openCard)==null?void 0:B.carbohydrates_amount),1),f[5]||(f[5]=o.createElementVNode("p",null,"Углеводы",-1))])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",Bf,[o.createElementVNode("p",Rf,o.toDisplayString((k=o.unref(r).groupCurrentOpen)==null?void 0:k.name),1),o.createElementVNode("p",Df,"Выбрано "+o.toDisplayString(o.unref(s))+" из "+o.toDisplayString(o.unref(a)),1),o.createElementVNode("div",{class:o.normalizeClass((b=o.unref(r).groupModifiers.find(P=>{var O;return P.id===((O=o.unref(r).groupCurrentOpen)==null?void 0:O.id)}))!=null&&b.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column"),onTouchstart:f[0]||(f[0]=o.withModifiers(()=>{},["stop"])),onPointerdown:f[1]||(f[1]=o.withModifiers(()=>{},["stop"]))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((C=o.unref(r).groupCurrentOpen)==null?void 0:C.group_modifiers)||[],P=>{var O,H,R;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["modifier_card",{hidden_modifier_card:P.default_amount===0&&((O=o.unref(r).groupCurrentOpen)==null?void 0:O.id)==="Добавки2000"&&P.min_amount===0&&P.max_amount===0}]),key:P.id,onClick:N=>o.unref(t).modifierSelect(P),onKeydown:o.withKeys(N=>o.unref(t).modifierSelect(P),["enter"]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${P.name}`,ref_for:!0,ref:N=>u(P.id,N)},[o.createElementVNode("div",{class:o.normalizeClass([{modifier_card_active:o.unref(r).groupModifiersSelected.some(N=>{var E;return N.group===((E=o.unref(r).groupCurrentOpen)==null?void 0:E.id)&&N.modifiers.some(M=>M.id===P.id)})},"wrapper_image_corners"])},[P.amount>1?(o.openBlock(),o.createElementBlock("div",$f,o.toDisplayString(P.amount),1)):o.createCommentVNode("",!0),o.createElementVNode("div",If,[P.video_link?(o.openBlock(),o.createElementBlock("video",Lf,[o.createElementVNode("source",{src:P.video_link||"",type:"video/webm"},null,8,Ff)])):(o.openBlock(),o.createElementBlock("img",{key:0,class:"modifier_image",src:P.image_link||o.unref(n).fallback_image||"",alt:P.name},null,8,Vf)),o.createElementVNode("div",{class:o.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:P.min_amount>0||P.required}])},[o.createElementVNode("h3",zf,o.toDisplayString(P.name),1),o.createElementVNode("p",null,"+"+o.toDisplayString(((R=(H=P.sizes)==null?void 0:H.find(N=>N.id===o.unref(r).selectedSize.id))==null?void 0:R.price)||P.price||0)+"₽",1)],2)])],2)],42,Of)}),128))],34)])])):o.createCommentVNode("",!0)]}),_:1}))}}),[["__scopeId","data-v-4b716357"]]),Hf={key:0,class:"card_size_place"},qf=["onClick","onKeydown","aria-label"],Wf={key:1,class:"card_size static"},jf=["onClick","onKeydown","aria-label"],ao=3,Xf=ke(o.defineComponent({__name:"SizeModifier",setup(i){const e=Ke(),{stateCard:t}=J.storeToRefs(e),n=o.ref(null),r=o.ref(50),s=o.ref(),a=o.ref(0),l=o.ref(0),c=o.ref(null),u=o.computed(()=>{var w;if(t.value.productSizes.length<=3)return t.value.productSizes[s.value.index]||t.value.productSizes[0];const g=a.value+1,y=((w=h.value[g])==null?void 0:w.originalIndex)??1;return t.value.productSizes[y]}),d=()=>{c.value&&t.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/ao)},h=o.computed(()=>{if(t.value.productSizes.length<=3)return t.value.productSizes;const g=t.value.productSizes;return[...g.map((y,w)=>({...y,originalIndex:w})),...g.map((y,w)=>({...y,originalIndex:w})),...g.map((y,w)=>({...y,originalIndex:w}))]}),_=(g,y)=>{if(s.value={id:g.id,title:g.name,index:y,is_default:g.is_default},g.price!==null&&t.value.openCard&&(t.value.openCard={...t.value.openCard,price:g.price}),t.value.selectedSize=g,t.value.productSizes.length>3){d();const w=a.value+1;y<w?f():y>w&&m()}else{const w=t.value.productSizes.length,x=(y+.5)*(100/w);r.value=x}},f=()=>{var g;if(!(t.value.productSizes.length<=3)){if(a.value--,a.value<t.value.productSizes.length-ao+1){a.value+=t.value.productSizes.length;const y=(g=c.value)==null?void 0:g.querySelector(".card_size");y&&(y.style.transition="none",y.style.transform=`translateX(-${a.value*l.value}px)`,y.offsetHeight,y.style.transition="transform 0.2s ease-in-out")}p()}},m=()=>{var g;if(!(t.value.productSizes.length<=3)){if(a.value++,a.value>=t.value.productSizes.length*2){a.value-=t.value.productSizes.length;const y=(g=c.value)==null?void 0:g.querySelector(".card_size");y&&(y.style.transition="none",y.style.transform=`translateX(-${a.value*l.value}px)`,y.offsetHeight,y.style.transition="transform 0.2s ease-in-out")}p()}},p=()=>{var x;if(t.value.productSizes.length<=3)return;const g=a.value+1,y=((x=h.value[g])==null?void 0:x.originalIndex)??0,w=t.value.productSizes[y];s.value={id:w.id,title:w.name,index:y,is_default:w.is_default}};return o.watch(()=>[t.value.productSizes,c.value],([g=[],y])=>{if(Array.isArray(g)&&g.length>0&&y!==null){let w=g.findIndex(x=>x.is_default===!0);g.length<3&&n.value&&parseInt(n.value.style.minWidth)<767&&(n.value.style.width="100px"),w>-1?(a.value=w,_(g[w],w),l.value=120/ao):g.length===2||g.length===1?(_(g[0],0),r.value=(0+.5)*(100/2)):(_(g[1],1),r.value=(1+.5)*(100/3))}}),o.watch(()=>{var g;return[(g=t.value.selectedSize)==null?void 0:g.id,t.value.groupModifiersSelected]},([g,y])=>{if(!g||!Array.isArray(y))return;const w=y.map(x=>({...x,modifiers:x.modifiers.map(T=>{if(!T.sizes||T.sizes.length===0)return T;const S=T.sizes.find(B=>B.id===g);return S?{...T,size:S,price:S.price??T.price}:T})}));JSON.stringify(w)!==JSON.stringify(t.value.groupModifiersSelected)&&(t.value.groupModifiersSelected=w)},{deep:!0}),o.onBeforeUnmount(()=>{window.removeEventListener("resize",d)}),(g,y)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:n},[o.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[o.unref(t).productSizes.length>1&&s.value?(o.openBlock(),o.createElementBlock("div",Hf,[o.unref(t).productSizes.length>3?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"card_size",style:o.normalizeStyle({transform:`translateX(-${a.value*l.value}px)`})},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h.value,(w,x)=>(o.openBlock(),o.createElementBlock("li",{key:`${w.id}-${x}`,onClick:T=>_(w,x),onKeydown:o.withKeys(T=>_(w,x),["enter"]),class:o.normalizeClass({active:s.value.id===w.id&&s.value.index===w.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${w.name}`},o.toDisplayString(w.alt_name?w.alt_name:w.name),43,qf))),128))],4)):(o.openBlock(),o.createElementBlock("ul",Wf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(t).productSizes,(w,x)=>(o.openBlock(),o.createElementBlock("li",{key:`${w.id}-${x}`,onClick:T=>_(w,x),onKeydown:o.withKeys(T=>_(w,x),["enter"]),class:o.normalizeClass({active:s.value.id===w.id&&s.value.index===x}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${w.name}`},o.toDisplayString(w.alt_name?w.alt_name:w.name),43,jf))),128))])),u.value?(o.openBlock(),o.createElementBlock("div",{key:2,class:"size_active",style:o.normalizeStyle(o.unref(t).productSizes.length<=3?{left:`${r.value}%`}:{})},[o.createElementVNode("p",null,o.toDisplayString(u.value.alt_name?u.value.alt_name:u.value.name),1)],4)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],512)],512)),[[o.vShow,o.unref(t).productSizes.length>1&&s.value]])}}),[["__scopeId","data-v-2571f98b"]]),Yf="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",Gf={class:"counter_container"},Kf={class:"card_size_place_wrapper",ref:"sliderWrapper"},Jf={class:"cart_amount_counter"},Zf={class:"button_circle_number"},Qf=ke(o.defineComponent({__name:"NumberModifier",setup(i){const e=Ke(),{stateCard:t}=J.storeToRefs(e),n=()=>{var s,a;(s=t.value.openCard)!=null&&s.amount&&((a=t.value.openCard)==null?void 0:a.amount)>1&&(t.value.openCard.amount-=1)},r=()=>{var s;(s=t.value.openCard)!=null&&s.amount&&(t.value.openCard.amount+=1)};return(s,a)=>{var l,c;return o.openBlock(),o.createElementBlock("div",Gf,[o.createElementVNode("div",Kf,[o.createElementVNode("div",Jf,[o.createElementVNode("p",{class:o.normalizeClass(["cart_circle_minus",[((l=o.unref(t).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:o.withModifiers(n,["stop","prevent"])},[...a[0]||(a[0]=[o.createElementVNode("span",null,null,-1)])],2),o.createElementVNode("p",Zf,o.toDisplayString((c=o.unref(t).openCard)==null?void 0:c.amount),1),o.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:o.withModifiers(r,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-c3d45434"]]);function Pa(i,e=800){const t=o.ref(i),n=o.ref(i);let r=null,s=null,a=i;const l=c=>{s||(s=c);const u=c-s,d=Math.min(u/e,1),h=d<.5?4*d*d*d:1-Math.pow(-2*d+2,3)/2;t.value=Math.round(a+(n.value-a)*h),d<1?r=requestAnimationFrame(l):(t.value=n.value,r=null)};return o.watch(n,()=>{r&&cancelAnimationFrame(r),a=t.value,s=null,r=requestAnimationFrame(l)},{immediate:!0}),o.onUnmounted(()=>{r&&cancelAnimationFrame(r)}),{displayNumber:t,targetNumber:n,update:c=>{n.value=c}}}const Mt=o.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(i){const e=i,{displayNumber:t,update:n}=Pa(e.price||0,e.duration||800);return o.watchEffect(()=>{n(e.price)}),(r,s)=>(o.openBlock(),o.createElementBlock("span",null,o.toDisplayString(o.unref(t).toFixed(i.fixedFloat)),1))}}),eh=["disabled","id"],en=o.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(i){const e=i,t=()=>{e.onClick()};return(n,r)=>(o.openBlock(),o.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:i.disabled,onClick:t,id:i.disabled?"buttonDefaultDisabled":""},o.toDisplayString(i.textButtonDefault),9,eh))}}),th={class:"notification_info"},nh={key:0,class:"notification_18plus"},rh={class:"notification_18plus_image"},ih=["src"],oh={class:"notification_18plus_text"},sh={class:"notification_18plus_accept"},ah={key:1,class:"notification_text"},lh={key:0,class:"wrapper_button_accept"},lo=o.defineComponent({__name:"NotificationWindow",props:o.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(i){const e=i,t=Ge(),n=Le(),{is18Allowed:r}=J.storeToRefs(n),{itemThemes:s}=J.storeToRefs(t),a=o.computed(()=>e.backgroundColor||"rgba(50, 50, 50, 0.9)"),l=o.useModel(i,"visible"),c=()=>{sessionStorage.setItem("is_adult","true"),r.value=!0,l.value=!1},u=()=>{l.value=!1};return(d,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.Transition,{name:"notificationBlack",appear:""},{default:o.withCtx(()=>[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"notification_background_black",onClick:u})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{name:"notification",appear:""},{default:o.withCtx(()=>{var _;return[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"notification_overlay",onClick:u},[o.createElementVNode("div",{class:"notification_wrapper",style:o.normalizeStyle({"background-color":a.value,border:`2px solid ${a.value}`})},[o.createElementVNode("div",th,[i.type?(o.openBlock(),o.createElementBlock("div",nh,[o.createElementVNode("div",rh,[o.createElementVNode("img",{src:o.unref(s).adult_disclaimer_image||o.unref(s).fallback_image,alt:"Дисклеймер"},null,8,ih)]),o.createElementVNode("div",oh,o.toDisplayString(o.unref(s).adult_disclaimer_text),1),o.createElementVNode("div",sh,[h[0]||(h[0]=o.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой.",-1)),o.createVNode(en,{textButtonDefault:"Мне есть 18",onClick:c,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(o.openBlock(),o.createElementBlock("div",ah,[o.createTextVNode(o.toDisplayString(i.textNotificationDefault)+" ",1),(_=i.buttonAccept)!=null&&_.state?(o.openBlock(),o.createElementBlock("div",lh,[o.createVNode(en,{class:"button_accept",textButtonDefault:i.buttonAccept.text,onClick:i.buttonAccept.acceptBtn,disabled:i.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):o.createCommentVNode("",!0)]))])],4)])):o.createCommentVNode("",!0)]}),_:1})],64))}}),ch={class:"button_price button_price_modifiers"},uh=["src"],dh={class:"button_text_container"},fh={class:"button_text_price"},hh=ke(o.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(i){const e=re.useRouter(),t=re.useRoute(),n=Ke(),r=Le(),s=Ge(),a=o.ref([]),l=o.ref([]),c=i,{stateCard:u,totalPrice_libCard:d,isOpenWindow:h,isAddToCard:_}=J.storeToRefs(n),{itemThemes:f}=J.storeToRefs(s),m=o.ref(!0),p=o.ref(!1),g=()=>{var w,x,T,S,B,k;if(m.value){n.setCurrentCard(u.value.openCard),p.value=!0;const b=u.value.groupModifiers.findIndex(C=>n.checkedRequiredBtn.group.id===C.id);n.checkedRequiredBtn.haveRequaire&&n.toggleNotRequire(n.checkedRequiredBtn.group,b);return}const y=u.value.groupModifiersSelected||[];if(a.value=[],l.value=[],Array.isArray(y)&&y.length>0&&y.forEach(b=>{const C=b.group,P=b.modifiers||[];C==="Добавки2000"?a.value=P.map(O=>{var H;return{...O,old_price:O.price,size:Array.isArray(O.size)?O.size.map(R=>R.id).filter(Boolean):(H=O.size)!=null&&H.id?O.size.id:void 0}}):P.length>0&&l.value.push({group:C,modifiers:P.map(O=>{var H;return{...O,old_price:O.price,size:Array.isArray(O.size)?O.size.map(R=>R.id).filter(Boolean):(H=O.size)!=null&&H.id?O.size.id:void 0}})})}),document.body.style.overflow="",u.value.openCard){const b={id:u.value.openCard.id,is_fake:u.value.openCard.is_fake||!1,amount:u.value.openCard.amount,name:u.value.openCard.name,image_link:u.value.openCard.image_link,price:u.value.openCard.price,old_price:u.value.openCard.price,size:((w=u.value.selectedSize)==null?void 0:w.id)??((T=(x=u.value.openCard.sizes)==null?void 0:x.find(C=>C.is_default))==null?void 0:T.id),sizes:((S=u.value.selectedSize)==null?void 0:S.id)??((k=(B=u.value.openCard.sizes)==null?void 0:B.find(C=>C.is_default))==null?void 0:k.id),modifiers:a.value,group_modifiers:l.value,energy_amount:u.value.openCard.energy_amount??0,proteins_amount:u.value.openCard.proteins_amount??0,fat_amount:u.value.openCard.fat_amount??0,carbohydrates_amount:u.value.openCard.carbohydrates_amount??0};c.closeProduct&&c.closeProduct(),r.addToCart(b),_.value=!0}h.value=!1,e.push(`/${t.params.orgId}/`)};return o.watch(()=>u.value.productSizes,y=>{!y||y.length===0||!u.value.selectedSize||(u.value.selectedSize={...u.value.selectedSize})},{immediate:!0}),o.watchEffect(()=>{n.checkedRequiredBtn.haveRequaire?m.value=!0:m.value=!1}),o.onMounted(()=>{_.value=!1}),(y,w)=>(o.openBlock(),o.createElementBlock("div",{class:"button_price_bg_product",onTouchstart:w[3]||(w[3]=o.withModifiers(()=>{},["stop"])),onPointerdown:w[4]||(w[4]=o.withModifiers(()=>{},["stop"]))},[o.createVNode(lo,{visible:p.value,textNotificationDefault:o.unref(u).textErrorRequaired,backgroundColor:o.unref(f).accent_color?o.unref(f).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":w[0]||(w[0]=x=>p.value=x)},null,8,["visible","textNotificationDefault","backgroundColor"]),o.createElementVNode("div",ch,[o.createVNode(Qf),o.createElementVNode("div",{class:o.normalizeClass(["card_product_button_buy",{buy_active:!m.value}]),"data-clickable":"true",onClick:g,onTouchstart:w[1]||(w[1]=o.withModifiers(()=>{},["stop"])),onPointerdown:w[2]||(w[2]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("img",{src:o.unref(Yf),class:"card_product_button_icon"},null,8,uh),o.createElementVNode("div",dh,[o.createElementVNode("p",fh,[o.createVNode(Mt,{price:+o.unref(d),fixedFloat:2},null,8,["price"]),w[5]||(w[5]=o.createTextVNode(" ₽ ",-1))])])],34)])],32))}}),[["__scopeId","data-v-dcf9a7ff"]]),ph={class:"modified_amount"},mh={class:"hide_image_corners"},_h=["src"],gh={class:"wrapper_modifier_title"},yh={class:"amount_title"},bh={class:"wrapper_amount_counter"},wh={class:"amount_count"},xh={class:"amount_wrapper"},kh={class:"add_counter_amount"},Sh=ke(o.defineComponent({__name:"ModalAmount",setup(i){const e=Ke(),t=Ge(),{itemThemes:n}=J.storeToRefs(t),{stateCard:r}=J.storeToRefs(e),s=o.computed(()=>{var c,u,d;return((d=(u=(c=r.value.currentModifier)==null?void 0:c.sizes)==null?void 0:u.find(h=>h.id===r.value.selectedSize.id))==null?void 0:d.price)??dr(r.value.currentModifier)}),a=()=>{r.value.currentModifier&&(r.value.currentModifier.amount=r.value.modalCount),e.modifierSelect(r.value.currentModifier),r.value.isModifiedAmount=!1},l=()=>{r.value.modalCount=1,r.value.currentModifier.amount=1};return(c,u)=>{var d,h;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",ph,[o.createElementVNode("div",mh,[o.createElementVNode("img",{class:"modifier_image",src:((d=o.unref(r).currentModifier)==null?void 0:d.image_link)||o.unref(n).fallback_image||""},null,8,_h),o.createElementVNode("div",gh,[o.createElementVNode("p",yh,o.toDisplayString((h=o.unref(r).currentModifier)==null?void 0:h.name),1),o.createElementVNode("p",null,"+ "+o.toDisplayString(s.value)+"₽",1)])])]),o.createElementVNode("div",bh,[o.createElementVNode("div",{class:"amount_mines",onClick:u[0]||(u[0]=o.withModifiers((..._)=>o.unref(e).minusAmount&&o.unref(e).minusAmount(..._),["stop"]))},[...u[1]||(u[1]=[o.createElementVNode("div",null,null,-1)])]),o.createElementVNode("p",wh,o.toDisplayString(o.unref(r).modalCount),1),o.createElementVNode("div",xh,[o.createVNode(oo,{onClick:o.withModifiers(o.unref(e).plusAmount,["stop"])},null,8,["onClick"])])]),o.createElementVNode("p",{class:"clear_count",onClick:o.withModifiers(l,["stop"])},"Убрать все"),o.createElementVNode("div",kh,[o.createVNode(en,{textButtonDefault:"Добавить",onClick:a,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-6b4f039c"]]),Aa=o.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(i){const e=i;return o.watch(()=>e.data,t=>{document.body.style.overflow=t?"hidden":""}),()=>{}}}),Ch={class:"card_product_wrapper"},Eh={class:"card__pictures"},Th={key:0,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},vh=["src"],Nh=["src"],Mh={class:"card_header_wrapper"},Ph={key:0,class:"card_fire_kkal_wrapper"},Ah={class:"card_content"},Bh={class:"wrapper_size"},Rh={key:0,class:"upsell_wrapper"},Dh={key:1,class:"description"},Oh={key:2,id:"openSelectionModifiers"},$h=ke(o.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(i){const e=Ge(),t=Ke(),{stateCard:n,isOpenWindow:r,dataUpSale:s}=J.storeToRefs(t),{itemThemes:a}=J.storeToRefs(e),l=re.useRouter(),c=re.useRoute(),u=i,d=()=>{u.configPage.qr_menu?l.push(`/${c.params.orgId}`):u.configPage.closeProduct(),document.body.style.overflow="auto"},h=()=>{n.value.isModifiedAmount=!1};return o.watch(()=>u.configPage.data,_=>{t.setCurrentCard(_)}),o.watchEffect(()=>{document.body.style.overflow="",r.value||(r.value=u.configPage.is_closeProduct)}),o.onBeforeUnmount(()=>{t.reset(),document.body.style.overflow=""}),(_,f)=>{var p,g,y,w,x,T,S,B,k,b;const m=o.resolveComponent("Upsell");return o.openBlock(),o.createElementBlock("div",Ch,[o.createVNode(Aa,{data:o.unref(n).isModifiedAmount},null,8,["data"]),o.unref(n).isModifiedAmount?(o.openBlock(),o.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:o.withModifiers(h,["stop"])},[o.createVNode(Sh)])):o.createCommentVNode("",!0),o.createElementVNode("div",Eh,[o.createElementVNode("div",{class:"card__pictures__gradient",style:o.normalizeStyle(o.unref(a).gradientStyle)},null,4),(p=o.unref(n).openCard)!=null&&p.video_link?(o.openBlock(),o.createElementBlock("video",Th,[o.createElementVNode("source",{src:((g=o.unref(n).openCard)==null?void 0:g.video_link)??"",type:"video/webm"},null,8,vh)])):(o.openBlock(),o.createElementBlock("img",{key:1,class:"card__pictures_images",src:((y=o.unref(n).openCard)==null?void 0:y.image_link)||o.unref(a).fallback_image||"",alt:"Product image"},null,8,Nh)),o.createElementVNode("div",Mh,[o.createVNode(so,{class:"card_header_back",onClick:d,"aria-label":"Вернуться назад"}),(w=o.unref(n).openCard)!=null&&w.energy_amount?(o.openBlock(),o.createElementBlock("div",Ph,[f[1]||(f[1]=o.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),o.createElementVNode("p",null,[o.createElementVNode("b",null,o.toDisplayString((x=o.unref(n).openCard)==null?void 0:x.energy_amount),1),f[0]||(f[0]=o.createTextVNode(" Ккал ",-1))])])):o.createCommentVNode("",!0)]),o.createElementVNode("h4",null,o.toDisplayString((T=o.unref(n).openCard)==null?void 0:T.name),1)]),o.createVNode(Uf,{isModified:o.unref(n).isSectionModifier},null,8,["isModified"]),o.createElementVNode("div",Ah,[o.withDirectives(o.createElementVNode("div",Bh,[o.createVNode(Xf)],512),[[o.vShow,!o.unref(n).isSectionModifier]]),(S=o.unref(n).openCard)!=null&&S.upsell_set&&!o.unref(n).isSectionModifier?(o.openBlock(),o.createElementBlock("div",Rh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((B=o.unref(n).openCard)==null?void 0:B.upsell_set.upsell_items)||[],C=>(o.openBlock(),o.createBlock(m,{key:C.id,data:C,is_upsell:!0},null,8,["data"]))),128))])):o.createCommentVNode("",!0),!o.unref(n).isSectionModifier&&((k=o.unref(n).openCard)!=null&&k.description)?(o.openBlock(),o.createElementBlock("p",Dh,o.toDisplayString((b=o.unref(n).openCard)==null?void 0:b.description),1)):o.createCommentVNode("",!0),o.unref(n).groupModifiers.length?(o.openBlock(),o.createElementBlock("div",Oh,[f[2]||(f[2]=o.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),o.createVNode(xf,{isSectionModifier:o.unref(n).isSectionModifier,toggleNotRequire:o.unref(t).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):o.createCommentVNode("",!0),o.createVNode(hh,{qr_menu:i.configPage.qr_menu,closeProduct:i.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-c420b27b"]]),Ih={key:0,class:"popupWindowDefault_overlay"},Ba=ke(o.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,r=()=>{n("update:visible",!1)};return o.watch(()=>t.visible,async s=>{s&&await o.nextTick(),t.isVisible=s}),(s,a)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:a[0]||(a[0]=()=>{n("update:visible",!1)})},{default:o.withCtx(()=>[t.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:"background_black",onClick:r})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:a[1]||(a[1]=()=>{n("update:visible",!1)})},{default:o.withCtx(()=>[t.visible?(o.openBlock(),o.createElementBlock("div",Ih,[o.renderSlot(s.$slots,"default",{},void 0,!0)])):o.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),Vh={},Lh={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fh(i,e){return o.openBlock(),o.createElementBlock("svg",Lh,[...e[0]||(e[0]=[o.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 zh=ke(Vh,[["render",Fh]]),co=J.defineStore("modals",()=>{const i=new Map,e=(r,s)=>{const a=n(r).value;a.visible=!0,a.context=s},t=r=>{const s=n(r).value;s.visible=!1},n=r=>(i.has(r)||i.set(r,o.ref({visible:!1})),i.get(r));return{state:n,open:e,close:t}}),Uh=["src"],Hh={class:"cart_box_content_wrapper"},qh={class:"cart_box_content_info"},Wh={class:"cart_amount"},jh={class:"cart_amount_count"},Xh={class:"cart_box_info_more"},Yh={key:1,class:"cart_modifier_info"},Gh={class:"cart_modifier_content"},Kh={class:"wrapper_price_count_cart"},Jh={class:"count_cart_box"},Zh={class:"wrapper_modifiers_discount"},Ra=ke(o.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(i,{emit:e}){const t=i,n=Le(),r=Ge(),s=co(),{itemThemes:a}=J.storeToRefs(r),l=o.ref(0),c=o.ref(0),u=o.ref(!1),d=o.ref(!1),h=o.ref(!1),{displayNumber:_,update:f}=Pa(0,800),m=o.computed(()=>{var P,O;const b=((P=t.cardItem)==null?void 0:P.modifiers)??[],C=(((O=t.cardItem)==null?void 0:O.group_modifiers)??[]).flatMap(H=>H.modifiers??[]);return[...b,...C]}),p=o.computed(()=>{var b,C;return((b=t.cardItem)==null?void 0:b.total_new_price)||dr(t.cardItem)*((C=t.cardItem)==null?void 0:C.amount)}),g=()=>s.open("cart-delete-confirm",t.cardItem),y=()=>{h.value=!h.value},w=()=>{n.plusAmount(t.cardItem.idSystem)},x=()=>{t.cardItem.amount>1?n.minusAmount(t.cardItem.idSystem):g()},T=b=>{l.value=b.touches[0].clientX,u.value=!0},S=b=>{u.value&&(c.value=b.touches[0].clientX-l.value,c.value>0&&(c.value=0))},B=()=>{u.value=!1,c.value<-115&&g(),c.value=0};o.onMounted(()=>{t.index===0&&(d.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,d.value=!1},700)},0))});const k=o.computed(()=>{const b=t.index===0&&d.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:b,transition:u.value?"none":"transform 0.7s, opacity 0.7s"}});return o.watch(p,f,{immediate:!0}),(b,C)=>{var P,O,H,R,N;return o.openBlock(),o.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:T,onTouchmove:S,onTouchend:B,style:o.normalizeStyle(k.value)},[C[2]||(C[2]=o.createElementVNode("div",{class:"wrapper_cart_delete"},[o.createElementVNode("div",{class:"cart_delete"})],-1)),o.createElementVNode("img",{src:((P=i.cardItem)==null?void 0:P.image_link)||o.unref(a).fallback_image||"",class:"cart_box_image"},null,8,Uh),o.createElementVNode("div",Hh,[o.createElementVNode("div",qh,[o.createElementVNode("p",null,o.toDisplayString((O=i.cardItem)==null?void 0:O.name),1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((H=t.cardItem)==null?void 0:H.discounts)||[],(E,M)=>(o.openBlock(),o.createElementBlock("div",{key:M,class:"discount_banner"},[o.createElementVNode("p",null,o.toDisplayString(E.name),1),o.createElementVNode("p",null,o.toDisplayString(E.discount)+"₽",1)]))),128)),o.createElementVNode("div",Wh,[o.createElementVNode("button",{onClick:x},"-"),o.createElementVNode("p",jh,o.toDisplayString(t.cardItem.amount),1),o.createElementVNode("button",{onClick:w},"+")])]),o.createElementVNode("div",Xh,[o.createElementVNode("div",{class:"cart_box_remove_item",onClick:g},[o.createVNode(zh)]),(R=t.cardItem)!=null&&R.new_price?(o.openBlock(),o.createElementBlock("p",{key:0,class:o.normalizeClass({discount_new_price:(N=t.cardItem)==null?void 0:N.new_price})},o.toDisplayString((t.cardItem.new_price*t.cardItem.amount).toFixed(2)+"₽"),3)):o.createCommentVNode("",!0),o.createElementVNode("p",null,o.toDisplayString(o.unref(_).toFixed(2)+"₽"),1)])]),!h.value&&m.value.length>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:o.withModifiers(y,["stop"])},[...C[0]||(C[0]=[o.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),o.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):o.createCommentVNode("",!0),h.value?(o.openBlock(),o.createElementBlock("div",Yh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,E=>{var M;return o.openBlock(),o.createElementBlock("div",{class:"cart_modifier_item",key:E.id},[o.createElementVNode("div",Gh,[o.createVNode(oo,{id:"plus_orange"}),o.createElementVNode("p",null,o.toDisplayString(E.name),1)]),o.createElementVNode("div",Kh,[o.createElementVNode("p",Jh,o.toDisplayString(`x${E.amount}`),1),o.createElementVNode("div",Zh,[E!=null&&E.new_price?(o.openBlock(),o.createElementBlock("p",{key:0,class:o.normalizeClass({discount_new_price:(M=E==null?void 0:E.new_price)==null?void 0:M.toFixed(2)})},o.toDisplayString((E.new_price*E.amount).toFixed(2)+"₽"),3)):o.createCommentVNode("",!0),o.createElementVNode("p",null,o.toDisplayString((E.total_new_price||E.price*E.amount).toFixed(2)+"₽"),1)])])])}),128)),o.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:o.withModifiers(y,["stop"])},[...C[1]||(C[1]=[o.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),o.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):o.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-491ab42e"]]),Qh={},ep={class:"nfc_x",viewBox:"0 0 48 48"};function tp(i,e){return o.openBlock(),o.createElementBlock("svg",ep,[...e[0]||(e[0]=[o.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),o.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const np=ke(Qh,[["render",tp]]),rp={},ip={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function op(i,e){return o.openBlock(),o.createElementBlock("svg",ip,[...e[0]||(e[0]=[o.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),o.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),o.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const sp=ke(rp,[["render",op]]),ap={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},lp=o.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(i){return(e,t)=>i.styleRetry?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("svg",ap,[...t[0]||(t[0]=[o.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),o.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),cp={class:"sheet_header"},up={class:"sheet_title",id:"sheetTitle"},dp={class:"sheet_body"},fp={class:"sheet_card"},hp={class:"nfc_title"},pp={class:"lead"},mp={class:"wrapper_input_accept"},_p={key:0,class:"card_phone_auth_wrapper"},gp={class:"sr_only","aria-live":"polite"},Da=o.defineComponent({__name:"CardReader",setup(i){const e=Le(),t=Ge(),{is_OpenLoyal:n}=J.storeToRefs(e),{itemThemes:r}=J.storeToRefs(t),s=zn(),a=o.ref(),l=o.ref(),c=o.ref(null),u=o.ref(""),d={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},h=o.computed({get:()=>u.value,set:A=>{u.value=A.replace(/\s/g,"")}}),_=o.computed(()=>s.currentState),f=o.computed(()=>s.isDrawerOpen),m=o.computed(()=>{var A;return((A=d[_.value])==null?void 0:A.text)||""}),p=o.computed(()=>{var A;(A=d[_.value])!=null&&A.title}),g=o.computed(()=>_.value==="success"?"Добро пожаловать!":r.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),y=o.computed(()=>({ok:_.value==="success",warn:_.value==="not_found"})),w=o.computed(()=>{const A=[];return _.value==="wait"&&A.push("pulse","show-x"),_.value==="not_found"&&A.push("pulse","show-x"),_.value==="success"&&A.push("pulse","show-ok"),A}),x=o.computed(()=>_.value==="not_found"),T=o.computed(()=>_.value==="success"),S=o.computed(()=>_.value==="not_found"),B=o.computed(()=>["not_found"].includes(_.value)),k=o.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[_.value]||""),b=()=>{s.closeDrawer(),n.value=!0},C=async A=>{var $,V;s.error="",c.value=null;try{const F=new Qt;await F.authorizeByCard(A.trim()),await F.getProfile(),e.loadCart(),s.setState("success"),s.isDrawerOpen=!1,s.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(F){s.error=((V=($=F.response)==null?void 0:$.data)==null?void 0:V.user_friendly_message)||"Ошибка",s.setState("not_found"),c.value=h.value,h.value=""}},P=()=>{var A;s.setState("wait"),s.error="",h.value="",c.value=null,(A=a.value)==null||A.focus()},O=()=>{s.closeDrawer(),c.value=null,h.value=""},H=()=>{var A,$;s.setState("wait"),($=(A=h.value)==null?void 0:A.trim())!=null&&$.length&&C(h.value.trim())},R=A=>{A.stopPropagation(),document.activeElement!==l.value&&N()},N=()=>{o.nextTick(()=>{l.value&&(l.value.focus(),u.value&&l.value.select())})},E=A=>{const $=document.activeElement===l.value;if(!f.value||$)return;const V=A.key.toLowerCase();if(V==="backspace")return h.value=h.value.slice(0,-1);if(V==="escape")return O();if(V==="r"&&S.value)return P();if(V==="c"&&_.value==="success")return O();if(V==="enter")return H();h.value+=V},M={mounted(A){A==null||A.focus()}};return o.onMounted(()=>{document==null||document.addEventListener("keydown",E)}),o.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",E)}),o.watchEffect(()=>{f.value&&(s.error="")}),(A,$)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[f.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"backdrop show",onClick:O,"aria-hidden":"true"})):o.createCommentVNode("",!0),f.value?(o.openBlock(),o.createElementBlock("section",{key:1,class:o.normalizeClass(["sheet show",{sheet_retry:S.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:R},[o.createElementVNode("header",cp,[o.createElementVNode("div",up,o.toDisplayString(m.value),1),S.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["sheet_status",y.value])},o.toDisplayString(c.value),3)):o.createCommentVNode("",!0),o.createElementVNode("button",{class:"sheet_close",onClick:O,"aria-label":"Закрыть"}," Закрыть ")]),o.createElementVNode("div",dp,[o.createElementVNode("div",fp,[o.createElementVNode("div",{class:o.normalizeClass(["nfc",w.value])},[o.createVNode(lp,{styleRetry:B.value},null,8,["styleRetry"]),x.value?(o.openBlock(),o.createBlock(np,{key:0})):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"overlay check",style:o.normalizeStyle({display:T.value?"grid":"none"}),"aria-hidden":"true"},[o.createVNode(sp)],4)],2),o.createElementVNode("h2",hp,o.toDisplayString(p.value),1),o.createElementVNode("p",pp,o.toDisplayString(g.value),1),o.createElementVNode("div",mp,[o.withDirectives(o.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":$[0]||($[0]=V=>h.value=V),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:o.withKeys(H,["enter"])},null,544),[[o.vModelText,h.value],[M]]),S.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:P},"Повторить")):(o.openBlock(),o.createElementBlock("button",{key:1,class:"btn btn_ghost",onClick:$[1]||($[1]=V=>S.value?O:H())},"Отправить"))]),_.value==="wait"&&o.unref(r).kiosk_show_loyalty_phone_input_button?(o.openBlock(),o.createElementBlock("div",_p,[o.createElementVNode("button",{class:"card_phone_auth_button",onClick:b},"Войти по номеру телефона")])):o.createCommentVNode("",!0)])]),o.createElementVNode("input",{ref_key:"cardInputRef",ref:a,type:"text",class:"sr_only","aria-live":"polite"},null,512),o.createElementVNode("div",gp,o.toDisplayString(k.value),1)],2)):o.createCommentVNode("",!0)],64))}}),yp={key:0,class:"wrapper_qr"},bp={key:1,class:"wrapper_qr"},wp={key:2,class:"wrapper_qr"},xp={class:"wrap"},kp=ke(o.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(i){const e=Le(),t=zn(),{cartProducts_lib:n}=J.storeToRefs(e),{orderNumber:r,orderCompleted_lib:s}=J.storeToRefs(t),a=re.useRouter(),l=re.useRoute(),c=()=>{Fn(["cart","authTokensAccess","authTokensRefresh"]),n.value=[],s.value=null,t.clearCard(),e.profile=null,a.replace(`/${l.params.orgId}`)};return(u,d)=>o.unref(s)&&o.unref(s)===1?(o.openBlock(),o.createElementBlock("section",yp,[...d[0]||(d[0]=[o.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-f6831631><i data-v-f6831631></i></div><h1 class="title_fiscal" data-v-f6831631>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-f6831631>Не забудьте <b data-v-f6831631>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-f6831631><div class="printer" data-v-f6831631><div class="led" data-v-f6831631></div><div class="slot" data-v-f6831631></div><div class="receipt" data-v-f6831631><div class="tear" data-v-f6831631></div><div class="line accent" data-v-f6831631></div><div class="line" data-v-f6831631></div><div class="line sm" data-v-f6831631></div><div class="line" data-v-f6831631></div><div class="line sm" data-v-f6831631></div><div class="line" data-v-f6831631></div><div class="line sm" data-v-f6831631></div></div></div></div>',4)])])):o.unref(s)&&o.unref(s)===2?(o.openBlock(),o.createElementBlock("section",bp,[...d[1]||(d[1]=[o.createStaticVNode('<div class="center" data-v-f6831631><div class="stack" data-v-f6831631><h1 class="title_fiscal" data-v-f6831631>Приложите карту для оплаты</h1><p class="reminder" data-v-f6831631>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f6831631><div class="waves" data-v-f6831631><span data-v-f6831631></span><span data-v-f6831631></span><span data-v-f6831631></span></div><div class="nfc" data-v-f6831631><svg viewBox="0 0 24 24" data-v-f6831631><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f6831631></path><path d="M10 6c4 4 4 8 0 12" data-v-f6831631></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f6831631></path></svg></div><div class="card" data-v-f6831631><div class="logo" data-v-f6831631>inno.</div><div class="chip" data-v-f6831631></div><div class="digits" data-v-f6831631>4815 1623 4200 0900</div><div class="holder" data-v-f6831631>Гость</div></div></div></div></div>',1)])])):o.unref(s)&&o.unref(s)===3?(o.openBlock(),o.createElementBlock("section",wp,[o.createElementVNode("div",xp,[d[5]||(d[5]=o.createElementVNode("div",{class:"icon","aria-hidden":"true"},[o.createElementVNode("svg",{viewBox:"0 0 24 24"},[o.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),o.createElementVNode("h1",null,[d[2]||(d[2]=o.createTextVNode(" Ваш заказ ",-1)),o.createElementVNode("span",null,"№ "+o.toDisplayString(o.unref(r)),1),d[3]||(d[3]=o.createTextVNode(" успешно оплачен ",-1))]),d[6]||(d[6]=o.createElementVNode("p",{class:"title_fiscal"},"Спасибо! Заказ передан в работу.",-1)),o.createElementVNode("div",{class:"wrapper_accept"},[o.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:c},[...d[4]||(d[4]=[o.createElementVNode("span",{class:"label"},"Новый заказ",-1),o.createElementVNode("span",{class:"fill","aria-hidden":"true"},null,-1),o.createElementVNode("div",{class:"bubbles","aria-hidden":"true"},null,-1)])])])])])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-f6831631"]]),Sp={},Cp={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Ep(i,e){return o.openBlock(),o.createElementBlock("svg",Cp,[...e[0]||(e[0]=[o.createElementVNode("path",{d:"M19 20H20M16 20H14V17M17 17H20V14H19M14 14H16M4 16.9997C4 16.0679 4 15.6019 4.15224 15.2344C4.35523 14.7443 4.74432 14.3552 5.23438 14.1522C5.60192 14 6.06786 14 6.99974 14C7.93163 14 8.39808 14 8.76562 14.1522C9.25568 14.3552 9.64467 14.7443 9.84766 15.2344C9.9999 15.6019 9.9999 16.0681 9.9999 17C9.9999 17.9319 9.9999 18.3978 9.84766 18.7654C9.64467 19.2554 9.25568 19.6447 8.76562 19.8477C8.39808 19.9999 7.93162 19.9999 6.99974 19.9999C6.06786 19.9999 5.60192 19.9999 5.23438 19.8477C4.74432 19.6447 4.35523 19.2557 4.15224 18.7656C4 18.3981 4 17.9316 4 16.9997ZM14 6.99974C14 6.06786 14 5.60192 14.1522 5.23438C14.3552 4.74432 14.7443 4.35523 15.2344 4.15224C15.6019 4 16.0679 4 16.9997 4C17.9316 4 18.3981 4 18.7656 4.15224C19.2557 4.35523 19.6447 4.74432 19.8477 5.23438C19.9999 5.60192 19.9999 6.06812 19.9999 7C19.9999 7.93188 19.9999 8.39783 19.8477 8.76537C19.6447 9.25542 19.2557 9.64467 18.7656 9.84766C18.3981 9.9999 17.9316 9.9999 16.9997 9.9999C16.0679 9.9999 15.6019 9.9999 15.2344 9.84766C14.7443 9.64467 14.3552 9.25568 14.1522 8.76562C14 8.39808 14 7.93163 14 6.99974ZM4 6.99974C4 6.06786 4 5.60192 4.15224 5.23438C4.35523 4.74432 4.74432 4.35523 5.23438 4.15224C5.60192 4 6.06786 4 6.99974 4C7.93163 4 8.39808 4 8.76562 4.15224C9.25568 4.35523 9.64467 4.74432 9.84766 5.23438C9.9999 5.60192 9.9999 6.06812 9.9999 7C9.9999 7.93188 9.9999 8.39783 9.84766 8.76537C9.64467 9.25542 9.25568 9.64467 8.76562 9.84766C8.39808 9.9999 7.93162 9.9999 6.99974 9.9999C6.06786 9.9999 5.60192 9.9999 5.23438 9.84766C4.74432 9.64467 4.35523 9.25568 4.15224 8.76562C4 8.39808 4 7.93163 4 6.99974Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const Tp=ke(Sp,[["render",Ep]]),Oa=i=>{const e=co(),t=l=>e.open(i,l),n=()=>e.close(i),r=e.state(i),s=o.computed({get:()=>r.value.visible,set:l=>l&&t()||n()}),a=o.computed(()=>r.value.context);return{visible:s,context:a,open:t,close:n}},vp={class:"cart_deletion_modal_content"},Np={class:"cart_deletion_modal_title"},Mp={class:"cart_deletion_modal_footer"},Pp=ke(o.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(i,{emit:e}){const t=e,{visible:n,context:r,close:s}=Oa("cart-delete-confirm"),a=()=>{t("confirm",r.value.idSystem),s()};return(l,c)=>(o.openBlock(),o.createBlock(o.Transition,{name:"fade"},{default:o.withCtx(()=>[o.unref(n)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=o.withModifiers((...u)=>o.unref(s)&&o.unref(s)(...u),["self"]))},[o.createElementVNode("div",vp,[o.createElementVNode("div",Np,"Удалить "+o.toDisplayString(o.unref(r).name)+"?",1),c[2]||(c[2]=o.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),o.createElementVNode("div",Mp,[o.createElementVNode("button",{class:"primary",onClick:a}," Удалить "),o.createElementVNode("button",{onClick:c[0]||(c[0]=(...u)=>o.unref(s)&&o.unref(s)(...u))},"Отмена")])])])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),Ap={class:"cart_wrapper"},Bp={class:"cart_header_content"},Rp={class:"cart_kso_loyal_wrapper"},Dp={key:0},Op={class:"cart_header_wrapper"},$p={class:"cart_header_info"},Ip={class:"cart_header_info"},Vp={class:"cart_header_info"},Lp={class:"cart_header_info"},Fp={key:0},zp={key:0,class:"wrapper_comment"},Up={class:"wrapper_limit_in_area"},Hp={class:"limit_comment"},qp={class:"cart_cards"},Wp={class:"cart_footer_wrapper"},jp={key:0,class:"footer_title"},Xp=["disabled","max"],Yp={key:1,class:"footer_sales"},Gp=["max"],Kp={class:"list_price"},Jp={key:0},Zp={key:1},Qp={key:2},em={class:"accept_field"},tm={class:"accept_field"},nm={key:3},rm={class:"accept_field"},im={class:"accept_field"},om={class:"accept_field"},sm={class:"wrapper_footer_cart_btn"},am=o.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(i){const e=Le(),t=zn(),n=Ge(),r=Ke(),s=i,{totalPrice_lib:a,countBonus:l,config_lib:c,cartProducts_lib:u,profile:d}=J.storeToRefs(e),{itemThemes:h}=J.storeToRefs(n),{textPaymentBtn_lib:_,isButtonDisabled:f,orderCompleted_lib:m,orderNumber:p,extraDiscount:g,is_notification_lib:y,notificationData_lib:w}=J.storeToRefs(t),{isAddToCard:x}=J.storeToRefs(r),T=re.useRouter(),S=re.useRoute(),B=o.ref(!1),k=o.ref(!1),b=o.ref(""),C=o.ref(!1),P=o.ref(0),O=o.ref(!1),H=o.ref(0),R=o.ref(),N=o.computed(()=>{const Y={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return u.value.reduce((U,ie)=>(U.energy_amount+=(ie.energy_amount||0)*(ie.amount||0),U.proteins_amount+=(ie.proteins_amount||0)*(ie.amount||0),U.fat_amount+=(ie.fat_amount||0)*(ie.amount||0),U.carbohydrates_amount+=(ie.carbohydrates_amount||0)*(ie.amount||0),U),Y)}),E=()=>T.push(`/${S.params.orgId}/`),M=Y=>{["a","A","+","-",".",","].includes(Y.key)&&Y.preventDefault()},A=Y=>{e.deleteItemFromCart(Y)},$=()=>{C.value=!C.value,b.value.length},V=()=>{var U,ie,_e;let Y=Math.floor(l.value);Y<0||!Y?Y=0:((U=d.value)==null?void 0:U.balance)>a.value?Y>a.value-1&&(Y=a.value-1):Y>((ie=d.value)==null?void 0:ie.balance)&&(Y=(_e=d.value)==null?void 0:_e.balance),Y!==l.value&&e.setBonus(Y)};o.watchEffect(()=>{V(),e.setBonus(a.value===0?0:Math.floor(l.value))});const F=()=>u.value.map(Y=>({id:Y.id,front_item_id:Y.idSystem,is_fake:!!Y.is_fake,removals:Y.removals??null,amount:Y.amount,size:Y.size,modifiers:Y.modifiers??[],group_modifiers:Y.group_modifiers??[]})),z=async()=>{f.value=!0;try{return await Qt.create().createOrder(F(),s.configPage.tableDataId,s.configPage.kiosk_menu,b.value,!!s.configPage.userData||!!d.value,s.configPage.is_tableservice)}catch(Y){throw s.configPage.kiosk_menu?(Y.status===403&&(localStorage.removeItem("apiKey"),e.is_showApiKey=!0,T.push(`/${S.params.orgId}/retryPage`)),t.deleteCart("retryPage",s.configPage.kiosk_menu)):s.configPage.is_tableservice?t.showNotification(Y.response.data.user_friendly_message):T.push(`/${S.params.orgId}/errorPayment`),f.value=!1,Y}},W=()=>{if(!d.value&&s.configPage.qr_menu){T.push(`/${S.params.orgId}/register`);return}x.value=!1,m.value=1,c.value.has_rms_discount?t.makeInitPaymentLinkRequest(R.value,s.configPage.kiosk_menu,s.configPage.is_tableservice).then(()=>R.value=null):z()},Z=async()=>{var ie;g.value=0,f.value=!0;const Y={items:[...F()],combos:[]},U=Qt.create();try{O.value=!0;const _e=await U.calculateDiscount(Y,s.configPage.kiosk_menu,!!s.configPage.userData||!!d.value);if(!u.value)return;if(u.value.forEach(ce=>{const ye=_e.items.find(ge=>ge.front_item_id===ce.idSystem);if(ye&&(ce.group_modifiers.forEach(ge=>{const se=ye.group_modifiers.find(pe=>pe.group===ge.group);se&&ge.modifiers.forEach(pe=>{const ne=se.modifiers.find(mn=>mn.id===pe.id);if(ne&&Number(pe.price)!==Number(ne==null?void 0:ne.new_price)){const mn=(ne.discounts||[]).reduce((ot,_t)=>ot+=+_t.discount,0);P.value+=mn,pe.new_price=pe.price,pe.price=Number(ne==null?void 0:ne.new_price),pe.total_new_price=Number(ne.total_new_price)}})}),ce.modifiers.forEach(ge=>{const se=ye.modifiers.find(pe=>pe.id===ge.id);if(se&&Number(ge.price)!==Number(se==null?void 0:se.new_price)){const pe=(se.discounts||[]).reduce((ne,mn)=>ne+=+mn.discount,0);P.value+=pe,ge.new_price=ge.price,ge.price=Number(se==null?void 0:se.new_price),ge.total_new_price=Number(se.total_new_price)}}),ce.price!==Number(ye.new_price))){const ge=(ye.discounts||[]).reduce((se,pe)=>se+=+pe.discount,0);P.value=P.value+ge,ce.new_price=ce.price,ce.price=ye.new_price,ce.discounts=ye.discounts,ce.total_new_price=Number(ye.total_new_price)}}),u.value=[...u.value],P.value!==0&&(a.value=_e.total_cart_price),c.value.has_rms_discount){const ce=await z();R.value=(ie=ce.data)==null?void 0:ie.id}else f.value=!1;k.value=!1}catch(_e){console.log("Ошибка скидок [CartPage calculateDiscount]",_e),t.showNotification("Скидки временно недоступны"),O.value=!1,k.value=c.value.has_rms_discount,f.value=!1}},K=()=>{var Y;(Y=d.value)!=null&&Y.balance?d.value.balance>=1&&(B.value=!B.value):t.showNotification("У Вас пока нет бонусов")},ue=()=>{var Y,U;(((Y=c.value)==null?void 0:Y.loyalty)==="IIKO"||c.value.has_rms_discount)&&(c.value.has_loyalty_default_user||d.value)&&s.configPage.kiosk_menu?(R.value=null,k.value=!0):(((U=c.value)==null?void 0:U.loyalty)==="IIKO"||c.value.has_rms_discount)&&s.configPage.qr_menu&&d.value?k.value=!0:k.value=!1};return o.onMounted(async()=>{_.value=s.textPaymentBtn,e.loadCart(),m.value=null,a.value=null,g.value=0,u.value.splice(0,u.value.length,...u.value.map(e.makeProductFullyReactive))}),o.onUnmounted(()=>{R.value=null,m.value=null,a.value=null,g.value=0,u.value.splice(0,u.value.length,...u.value.map(e.makeProductFullyReactive))}),o.watchEffect(()=>{!c.value.has_rms_discount&&["ОПЛАТИТЬ","СОЗДАТЬ ЗАКАЗ"].includes(_.value.toUpperCase())?f.value=e.cartProducts_lib.length===0||a.value===0:(f.value=!1,m.value=null)}),o.watch([()=>e.cartProducts_lib,d],Y=>{if(H.value>0){H.value--;return}Y&&!O.value&&(ue(),u.value.splice(0,u.value.length,...u.value.map(e.makeProductFullyReactive)),P.value=0,a.value=null,g.value=0,H.value=1),O.value=!1},{deep:!0}),(Y,U)=>{var ie,_e,ce,ye,ge;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Ap,[o.createVNode(Pp,{onConfirm:A}),o.createVNode(Ba,{visible:o.unref(t).isDrawerOpen,"onUpdate:visible":U[0]||(U[0]=se=>o.unref(t).isDrawerOpen=se)},{default:o.withCtx(()=>[o.createVNode(Da)]),_:1},8,["visible"]),o.createElementVNode("header",Bp,[o.createElementVNode("div",Rp,[o.createElementVNode("div",{class:o.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:E},[o.createVNode(so,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(o.openBlock(),o.createElementBlock("span",Dp,"Назад")):o.createCommentVNode("",!0)],2)]),o.createElementVNode("div",Op,[(o.unref(h).kiosk_show_loyalty_card_button||o.unref(h).kiosk_show_loyalty_phone_input_button)&&!s.config_qr?(o.openBlock(),o.createElementBlock("button",{key:0,class:"buttonDefaultWrapper button_payment_cart button_payment_cart_loyal",onClick:U[1]||(U[1]=(...se)=>o.unref(t).openDrawer&&o.unref(t).openDrawer(...se))},[U[6]||(U[6]=o.createElementVNode("p",{class:"cart_loyal_program"},"Программа лояльности",-1)),o.createVNode(Tp,{class:"cart_loyal_qr"})])):o.createCommentVNode("",!0),o.unref(h).show_nutrition_in_cart?(o.openBlock(),o.createElementBlock("div",{key:1,class:"cart_header",style:o.normalizeStyle({paddingTop:s.config_qr?0:"10px"})},[o.createElementVNode("div",$p,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.energy_amount,duration:800},null,8,["price"]),U[7]||(U[7]=o.createTextVNode(" г",-1))]),U[8]||(U[8]=o.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),o.createElementVNode("div",Ip,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.proteins_amount,duration:900},null,8,["price"]),U[9]||(U[9]=o.createTextVNode(" г",-1))]),U[10]||(U[10]=o.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),o.createElementVNode("div",Vp,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.fat_amount,duration:1e3},null,8,["price"]),U[11]||(U[11]=o.createTextVNode(" г",-1))]),U[12]||(U[12]=o.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),o.createElementVNode("div",Lp,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.carbohydrates_amount,duration:1100},null,8,["price"]),U[13]||(U[13]=o.createTextVNode(" г",-1))]),U[14]||(U[14]=o.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):o.createCommentVNode("",!0)])]),i.config_qr&&o.unref(h).show_order_comment?(o.openBlock(),o.createElementBlock("div",Fp,[C.value?(o.openBlock(),o.createElementBlock("div",zp,[o.createElementVNode("div",Up,[o.withDirectives(o.createElementVNode("textarea",{class:"comment_order",placeholder:"Ваш комментарий к заказу...",name:"comment",maxlength:"50","onUpdate:modelValue":U[2]||(U[2]=se=>b.value=se)},null,512),[[o.vModelText,b.value]]),o.createElementVNode("p",Hp,o.toDisplayString(b.value.length+" / 50"),1)]),o.createVNode(en,{textButtonDefault:"Сохранить",onClick:$,class:"button_bonus_cart"})])):o.createCommentVNode("",!0),!C.value&&o.unref(u).length>0?(o.openBlock(),o.createBlock(en,{key:1,textButtonDefault:b.value.length>0?"Редактировать":"Комментарий к заказу",onClick:()=>C.value=!C.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",qp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(u),se=>(o.openBlock(),o.createBlock(Ra,{key:se.idSystem,cardItem:se,onDelete:pe=>A(se.idSystem)},null,8,["cardItem","onDelete"]))),128))]),o.createElementVNode("div",Wp,[B.value?(o.openBlock(),o.createElementBlock("p",jp,[U[15]||(U[15]=o.createTextVNode(" Списать ",-1)),o.withDirectives(o.createElementVNode("input",{type:"number",placeholder:"0",style:o.normalizeStyle({maxWidth:`${o.unref(l).toString().length||1}em`}),disabled:o.unref(d)===null||((ie=o.unref(d))==null?void 0:ie.balance)===0,"onUpdate:modelValue":U[3]||(U[3]=se=>o.isRef(l)?l.value=se:null),onInput:V,min:"0",max:((_e=o.unref(d))==null?void 0:_e.balance)>o.unref(a)?Math.floor(o.unref(a)):(ce=o.unref(d))==null?void 0:ce.balance,onKeypress:M},null,44,Xp),[[o.vModelText,o.unref(l),void 0,{number:!0}]]),U[16]||(U[16]=o.createTextVNode(" бонусов ",-1))])):o.createCommentVNode("",!0),B.value?(o.openBlock(),o.createElementBlock("p",Yp,"У вас есть "+o.toDisplayString(o.unref(d)?o.unref(d).balance:0)+" B",1)):o.createCommentVNode("",!0),B.value?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:2,type:"range",class:"footer_range","onUpdate:modelValue":U[4]||(U[4]=se=>o.isRef(l)?l.value=se:null),min:0,max:((ye=o.unref(d))==null?void 0:ye.balance)>o.unref(a)?Math.floor(o.unref(a)-1):(ge=o.unref(d))==null?void 0:ge.balance},null,8,Gp)),[[o.vModelText,o.unref(l),void 0,{number:!0}]]):o.createCommentVNode("",!0),o.createElementVNode("ul",Kp,[B.value?(o.openBlock(),o.createElementBlock("li",Jp,[U[18]||(U[18]=o.createElementVNode("p",null,"Сумма заказа:",-1)),o.createElementVNode("p",null,[o.createVNode(Mt,{price:o.unref(a),fixedFloat:2},null,8,["price"]),U[17]||(U[17]=o.createTextVNode(" ₽",-1))])])):o.createCommentVNode("",!0),B.value?(o.openBlock(),o.createElementBlock("li",Zp,[U[20]||(U[20]=o.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),o.createElementVNode("p",null,[o.createVNode(Mt,{price:o.unref(l),fixedFloat:2},null,8,["price"]),U[19]||(U[19]=o.createTextVNode(" Б",-1))])])):o.createCommentVNode("",!0),o.unref(g)!==0?(o.openBlock(),o.createElementBlock("li",Qp,[o.createElementVNode("p",em,o.toDisplayString(o.unref(g)>0?"Надбавка":"Скидка")+": ",1),o.createElementVNode("p",tm,[o.createVNode(Mt,{price:Math.abs(o.unref(g)),fixedFloat:2},null,8,["price"]),U[21]||(U[21]=o.createTextVNode(" ₽",-1))])])):P.value!==0?(o.openBlock(),o.createElementBlock("li",nm,[o.createElementVNode("p",rm,o.toDisplayString(P.value>0?"Надбавка":"Скидка")+": ",1),o.createElementVNode("p",im,[o.createVNode(Mt,{price:Math.abs(P.value),fixedFloat:2},null,8,["price"]),U[22]||(U[22]=o.createTextVNode(" ₽",-1))])])):o.createCommentVNode("",!0),o.createElementVNode("li",null,[U[24]||(U[24]=o.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),o.createElementVNode("p",om,[o.createVNode(Mt,{price:o.unref(a)-o.unref(l),fixedFloat:2},null,8,["price"]),U[23]||(U[23]=o.createTextVNode(" ₽",-1))])])]),o.createElementVNode("div",sm,[o.unref(d)?(o.openBlock(),o.createBlock(en,{key:0,textButtonDefault:"Бонусы",onClick:K,class:"button_bonus_cart"})):o.createCommentVNode("",!0),o.createVNode(en,{textButtonDefault:k.value?"Рассчитать скидки":o.unref(_),onClick:k.value?Z:W,class:"button_payment_cart",disabled:o.unref(f)},null,8,["textButtonDefault","onClick","disabled"])])])]),i.configPage.kiosk_menu?(o.openBlock(),o.createBlock(kp,{key:0,orderNumber:o.unref(p),pageNumber:1},null,8,["orderNumber"])):o.createCommentVNode("",!0),o.createVNode(lo,{visible:o.unref(y),"onUpdate:visible":U[5]||(U[5]=se=>o.isRef(y)?y.value=se:null),textNotificationDefault:o.unref(w).textNotification,backgroundColor:o.unref(h).accent_color?o.unref(h).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"])],64)}}}),lm={},cm={viewBox:"0 0 24 24"};function um(i,e){return o.openBlock(),o.createElementBlock("svg",cm,[...e[0]||(e[0]=[o.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const dm=ke(lm,[["render",um]]),fm={class:"retry_screen"},hm={class:"retry_all_in_screen"},pm={class:"retry_content"},mm={class:"retry_icon_wrap"},_m={class:"retry_icon_circle"},gm={class:"retry_error_x"},ym=o.defineComponent({__name:"RetryPage",setup(i){const e=zn(),t=re.useRouter(),n=re.useRoute(),r=Le(),s=()=>{e.notificationData_lib.textNotification="",e.is_notification_lib=!1,r.openApiKey=!0,t.replace(`/${n.params.orgId}/`)};return(a,l)=>(o.openBlock(),o.createElementBlock("section",fm,[o.createElementVNode("div",hm,[o.createElementVNode("main",pm,[o.createElementVNode("div",mm,[o.createElementVNode("div",_m,[l[0]||(l[0]=o.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),o.createElementVNode("div",gm,[o.createVNode(dm)])])]),l[1]||(l[1]=o.createElementVNode("div",{class:"retry_oops"},"OOPS",-1)),l[2]||(l[2]=o.createElementVNode("h1",{class:"retry_title"},"Что-то пошло не так",-1)),l[3]||(l[3]=o.createElementVNode("div",{class:"retry_hint"},[o.createElementVNode("p",null,"Похоже, произошёл технический сбой."),o.createElementVNode("p",null,"Мы уже знаем о проблеме и сейчас разбираемся."),o.createElementVNode("p",null,"Приносим извинения за доставленные неудобства."),o.createElementVNode("p",null,"Попробуйте начать новый заказ.")],-1))]),o.createElementVNode("div",{class:"retry_footer"},[o.createElementVNode("button",{onClick:s,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=o.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),bm={class:"wrapper_loader"},wm=o.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(i){return(e,t)=>(o.openBlock(),o.createElementBlock("div",bm,[o.createElementVNode("div",{class:"loader",style:o.normalizeStyle({width:i.size})},null,4)]))}}),xm={class:"opacity-animation"},km=ke(o.defineComponent({__name:"AnimationLoader",props:{key:{}},setup(i){const e=o.ref(!0);return o.watch(()=>e.value,()=>{e.value=!1,setTimeout(()=>{e.value=!0},0)}),(t,n)=>(o.openBlock(),o.createElementBlock("div",xm,[o.renderSlot(t.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-26479273"]]),Sm={key:0},Cm={class:"card__main__wrapper"},Em={key:0,class:"folder_content_top"},Tm={key:0,class:"loader_card_main"},vm={key:1,class:"card__main_content"},Nm=["src","alt"],Mm={class:"card_title_price_wrapper"},Pm={class:"title"},Am={key:0,class:"price"},Bm={key:1,class:"card_button_add_wrapper"},$a=ke(o.defineComponent({__name:"CardMain",props:{data:{type:Object,required:!0},activeTags:{type:Object,required:!1,default:[]},is_product:{type:Boolean,default:!0},is_group:{type:Boolean,default:!1},parent:{type:String,required:!1},isLoading:{type:Boolean,default:!1},selectGroupChild:{type:Function,required:!1},takeCurrentCard:{type:Function,required:!1}},setup(i){const e=i,t=Ge(),n=Le(),{is_18_above_content:r,is18Allowed:s}=J.storeToRefs(n),{itemThemes:a}=J.storeToRefs(t),l=(u,d)=>{if(u.adult&&!s.value){r.value=!0;return}if(u.amount||(u.amount=1),e.is_group&&e.selectGroupChild){e.selectGroupChild({...u,parent:e.parent,child:d.child_groups});return}e.takeCurrentCard&&e.takeCurrentCard(d.id)},c=u=>{if(e.is_group&&e.selectGroupChild){u={...u,parent:e.parent,child:u.child_groups},e.selectGroupChild(u);return}if(u.adult&&!s.value){r.value=!0;return}e.takeCurrentCard&&e.takeCurrentCard(u.id)};return(u,d)=>e.activeTags.length===0||e.activeTags.every(h=>e.data.tags.includes(h))?(o.openBlock(),o.createElementBlock("div",Sm,[(o.openBlock(),o.createBlock(km,{key:e.data.id},{opacityLoader:o.withCtx(()=>[o.createElementVNode("div",Cm,[i.is_group?(o.openBlock(),o.createElementBlock("div",Em)):o.createCommentVNode("",!0),o.createElementVNode("div",{onClick:d[0]||(d[0]=h=>c(e.data)),class:o.normalizeClass(["card__main",{card__main_folder:i.is_group}])},[i.isLoading?(o.openBlock(),o.createElementBlock("div",Tm,[o.createVNode(wm)])):(o.openBlock(),o.createElementBlock("div",vm,[o.createElementVNode("img",{src:e.data.image_link||o.unref(a).fallback_image||"",class:o.normalizeClass(["img",{card_blur_image:e.data.adult&&!o.unref(s)}]),loading:"lazy",alt:i.data.name},null,10,Nm),o.createElementVNode("div",Mm,[o.createElementVNode("p",Pm,o.toDisplayString(i.data.name),1),i.is_group?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("p",Am,o.toDisplayString(o.unref(dr)(i.data))+" ₽",1))])]))],2),i.is_group?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Bm,[o.createElementVNode("div",{onClick:d[1]||(d[1]=h=>l(i.data,e.data)),class:"add_button"},[...d[2]||(d[2]=[o.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1}))])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-56a6b046"]]),Rm=["id","onClick"],Dm=ke(o.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(i){const e=o.ref(null);return(t,n)=>i.menuGroup.length?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:e},[o.createVNode(io,{axis:"x",behavior:"smooth",container:e.value,autoScroll:!0,idActive:i.idActiveGroup,clearContainer:!0},{default:o.withCtx(({handleTargetClick:r})=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.menuGroup,(s,a)=>(o.openBlock(),o.createElementBlock("li",{key:s.id,id:"scrolling"+s.id,onClick:l=>{i.activeTakeGroup&&i.activeTakeGroup(s.id,a),r(l)},style:o.normalizeStyle(i.idActiveGroup==s.id?{fontFamily:"Bounded"}:{})},o.toDisplayString(s.name),13,Rm))),128))]),_:1},8,["container","idActive"])],512)):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Om=["id","onClick"],$m=ke(o.defineComponent({__name:"TagsMain",props:{menuTags:{default:()=>[]},groupIndex:{default:null},isSolo:{type:Boolean,default:!1},currentActiveTag:{},activeTakeTags:{type:Function,default:void 0},activeTakeTagsSolo:{type:Function,default:void 0}},setup(i){const e=i,t=o.ref(null),n=o.computed(()=>e.isSolo&&e.groupIndex!==void 0?e.currentActiveTag:e.currentActiveTag[e.groupIndex]);return(r,s)=>i.menuTags.length>0?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:t},[o.createVNode(io,{axis:"x",behavior:"smooth",container:t.value,autoScroll:!0,idActive:n.value?n.value[i.currentActiveTag.length-1]:null,clearContainer:!1},{default:o.withCtx(({handleTargetClick:a})=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.menuTags,(l,c)=>(o.openBlock(),o.createElementBlock("li",{key:c,id:`scrolling${l}`,onClick:u=>{i.activeTakeTags&&(i.groupIndex||i.groupIndex===0)?i.activeTakeTags(l,i.groupIndex):i.activeTakeTagsSolo&&i.activeTakeTagsSolo(l),a(u)},class:o.normalizeClass({main__filter_active:n.value.includes(l)})},o.toDisplayString(l),11,Om))),128))]),_:1},8,["container","idActive"])],512)):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-49c107f2"]]),Ia=J.defineStore("imageCache",()=>{const i=o.ref({});async function e(a){const l=String(a);if(i.value[l])return;const c=await Ma(a);if(!c)return;const u=URL.createObjectURL(c);i.value[l]=u,window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:l,blob:c}}))}async function t(a){await Promise.all(a.map(l=>e(l)))}function n(a,l){const c=String(a);i.value[c]&&URL.revokeObjectURL(i.value[c]),i.value[c]=URL.createObjectURL(l)}function r(a){return o.computed(()=>i.value[String(a)]||null)}function s(){Object.values(i.value).forEach(URL.revokeObjectURL),i.value={}}return{cache:i,initCacheSingle:e,initCache:t,setImage:n,getImageUrl:r,cleanup:s}});function Im(i,e=""){const t=Ia(),{initCacheSingle:n,getImageUrl:r}=t,s=o.ref(null),a=r(i);return o.watch(a,l=>{l&&(s.value=l)},{immediate:!0}),a.value?s.value=a.value:n(i).then(()=>{s.value=r(i).value||e}),{mediaUrl:o.computed(()=>s.value||e),isLoading:o.computed(()=>!s.value||s.value===e)}}const Vm=["data-id"],Lm={key:0,loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},Fm=["src"],zm=["src"],Um=ke(o.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(i){const e=i,{mediaUrl:t}=Im(e.group.id,e.group.video_link||e.group.image_link||"");return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["drum_item",{active:e.active}]),"data-id":i.group.id},[i.group.video_link?(o.openBlock(),o.createElementBlock("video",Lm,[o.createElementVNode("source",{src:o.unref(t)||"",type:"video/webm"},null,8,Fm)])):(o.openBlock(),o.createElementBlock("img",{key:1,class:"drum_img",src:o.unref(t)||""},null,8,zm)),o.createElementVNode("p",null,o.toDisplayString(i.group.name),1)],10,Vm))}}),[["__scopeId","data-v-38338744"]]),Hm={},qm={width:"9.998535",height:"10.000000",viewBox:"0 0 9.99854 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Wm(i,e){return o.openBlock(),o.createElementBlock("svg",qm,[...e[0]||(e[0]=[o.createElementVNode("desc",null," Created with Pixso. ",-1),o.createElementVNode("defs",null,null,-1),o.createElementVNode("path",{id:"Форма 5",d:"M4.23 10L5.76 10L5.76 5.74L9.99 5.74L9.99 4.25L5.76 4.25L5.76 0L4.23 0L4.23 4.25L0 4.25L0 5.74L4.23 5.74L4.23 10Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const jm=ke(Hm,[["render",Wm]]),Xm={class:"recommendation_wrapper"},Ym={class:"recommendation_header"},Gm={class:"recommendation_info"},Km=ke(o.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(i){const e=Ke(),{isUpSale:t,dataUpSale:n}=J.storeToRefs(e),r=()=>{t.value=!1};return o.onUnmounted(()=>{n.value=null}),(s,a)=>(o.openBlock(),o.createElementBlock("div",Xm,[o.createElementVNode("div",Ym,[a[0]||(a[0]=o.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),o.createElementVNode("div",{class:"header_close",onClick:r},[o.createVNode(jm,{class:"close_icon"})])]),o.createElementVNode("div",Gm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(n),l=>(o.openBlock(),o.createBlock($a,{data:l,key:l.id,parent:l.id,is_group:!1,is_product:!0,class:"card",closeCurrentCard:i.closeCurrentCard,takeCurrentCard:()=>i.openCurrentCard(l.id,!0)},null,8,["data","parent","closeCurrentCard","takeCurrentCard"]))),128))])]))}}),[["__scopeId","data-v-abf4717f"]]),Jm={class:"wrapper_modal"},Zm={class:"card_modal"},Qm=ke(o.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(i){const e=i,t=Ke(),{isUpSale:n}=J.storeToRefs(t),r=()=>{n.value=!1};return(s,a)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(Aa,{data:e.visible},null,8,["data"]),o.createElementVNode("div",{class:"black_modal",onClick:r}),o.createElementVNode("div",Jm,[o.createElementVNode("div",Zm,[o.renderSlot(s.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]);function Ht(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Va(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}/*!
|
|
6
|
+
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=yn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;n!==void 0&&si.assertOptions(n,{silentJSONParsing:Ot.transitional(Ot.boolean),forcedJSONParsing:Ot.transitional(Ot.boolean),clarifyTimeoutError:Ot.transitional(Ot.boolean)},!1),r!=null&&(D.isFunction(r)?t.paramsSerializer={serialize:r}:si.assertOptions(r,{encode:Ot.function,serialize:Ot.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),si.assertOptions(t,{baseUrl:Ot.spelling("baseURL"),withXsrfToken:Ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&D.merge(s.common,s[t.method]);s&&D.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),t.headers=Ze.concat(a,s);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,h=0,_;if(!c){const m=[ma.bind(this),void 0];for(m.unshift(...l),m.push(...u),_=m.length,d=Promise.resolve(t);h<_;)d=d.then(m[h++],m[h++]);return d}_=l.length;let f=t;for(;h<_;){const m=l[h++],p=l[h++];try{f=m(f)}catch(g){p.call(this,g);break}}try{d=ma.call(this,f)}catch(m){return Promise.reject(m)}for(h=0,_=u.length;h<_;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=yn(this.defaults,e);const t=ia(e.baseURL,e.url,e.allowAbsoluteUrls);return Gs(t,e.params,e.paramsSerializer)}};D.forEach(["delete","get","head","options"],function(e){bn.prototype[e]=function(t,n){return this.request(yn(n||{},{method:e,url:t,data:(n||{}).data}))}}),D.forEach(["post","put","patch"],function(e){function t(n){return function(s,a,l){return this.request(yn(l||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}bn.prototype[e]=t(),bn.prototype[e+"Form"]=t(!0)});let Fd=class Vc{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(l=>{n.subscribe(l),s=l}).then(r);return a.cancel=function(){n.unsubscribe(s)},a},e(function(s,a,l){n.reason||(n.reason=new qn(s,a,l),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Vc(function(r){e=r}),cancel:e}}};function zd(i){return function(t){return i.apply(null,t)}}function Ud(i){return D.isObject(i)&&i.isAxiosError===!0}const Gi={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(Gi).forEach(([i,e])=>{Gi[e]=i});function ya(i){const e=new bn(i),t=Ds(bn.prototype.request,e);return D.extend(t,bn.prototype,e,{allOwnKeys:!0}),D.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return ya(yn(i,r))},t}const be=ya(gr);be.Axios=bn,be.CanceledError=qn,be.CancelToken=Fd,be.isCancel=ea,be.VERSION=_a,be.toFormData=ti,be.AxiosError=oe,be.Cancel=be.CanceledError,be.all=function(e){return Promise.all(e)},be.spread=zd,be.isAxiosError=Ud,be.mergeConfig=yn,be.AxiosHeaders=Ze,be.formToJSON=i=>Zs(D.isHTMLForm(i)?new FormData(i):i),be.getAdapter=pa.getAdapter,be.HttpStatusCode=Gi,be.default=be;const{Axios:Tg,AxiosError:vg,CanceledError:Ng,isCancel:Mg,CancelToken:Pg,VERSION:Ag,all:Bg,Cancel:Rg,isAxiosError:Dg,spread:Og,toFormData:$g,AxiosHeaders:Ig,HttpStatusCode:Vg,formToJSON:Lg,getAdapter:Fg,mergeConfig:zg}=be;var Hd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qd(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ba={exports:{}};(function(i,e){(function(t,n){i.exports=n()})(Hd,function(){var t=1e3,n=6e4,r=36e5,s="millisecond",a="second",l="minute",c="hour",u="day",d="week",h="month",_="quarter",f="year",m="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,w={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(N){var E=["th","st","nd","rd"],M=N%100;return"["+N+(E[(M-20)%10]||E[M]||E[0])+"]"}},x=function(N,E,M){var A=String(N);return!A||A.length>=E?N:""+Array(E+1-A.length).join(M)+N},T={s:x,z:function(N){var E=-N.utcOffset(),M=Math.abs(E),A=Math.floor(M/60),$=M%60;return(E<=0?"+":"-")+x(A,2,"0")+":"+x($,2,"0")},m:function N(E,M){if(E.date()<M.date())return-N(M,E);var A=12*(M.year()-E.year())+(M.month()-E.month()),$=E.clone().add(A,h),V=M-$<0,F=E.clone().add(A+(V?-1:1),h);return+(-(A+(M-$)/(V?$-F:F-$))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:h,y:f,w:d,d:u,D:m,h:c,m:l,s:a,ms:s,Q:_}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},S="en",B={};B[S]=w;var k="$isDayjsObject",b=function(N){return N instanceof H||!(!N||!N[k])},C=function N(E,M,A){var $;if(!E)return S;if(typeof E=="string"){var V=E.toLowerCase();B[V]&&($=V),M&&(B[V]=M,$=V);var F=E.split("-");if(!$&&F.length>1)return N(F[0])}else{var z=E.name;B[z]=E,$=z}return!A&&$&&(S=$),$||!A&&S},P=function(N,E){if(b(N))return N.clone();var M=typeof E=="object"?E:{};return M.date=N,M.args=arguments,new H(M)},O=T;O.l=C,O.i=b,O.w=function(N,E){return P(N,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var H=function(){function N(M){this.$L=C(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[k]=!0}var E=N.prototype;return E.parse=function(M){this.$d=function(A){var $=A.date,V=A.utc;if($===null)return new Date(NaN);if(O.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var F=$.match(g);if(F){var z=F[2]-1||0,W=(F[7]||"0").substring(0,3);return V?new Date(Date.UTC(F[1],z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)):new Date(F[1],z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)}}return new Date($)}(M),this.init()},E.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},E.$utils=function(){return O},E.isValid=function(){return this.$d.toString()!==p},E.isSame=function(M,A){var $=P(M);return this.startOf(A)<=$&&$<=this.endOf(A)},E.isAfter=function(M,A){return P(M)<this.startOf(A)},E.isBefore=function(M,A){return this.endOf(A)<P(M)},E.$g=function(M,A,$){return O.u(M)?this[A]:this.set($,M)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(M,A){var $=this,V=!!O.u(A)||A,F=O.p(M),z=function(_e,ce){var ye=O.w($.$u?Date.UTC($.$y,ce,_e):new Date($.$y,ce,_e),$);return V?ye:ye.endOf(u)},W=function(_e,ce){return O.w($.toDate()[_e].apply($.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(ce)),$)},Z=this.$W,K=this.$M,ue=this.$D,Y="set"+(this.$u?"UTC":"");switch(F){case f:return V?z(1,0):z(31,11);case h:return V?z(1,K):z(0,K+1);case d:var U=this.$locale().weekStart||0,ie=(Z<U?Z+7:Z)-U;return z(V?ue-ie:ue+(6-ie),K);case u:case m:return W(Y+"Hours",0);case c:return W(Y+"Minutes",1);case l:return W(Y+"Seconds",2);case a:return W(Y+"Milliseconds",3);default:return this.clone()}},E.endOf=function(M){return this.startOf(M,!1)},E.$set=function(M,A){var $,V=O.p(M),F="set"+(this.$u?"UTC":""),z=($={},$[u]=F+"Date",$[m]=F+"Date",$[h]=F+"Month",$[f]=F+"FullYear",$[c]=F+"Hours",$[l]=F+"Minutes",$[a]=F+"Seconds",$[s]=F+"Milliseconds",$)[V],W=V===u?this.$D+(A-this.$W):A;if(V===h||V===f){var Z=this.clone().set(m,1);Z.$d[z](W),Z.init(),this.$d=Z.set(m,Math.min(this.$D,Z.daysInMonth())).$d}else z&&this.$d[z](W);return this.init(),this},E.set=function(M,A){return this.clone().$set(M,A)},E.get=function(M){return this[O.p(M)]()},E.add=function(M,A){var $,V=this;M=Number(M);var F=O.p(A),z=function(K){var ue=P(V);return O.w(ue.date(ue.date()+Math.round(K*M)),V)};if(F===h)return this.set(h,this.$M+M);if(F===f)return this.set(f,this.$y+M);if(F===u)return z(1);if(F===d)return z(7);var W=($={},$[l]=n,$[c]=r,$[a]=t,$)[F]||1,Z=this.$d.getTime()+M*W;return O.w(Z,this)},E.subtract=function(M,A){return this.add(-1*M,A)},E.format=function(M){var A=this,$=this.$locale();if(!this.isValid())return $.invalidDate||p;var V=M||"YYYY-MM-DDTHH:mm:ssZ",F=O.z(this),z=this.$H,W=this.$m,Z=this.$M,K=$.weekdays,ue=$.months,Y=$.meridiem,U=function(ce,ye,ge,se){return ce&&(ce[ye]||ce(A,V))||ge[ye].slice(0,se)},ie=function(ce){return O.s(z%12||12,ce,"0")},_e=Y||function(ce,ye,ge){var se=ce<12?"AM":"PM";return ge?se.toLowerCase():se};return V.replace(y,function(ce,ye){return ye||function(ge){switch(ge){case"YY":return String(A.$y).slice(-2);case"YYYY":return O.s(A.$y,4,"0");case"M":return Z+1;case"MM":return O.s(Z+1,2,"0");case"MMM":return U($.monthsShort,Z,ue,3);case"MMMM":return U(ue,Z);case"D":return A.$D;case"DD":return O.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return U($.weekdaysMin,A.$W,K,2);case"ddd":return U($.weekdaysShort,A.$W,K,3);case"dddd":return K[A.$W];case"H":return String(z);case"HH":return O.s(z,2,"0");case"h":return ie(1);case"hh":return ie(2);case"a":return _e(z,W,!0);case"A":return _e(z,W,!1);case"m":return String(W);case"mm":return O.s(W,2,"0");case"s":return String(A.$s);case"ss":return O.s(A.$s,2,"0");case"SSS":return O.s(A.$ms,3,"0");case"Z":return F}return null}(ce)||F.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(M,A,$){var V,F=this,z=O.p(A),W=P(M),Z=(W.utcOffset()-this.utcOffset())*n,K=this-W,ue=function(){return O.m(F,W)};switch(z){case f:V=ue()/12;break;case h:V=ue();break;case _:V=ue()/3;break;case d:V=(K-Z)/6048e5;break;case u:V=(K-Z)/864e5;break;case c:V=K/r;break;case l:V=K/n;break;case a:V=K/t;break;default:V=K}return $?V:O.a(V)},E.daysInMonth=function(){return this.endOf(h).$D},E.$locale=function(){return B[this.$L]},E.locale=function(M,A){if(!M)return this.$L;var $=this.clone(),V=C(M,A,!0);return V&&($.$L=V),$},E.clone=function(){return O.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},N}(),R=H.prototype;return P.prototype=R,[["$ms",s],["$s",a],["$m",l],["$H",c],["$W",u],["$M",h],["$y",f],["$D",m]].forEach(function(N){R[N[1]]=function(E){return this.$g(E,N[0],N[1])}}),P.extend=function(N,E){return N.$i||(N(E,H,P),N.$i=!0),P},P.locale=C,P.isDayjs=b,P.unix=function(N){return P(1e3*N)},P.en=B[S],P.Ls=B,P.p={},P})})(ba);var Wd=ba.exports;const wa=qd(Wd),jd=i=>{const e=re.useRouter(),t=re.useRoute(),n=`${i.domain}/api/`,r=be.create({baseURL:n}),s=be.create({baseURL:n}),a=be.create({baseURL:n}),l=be.create({baseURL:n}),c=be.create({baseURL:n}),u=be.create({baseURL:n}),d=be.create({baseURL:n}),h=x=>{try{const T=JSON.parse(localStorage.getItem("authTokensAccess")||"");T.length>0&&(x.headers.Authorization=`Bearer ${T}`)}catch{console.warn("accessToken is undefined [useAxios]")}return x},_=x=>{const T=localStorage.getItem("apiKey"),S=(T==null?void 0:T.replace(/^.(.*).$/,"$1"))||"";return x.headers={"Content-Type":"application/json","x-api-key":S},x},f=async x=>{if(!i.user)return x;const T=i.user.exp??0;if(!(wa.unix(T).diff(wa())<3e3))return x;const B=Cs("authTokensRefresh",null,"string");try{const k=await be.post(`${n}user/token/refresh/`,{refresh:B.value});if(!k.data.access)return w(),x;localStorage.setItem("authTokensAccess",JSON.stringify(k.data.access)),g(k.data),y(Ss(k.data.access)),x.headers={...x.headers,Authorization:`Bearer ${k.data.access}`}}catch(k){console.error("Failed to refresh token:",k),w()}return x},m=x=>{x.interceptors.request.use(T=>f(h(T)),T=>Promise.reject(T))};m(a),m(c),m(d);const p=x=>{x.interceptors.request.use(T=>_(T))};p(u),p(s),p(d);const g=(x,T=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(x.access)),T&&localStorage.setItem("authTokensRefresh",JSON.stringify(x.refresh))},y=x=>{i.user=x,localStorage.setItem("user",JSON.stringify(x))},w=()=>{i.user=null,Fn(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),e.push(`/${t.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:a,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:d,axiosInstancePost:l,axiosInstanceGet:r,axiosInstanceGetApiKey:s,axiosInstancePostApiKey:u}},Ki=(i,e)=>e.some(t=>i instanceof t);let xa,ka;function Xd(){return xa||(xa=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Yd(){return ka||(ka=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ji=new WeakMap,Zi=new WeakMap,ai=new WeakMap;function Gd(i){const e=new Promise((t,n)=>{const r=()=>{i.removeEventListener("success",s),i.removeEventListener("error",a)},s=()=>{t(wn(i.result)),r()},a=()=>{n(i.error),r()};i.addEventListener("success",s),i.addEventListener("error",a)});return ai.set(e,i),e}function Kd(i){if(Ji.has(i))return;const e=new Promise((t,n)=>{const r=()=>{i.removeEventListener("complete",s),i.removeEventListener("error",a),i.removeEventListener("abort",a)},s=()=>{t(),r()},a=()=>{n(i.error||new DOMException("AbortError","AbortError")),r()};i.addEventListener("complete",s),i.addEventListener("error",a),i.addEventListener("abort",a)});Ji.set(i,e)}let Qi={get(i,e,t){if(i instanceof IDBTransaction){if(e==="done")return Ji.get(i);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return wn(i[e])},set(i,e,t){return i[e]=t,!0},has(i,e){return i instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in i}};function Sa(i){Qi=i(Qi)}function Jd(i){return Yd().includes(i)?function(...e){return i.apply(eo(this),e),wn(this.request)}:function(...e){return wn(i.apply(eo(this),e))}}function Zd(i){return typeof i=="function"?Jd(i):(i instanceof IDBTransaction&&Kd(i),Ki(i,Xd())?new Proxy(i,Qi):i)}function wn(i){if(i instanceof IDBRequest)return Gd(i);if(Zi.has(i))return Zi.get(i);const e=Zd(i);return e!==i&&(Zi.set(i,e),ai.set(e,i)),e}const eo=i=>ai.get(i);function Qd(i,e,{blocked:t,upgrade:n,blocking:r,terminated:s}={}){const a=indexedDB.open(i,e),l=wn(a);return n&&a.addEventListener("upgradeneeded",c=>{n(wn(a.result),c.oldVersion,c.newVersion,wn(a.transaction),c)}),t&&a.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),r&&c.addEventListener("versionchange",u=>r(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const ef=["get","getKey","getAll","getAllKeys","count"],tf=["put","add","delete","clear"],to=new Map;function Ca(i,e){if(!(i instanceof IDBDatabase&&!(e in i)&&typeof e=="string"))return;if(to.get(e))return to.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,r=tf.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(r||ef.includes(t)))return;const s=async function(a,...l){const c=this.transaction(a,r?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(l.shift())),(await Promise.all([u[t](...l),r&&c.done]))[0]};return to.set(e,s),s}Sa(i=>({...i,get:(e,t,n)=>Ca(e,t)||i.get(e,t,n),has:(e,t)=>!!Ca(e,t)||i.has(e,t)}));const nf=["continue","continuePrimaryKey","advance"],Ea={},no=new WeakMap,Ta=new WeakMap,rf={get(i,e){if(!nf.includes(e))return i[e];let t=Ea[e];return t||(t=Ea[e]=function(...n){no.set(this,Ta.get(this)[e](...n))}),t}};async function*of(...i){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...i)),!e)return;e=e;const t=new Proxy(e,rf);for(Ta.set(t,e),ai.set(t,eo(e));e;)yield t,e=await(no.get(t)||e.continue()),no.delete(t)}function va(i,e){return e===Symbol.asyncIterator&&Ki(i,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&Ki(i,[IDBIndex,IDBObjectStore])}Sa(i=>({...i,get(e,t,n){return va(e,t)?of:i.get(e,t,n)},has(e,t){return va(e,t)||i.has(e,t)}}));let ro;async function li(){return ro||(ro=Qd("products",2,{upgrade(i,e){e<1&&(i.objectStoreNames.contains("data")||i.createObjectStore("data",{keyPath:"key"})),e<2&&(i.objectStoreNames.contains("images")||i.createObjectStore("images",{keyPath:"id"}))}})),ro}async function sf(i){return(await li()).transaction("data","readonly").objectStore("data").get(i)}async function Na(i,e){const n=(await li()).transaction("data","readwrite");await n.objectStore("data").put({key:i,data:e,timestamp:Date.now()}),await n.done}async function af(i,e){const n=(await li()).transaction("images","readwrite");await n.objectStore("images").put({id:i,blob:e,timestamp:Date.now()}),await n.done}async function Ma(i){const r=await(await li()).transaction("images","readonly").objectStore("images").get(i);return r==null?void 0:r.blob}const ae=class ae{constructor(){me(this,"axiosInstanceGet");me(this,"axiosInstancePost");me(this,"axiosInstanceAuthenticationGet");me(this,"axiosInstanceAuthenticationPost");me(this,"axiosInstanceGetApiKey");me(this,"axiosInstancePostApiKey");me(this,"axiosInstanceAuthenticationPostApiKey");me(this,"currentUpsaleController",null);me(this,"controller",new AbortController);this.axiosInstanceGet=ae._axiosGet,this.axiosInstancePost=ae._axiosPost,this.axiosInstanceGetApiKey=ae._axiosPostApiKey,this.axiosInstancePostApiKey=ae._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=ae._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=ae._axiosAuthGet,this.axiosInstanceAuthenticationPost=ae._axiosAuthPost}static create(e){return e&&!ae._config&&ae._initialize(e),ae._config||console.warn("InitConnection не инициализирован"),new ae}static _initialize(e,t=null){const n=Le(),r=Ke(),{config_lib:s}=J.storeToRefs(n),{stateCard:a,recountGroupTotalAmount:l}=J.storeToRefs(r);ae._config=e,ae._cardStore=r,ae._stateCard=a,ae._recountGroupTotalAmount=l,s.value=e;const c=jd(e);ae._axiosPostApiKey=c.axiosInstanceGetApiKey,ae._axiosPostApiKey=c.axiosInstancePostApiKey,ae._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,ae._axiosGet=c.axiosInstanceGet,ae._axiosPost=c.axiosInstancePost,ae._axiosAuthGet=c.axiosInstanceAuthenticationGet,ae._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return ae._config}get cardStore(){return ae._cardStore}get stateCard(){return ae._stateCard}get recountGroupTotalAmount(){return ae._recountGroupTotalAmount}async updateTheme(){var s,a;const e=JSON.parse(localStorage.getItem("themeConfig"))??null,t=Ge();if(e!==null){t.updateColor(e);return}const n=Le(),r=await((a=this.axiosInstanceGet)==null?void 0:a.get(`org/organizations/${(s=this.config)==null?void 0:s.orgId}/design/`));n.setStateDrum(r==null?void 0:r.data.hide_barban),n.setKioskTimeout(r==null?void 0:r.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(r.data)),t.updateColor(r.data)}async getGroup(){var e,t;try{const n=await((t=this.axiosInstanceGet)==null?void 0:t.get(`${(e=this.config)==null?void 0:e.pointId}/groups/`));return n==null?void 0:n.data}catch(n){return console.error("Error fetching products:",n),[]}}async fetchPage(e){var n,r;const t=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(n=this.config)==null?void 0:n.pointId}/groups/products/?page=${e}`));return(t==null?void 0:t.data.results)||[]}async fetchPageWithInfo(e){var n,r;if(!e||e<1)throw new Error("Пагинация не с 1");const t=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(n=this.config)==null?void 0:n.pointId}/groups/products/?page=${e}`));return(t==null?void 0:t.data)||{count:0,results:[]}}async fetchAndCacheAllPages(){try{const e=bu(1),t=await this.fetchPageWithInfo(1),{count:n=0,results:r=[]}=t;if(n===0)return console.warn("Нет продуктов: count=0"),[];const s=r.length,a=Math.ceil(n/s);await Na("page_1",t);const l=Array.from({length:a-1},(f,m)=>sf(`page_${m+2}`).then(p=>{var g;return((g=p==null?void 0:p.data)==null?void 0:g.results)||[]})),c=await Promise.all(l);if(c.every(f=>f.length>0))return[r,...c].flat();const d=Array.from({length:a-1},(f,m)=>{var g;const p=m+2;return((g=c[m])==null?void 0:g.length)>0?Promise.resolve(c[m]):e(()=>this.fetchPage(p).then(async y=>(await Na(`page_${p}`,{results:y}),y)).catch(y=>(console.error(`Page ${p} failed`,y),[])))}),h=await Promise.all(d),_=[r,...h].flat();return this.cacheImagesInBackground(_),_}catch(e){return console.error("Ошибка в fetchAndCacheAllPages:",e),[]}}cacheImagesInBackground(e){e.forEach(t=>{var s;const n=t.video_link||t.image_link,r=t.id;n&&r&&this.loadAndCacheImage(n,r),(s=t.products)==null||s.forEach(a=>{const l=a.video_link||a.image_link,c=a.id;l&&c&&this.loadAndCacheImage(l,c)})})}async loadAndCacheImage(e,t){const n=await Ma(t);if(n){this.dispatchImageCachedEvent(t,n);return}try{const r=await fetch(e);if(!r.ok)throw new Error("Network error");const s=await r.blob();if(s.size===0)throw new Error("Empty blob");await af(t,s),this.dispatchImageCachedEvent(t,s)}catch(r){console.warn(`[ImageCache] Failed for ${t}:`,r)}}dispatchImageCachedEvent(e,t){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:e,blob:t}}))}async getProduct(e=null){var t,n;if(!e)return[];try{const r=await((n=this.axiosInstanceGet)==null?void 0:n.get(`${(t=this.config)==null?void 0:t.pointId}/products/${e}`));return r==null?void 0:r.data}catch(r){return console.error("Error fetching cardProducts:",r),[]}}async getSingleProduct(e){var s;const t=Le(),n=Ke(),{config_lib:r}=J.storeToRefs(t);try{const a=await((s=this.axiosInstanceGet)==null?void 0:s.get(`${r.value.pointId}/products/${e}`));(a==null?void 0:a.status)===200&&(n.stateCard.openCard={...a.data,amount:1},n.stateCard.groupModifiers=a.data.group_modifiers,a.data.modifiers.length>0&&n.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:a.data.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:a.data.modifiers.reduce((l,c)=>l+=c.min_amount,0),name:"Добавки",required:!1}),n.stateCard.groupModifiersSelected=new Array(n.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),n.stateCard.productSizes=a.data.sizes,n.defaultAmountModifiers(),a.data.show_recommendations&&this.productUpsale(a.data.id))}catch(a){throw console.log("store card[getFetchProducts]:",a),a}}async getTheme(){try{this.updateTheme()}catch(e){return console.error("Error fetching products:",e),[]}}async authorizeByCard(e){var t,n;try{const r=await((n=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:n.post(`${(t=this.config)==null?void 0:t.domain}/api/user/validate-card/`,{card_number:e}));return localStorage.setItem("authTokensAccess",JSON.stringify(r==null?void 0:r.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(r==null?void 0:r.data.refresh)),r==null?void 0:r.data}catch(r){throw console.error("Ошибка авторизации:",r),r}}async getLoyalSmsCode(e){var t,n;try{const r=await((n=this.axiosInstancePostApiKey)==null?void 0:n.post(`${(t=this.config)==null?void 0:t.domain}/api/device/auth/request-otp/`,{phone:e}));return r==null?void 0:r.data}catch(r){throw console.error("Ошибка получения sms-code:",r),r}}async sendSmsCodeForAuth(e,t){var n,r;try{const s=await((r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`${(n=this.config)==null?void 0:n.domain}/api/device/auth/`,{code:e,phone:t}));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка отправки sms-code:",s),s}}async callStaff(e,t){var n,r,s,a;try{const l=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(n=this.config)==null?void 0:n.domain}/api/org_unit/${(r=this.config)==null?void 0:r.pointId}/table/${e}/call-staff/`,{reason:t}));return(a=l==null?void 0:l.data)==null?void 0:a.response_text}catch(l){throw console.error("Ошибка[callWaiter]",l),l}}async createOrder(e,t,n=!0,r,s=!1,a=!1){var f,m,p;const l=zn(),c=s?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,u=n?c:this.axiosInstanceAuthenticationPost,d=n?"/device/order/create":"/order/create",h=n?(f=this.config)==null?void 0:f.pointId:(m=this.config)==null?void 0:m.pointId,_=await(u==null?void 0:u.post(`${(p=this.config)==null?void 0:p.domain}/api/org_unit/${h}${d}`,{items:e,table:t||null,comment:r}));return(_==null?void 0:_.status)===201&&l.orderSocket(_==null?void 0:_.data.id,n,a),_}async initPaymentLink(e,t=!0){const n=t?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,r=Le(),s=t?"TERMINAL":"YOOKASSA",a=await(n==null?void 0:n.post("payment/init",{by_bonuses:r.countBonus,order:e,provider_type:s}));return a==null?void 0:a.data}async orderPay(e){var t;return(t=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:t.post(`order/${e}/pay/`,{order_id:e})}async getProfile(){var t,n;const e=await((n=this.axiosInstanceAuthenticationGet)==null?void 0:n.get(`user/current?organization=${(t=this.config)==null?void 0:t.orgId}`));if((e==null?void 0:e.status)===200){const r=Le();return r.profile=e.data,r.is18Allowed=sessionStorage.getItem("is_adult")==="true",e.data}else return e}async calculateDiscount(e,t=!0,n=!1){var c,u;const r=n?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=t?r:this.axiosInstanceAuthenticationPost,a=t?(c=this.config)==null?void 0:c.pointId:(u=this.config)==null?void 0:u.pointId,l=await(s==null?void 0:s.post(`/org_unit/${a}/cart/calculate-discount/`,e));return(l==null?void 0:l.status)===200?l.data:l}async productUpsale(e){var s,a,l;const t=Ke(),{dataUpSale:n}=J.storeToRefs(t);(s=this.currentUpsaleController)==null||s.abort();const r=new AbortController;this.currentUpsaleController=r;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(a=this.config)==null?void 0:a.pointId}/products/${e}/recommendation/`,{signal:r.signal}));r.signal.aborted||(n.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.log("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===r&&(this.currentUpsaleController=null)}}};me(ae,"_config",null),me(ae,"_axiosGet"),me(ae,"_axiosGetApiKey"),me(ae,"_axiosPostApiKey"),me(ae,"_axiosAuthPostApiKey"),me(ae,"_axiosPost"),me(ae,"_axiosAuthGet"),me(ae,"_axiosAuthPost"),me(ae,"_cardStore",null),me(ae,"_stateCard",null),me(ae,"_recountGroupTotalAmount",null);let Qt=ae;const lf=o.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(i,{expose:e}){const t=i,n=Le(),r=o.ref(null),s=async l=>{if(!r.value||!l)return;let c=window;t.container&&(c=typeof t.container=="string"?document.querySelector(t.container)||window:t.container);const u={behavior:t.behavior};if(t.axis==="x"){const d=c===window?window.innerWidth:c.clientWidth,h=l.offsetWidth;let _=l.offsetLeft;if(c!==window){const f=c.getBoundingClientRect();_=l.getBoundingClientRect().left-f.left+c.scrollLeft}_-=(d-h)/2,u.left=Math.max(0,_)}else{const d=c===window?window.innerHeight:c.clientHeight,h=l.offsetHeight;let _=l.offsetTop;if(c!==window){const f=c.getBoundingClientRect();_=l.getBoundingClientRect().top-f.top+c.scrollTop}_-=(d-h)/2,u.top=Math.max(0,_)}try{c===window?window.scrollTo(u):c.scrollTo(u)}catch(d){console.error("Scroll error:",d)}};o.onMounted(async()=>{if(t.autoScroll){let l=null;if(await o.nextTick(),n.activeScrolling_lib){const c=n.activeScrolling_lib.findIndex(u=>u.id===t.idActive);t.idActive?(l=document.getElementById(`scrolling${t.idActive}`),l&&c!==-1&&(n.activeScrolling_lib[c]=l)):n.activeScrolling_lib[c]&&(l=n.activeScrolling_lib[c]),s(l)}}});const a=async l=>{t.clearContainer&&(n.activeScrolling_lib=[]);const c=l.currentTarget;await o.nextTick(),n.activeScrolling_lib.includes(c)||n.activeScrolling_lib.push(c),s(c)};return e({scrollToElement:s}),(l,c)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:"scroll-to-wrapper"},[o.renderSlot(l.$slots,"default",{handleTargetClick:a},void 0,!0)],512))}}),ke=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t},io=ke(lf,[["__scopeId","data-v-b510c3f1"]]),cf={},uf={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 df(i,e){return o.openBlock(),o.createElementBlock("svg",uf,[...e[0]||(e[0]=[o.createElementVNode("defs",null,null,-1),o.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 oo=ke(cf,[["render",df]]),ff=["id","onClick"],hf={class:"modified_plus_btn"},pf=["src"],mf={key:2,class:"wrapper_modifier_item"},_f={key:0,class:"modifier_item_n_wrapper"},gf=["src"],yf={key:1,class:"modifier_plus_item"},bf=["src"],wf=["src"],xf=ke(o.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(i){const e=Ke(),t=Ge(),{stateCard:n}=J.storeToRefs(e),{itemThemes:r}=J.storeToRefs(t),s=o.ref([]),a=o.ref([]),l=o.ref(null),c=o.ref(null),u=h=>{h instanceof HTMLElement&&!s.value.includes(h)&&s.value.push(h)},d=h=>{c.value=h};return o.onMounted(async()=>{await o.nextTick(),n.value.plusButtonsRefs=s.value}),o.watchEffect(()=>{a.value=n.value.groupModifiersSelected,document.body.style.overflow=""}),o.onBeforeUnmount(()=>{s.value=[],n.value.plusButtonsRefs=[]}),(h,_)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass({card_modified_wrapper_many:o.unref(n).groupModifiers.length>=5})},[o.unref(n).groupModifiersSelected?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["card_modified_wrapper",[o.unref(n).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l,onTouchstart:_[0]||(_[0]=o.withModifiers(()=>{},["stop"])),onPointerdown:_[1]||(_[1]=o.withModifiers(()=>{},["stop"]))},[o.createVNode(io,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:o.withCtx(({handleTargetClick:f})=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(n).groupModifiers,(m,p)=>{var g,y;return o.openBlock(),o.createElementBlock("div",{class:"button_modified",key:m.id,ref_for:!0,ref:u,id:"scrolling"+m.id,"data-clickable":"true",onClick:w=>{i.toggleNotRequire&&i.toggleNotRequire(m,p),d(m.id),f(w)}},[o.createElementVNode("div",hf,[a.value[p].modifiers.length===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass([{modified_plus_btn_active:m.id===((g=o.unref(n).groupCurrentOpen)==null?void 0:g.id)&&i.isSectionModifier},"modified_plus_active"])},[o.createVNode(oo,{"aria-label":`Открыть группу модификаторов ${m.name}`},null,8,["aria-label"])],2)):a.value[p].modifiers.length===1?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:m.id===((y=o.unref(n).groupCurrentOpen)==null?void 0:y.id)&&i.isSectionModifier}])},[o.createElementVNode("img",{src:a.value[p].modifiers[0].image_link||o.unref(r).fallback_image||"",alt:"Модификатор"},null,8,pf)],2)):(o.openBlock(),o.createElementBlock("div",mf,[a.value[p].modifiers.length>2?(o.openBlock(),o.createElementBlock("div",_f,[a.value[p].modifiers.length===3?(o.openBlock(),o.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:a.value[p].modifiers[2].image_link||o.unref(r).fallback_image||""},null,8,gf)):(o.openBlock(),o.createElementBlock("p",yf," + "+o.toDisplayString(a.value[p].modifiers.length-2),1))])):o.createCommentVNode("",!0),o.createElementVNode("div",null,[a.value[p].modifiers.length>0?(o.openBlock(),o.createElementBlock("img",{key:0,src:a.value[p].modifiers[0].image_link||o.unref(r).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,bf)):o.createCommentVNode("",!0),a.value[p].modifiers.length>1?(o.openBlock(),o.createElementBlock("img",{key:1,src:a.value[p].modifiers[1].image_link||o.unref(r).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,wf)):o.createCommentVNode("",!0)])]))]),o.createElementVNode("p",null,o.toDisplayString(m.name),1)],8,ff)}),128))]),_:1},8,["container","idActive"])],34)):o.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-65ff3a99"]]),kf={},Sf={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 Cf(i,e){return o.openBlock(),o.createElementBlock("svg",Sf,[...e[0]||(e[0]=[o.createElementVNode("desc",null," Created with Pixso. ",-1),o.createElementVNode("defs",null,null,-1),o.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),o.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 so=ke(kf,[["render",Cf]]),Ef={key:0,class:"wrapper_modifiers"},Tf={class:"wrapper_nutritional_value"},vf={class:"nutritional_scheme"},Nf={key:0,class:"nutritional_parameters"},Mf={key:1,class:"nutritional_parameters"},Pf={key:2,class:"nutritional_parameters"},Af={key:3,class:"nutritional_parameters"},Bf={class:"modifier_shadow"},Rf={class:"wrapper_modifiers_title"},Df={class:"wrapper_text_count_modifiers"},Of=["onClick","onKeydown","aria-label"],$f={key:0,class:"counter_modifier"},If={class:"hide_image_corners"},Vf=["src","alt"],Lf={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},Ff=["src"],zf={class:"modifier_title"},Uf=ke(o.defineComponent({__name:"SectionModifiers",props:{isModified:{type:Boolean}},setup(i){const e=Ge(),t=Ke(),{itemThemes:n}=J.storeToRefs(e),{stateCard:r,recountGroupTotalAmount:s,groupTotalAmount:a}=J.storeToRefs(t),l=o.ref(null),c=o.ref({}),u=(_,f)=>{f instanceof HTMLElement?c.value[_]=f:c.value[_]=null};o.watch(()=>r.value.isAnimationFly,_=>{_===!0&&r.value.currentModifier&&(h(c.value[r.value.currentModifier.id]),r.value.isAnimationFly=!1),document.body.style.overflow=""});const d=()=>{r.value.isSectionModifier=!1,document.body.style.overflow="scroll"},h=_=>{if(!_)return;const f=r.value.groupModifiers.findIndex(w=>w.id===r.value.groupCurrentOpen.id),m=r.value.plusButtonsRefs[f]||r.value.plusButtonsRefs[0];if(!m)return;const p=_.getBoundingClientRect(),g=m.getBoundingClientRect(),y=_.cloneNode(!0);y.classList.add("flyer"),Object.assign(y.style,{width:`${p.width}px`,height:`${p.height}px`,left:`${p.left}px`,top:`${p.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(y),l.value=y,requestAnimationFrame(()=>{const w=g.left+g.width/3-(p.left+p.width/2),x=g.top+g.height/4-(p.top+p.height/2),T=g.width/p.width*.2;y.style.transform=`translate(${w}px, ${x}px) scale(${T})`,y.style.opacity="0.4",y.style.transition="transform 0.5s ease, opacity 0.5s ease"}),y.addEventListener("transitionend",()=>{y.remove(),l.value=null,m.classList.add("bump"),setTimeout(()=>m.classList.remove("bump"),300)},{once:!0})};return(_,f)=>(o.openBlock(),o.createBlock(o.Transition,{name:"modifiers"},{default:o.withCtx(()=>{var m,p,g,y,w,x,T,S,B,k,b,C;return[i.isModified?(o.openBlock(),o.createElementBlock("div",Ef,[o.createElementVNode("div",Tf,[o.createElementVNode("div",{class:o.normalizeClass(["card_header_inner_back",[(m=o.unref(r).openCard)!=null&&m.proteins_amount?"card_header_inner_back_nutrients":""]]),onClick:d,"aria-label":"Закрыть выбор модификаторов"},[o.createVNode(so,{class:"arrow_bottom"})],2),o.createElementVNode("div",vf,[(p=o.unref(r).openCard)!=null&&p.energy_amount?(o.openBlock(),o.createElementBlock("div",Nf,[o.createElementVNode("b",null,o.toDisplayString((g=o.unref(r).openCard)==null?void 0:g.energy_amount),1),f[2]||(f[2]=o.createElementVNode("p",null,"Килокалории",-1))])):o.createCommentVNode("",!0),(y=o.unref(r).openCard)!=null&&y.proteins_amount?(o.openBlock(),o.createElementBlock("div",Mf,[o.createElementVNode("b",null,o.toDisplayString((w=o.unref(r).openCard)==null?void 0:w.proteins_amount),1),f[3]||(f[3]=o.createElementVNode("p",null,"Белки",-1))])):o.createCommentVNode("",!0),(x=o.unref(r).openCard)!=null&&x.fat_amount?(o.openBlock(),o.createElementBlock("div",Pf,[o.createElementVNode("b",null,o.toDisplayString((T=o.unref(r).openCard)==null?void 0:T.fat_amount),1),f[4]||(f[4]=o.createElementVNode("p",null,"Жиры",-1))])):o.createCommentVNode("",!0),(S=o.unref(r).openCard)!=null&&S.carbohydrates_amount?(o.openBlock(),o.createElementBlock("div",Af,[o.createElementVNode("b",null,o.toDisplayString((B=o.unref(r).openCard)==null?void 0:B.carbohydrates_amount),1),f[5]||(f[5]=o.createElementVNode("p",null,"Углеводы",-1))])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",Bf,[o.createElementVNode("p",Rf,o.toDisplayString((k=o.unref(r).groupCurrentOpen)==null?void 0:k.name),1),o.createElementVNode("p",Df,"Выбрано "+o.toDisplayString(o.unref(s))+" из "+o.toDisplayString(o.unref(a)),1),o.createElementVNode("div",{class:o.normalizeClass((b=o.unref(r).groupModifiers.find(P=>{var O;return P.id===((O=o.unref(r).groupCurrentOpen)==null?void 0:O.id)}))!=null&&b.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column"),onTouchstart:f[0]||(f[0]=o.withModifiers(()=>{},["stop"])),onPointerdown:f[1]||(f[1]=o.withModifiers(()=>{},["stop"]))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((C=o.unref(r).groupCurrentOpen)==null?void 0:C.group_modifiers)||[],P=>{var O,H,R;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["modifier_card",{hidden_modifier_card:P.default_amount===0&&((O=o.unref(r).groupCurrentOpen)==null?void 0:O.id)==="Добавки2000"&&P.min_amount===0&&P.max_amount===0}]),key:P.id,onClick:N=>o.unref(t).modifierSelect(P),onKeydown:o.withKeys(N=>o.unref(t).modifierSelect(P),["enter"]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${P.name}`,ref_for:!0,ref:N=>u(P.id,N)},[o.createElementVNode("div",{class:o.normalizeClass([{modifier_card_active:o.unref(r).groupModifiersSelected.some(N=>{var E;return N.group===((E=o.unref(r).groupCurrentOpen)==null?void 0:E.id)&&N.modifiers.some(M=>M.id===P.id)})},"wrapper_image_corners"])},[P.amount>1?(o.openBlock(),o.createElementBlock("div",$f,o.toDisplayString(P.amount),1)):o.createCommentVNode("",!0),o.createElementVNode("div",If,[P.video_link?(o.openBlock(),o.createElementBlock("video",Lf,[o.createElementVNode("source",{src:P.video_link||"",type:"video/webm"},null,8,Ff)])):(o.openBlock(),o.createElementBlock("img",{key:0,class:"modifier_image",src:P.image_link||o.unref(n).fallback_image||"",alt:P.name},null,8,Vf)),o.createElementVNode("div",{class:o.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:P.min_amount>0||P.required}])},[o.createElementVNode("h3",zf,o.toDisplayString(P.name),1),o.createElementVNode("p",null,"+"+o.toDisplayString(((R=(H=P.sizes)==null?void 0:H.find(N=>N.id===o.unref(r).selectedSize.id))==null?void 0:R.price)||P.price||0)+"₽",1)],2)])],2)],42,Of)}),128))],34)])])):o.createCommentVNode("",!0)]}),_:1}))}}),[["__scopeId","data-v-4b716357"]]),Hf={key:0,class:"card_size_place"},qf=["onClick","onKeydown","aria-label"],Wf={key:1,class:"card_size static"},jf=["onClick","onKeydown","aria-label"],ao=3,Xf=ke(o.defineComponent({__name:"SizeModifier",setup(i){const e=Ke(),{stateCard:t}=J.storeToRefs(e),n=o.ref(null),r=o.ref(50),s=o.ref(),a=o.ref(0),l=o.ref(0),c=o.ref(null),u=o.computed(()=>{var w;if(t.value.productSizes.length<=3)return t.value.productSizes[s.value.index]||t.value.productSizes[0];const g=a.value+1,y=((w=h.value[g])==null?void 0:w.originalIndex)??1;return t.value.productSizes[y]}),d=()=>{c.value&&t.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/ao)},h=o.computed(()=>{if(t.value.productSizes.length<=3)return t.value.productSizes;const g=t.value.productSizes;return[...g.map((y,w)=>({...y,originalIndex:w})),...g.map((y,w)=>({...y,originalIndex:w})),...g.map((y,w)=>({...y,originalIndex:w}))]}),_=(g,y)=>{if(s.value={id:g.id,title:g.name,index:y,is_default:g.is_default},g.price!==null&&t.value.openCard&&(t.value.openCard={...t.value.openCard,price:g.price}),t.value.selectedSize=g,t.value.productSizes.length>3){d();const w=a.value+1;y<w?f():y>w&&m()}else{const w=t.value.productSizes.length,x=(y+.5)*(100/w);r.value=x}},f=()=>{var g;if(!(t.value.productSizes.length<=3)){if(a.value--,a.value<t.value.productSizes.length-ao+1){a.value+=t.value.productSizes.length;const y=(g=c.value)==null?void 0:g.querySelector(".card_size");y&&(y.style.transition="none",y.style.transform=`translateX(-${a.value*l.value}px)`,y.offsetHeight,y.style.transition="transform 0.2s ease-in-out")}p()}},m=()=>{var g;if(!(t.value.productSizes.length<=3)){if(a.value++,a.value>=t.value.productSizes.length*2){a.value-=t.value.productSizes.length;const y=(g=c.value)==null?void 0:g.querySelector(".card_size");y&&(y.style.transition="none",y.style.transform=`translateX(-${a.value*l.value}px)`,y.offsetHeight,y.style.transition="transform 0.2s ease-in-out")}p()}},p=()=>{var x;if(t.value.productSizes.length<=3)return;const g=a.value+1,y=((x=h.value[g])==null?void 0:x.originalIndex)??0,w=t.value.productSizes[y];s.value={id:w.id,title:w.name,index:y,is_default:w.is_default}};return o.watch(()=>[t.value.productSizes,c.value],([g=[],y])=>{if(Array.isArray(g)&&g.length>0&&y!==null){let w=g.findIndex(x=>x.is_default===!0);g.length<3&&n.value&&parseInt(n.value.style.minWidth)<767&&(n.value.style.width="100px"),w>-1?(a.value=w,_(g[w],w),l.value=120/ao):g.length===2||g.length===1?(_(g[0],0),r.value=(0+.5)*(100/2)):(_(g[1],1),r.value=(1+.5)*(100/3))}}),o.watch(()=>{var g;return[(g=t.value.selectedSize)==null?void 0:g.id,t.value.groupModifiersSelected]},([g,y])=>{if(!g||!Array.isArray(y))return;const w=y.map(x=>({...x,modifiers:x.modifiers.map(T=>{if(!T.sizes||T.sizes.length===0)return T;const S=T.sizes.find(B=>B.id===g);return S?{...T,size:S,price:S.price??T.price}:T})}));JSON.stringify(w)!==JSON.stringify(t.value.groupModifiersSelected)&&(t.value.groupModifiersSelected=w)},{deep:!0}),o.onBeforeUnmount(()=>{window.removeEventListener("resize",d)}),(g,y)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:n},[o.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[o.unref(t).productSizes.length>1&&s.value?(o.openBlock(),o.createElementBlock("div",Hf,[o.unref(t).productSizes.length>3?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"card_size",style:o.normalizeStyle({transform:`translateX(-${a.value*l.value}px)`})},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h.value,(w,x)=>(o.openBlock(),o.createElementBlock("li",{key:`${w.id}-${x}`,onClick:T=>_(w,x),onKeydown:o.withKeys(T=>_(w,x),["enter"]),class:o.normalizeClass({active:s.value.id===w.id&&s.value.index===w.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${w.name}`},o.toDisplayString(w.alt_name?w.alt_name:w.name),43,qf))),128))],4)):(o.openBlock(),o.createElementBlock("ul",Wf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(t).productSizes,(w,x)=>(o.openBlock(),o.createElementBlock("li",{key:`${w.id}-${x}`,onClick:T=>_(w,x),onKeydown:o.withKeys(T=>_(w,x),["enter"]),class:o.normalizeClass({active:s.value.id===w.id&&s.value.index===x}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${w.name}`},o.toDisplayString(w.alt_name?w.alt_name:w.name),43,jf))),128))])),u.value?(o.openBlock(),o.createElementBlock("div",{key:2,class:"size_active",style:o.normalizeStyle(o.unref(t).productSizes.length<=3?{left:`${r.value}%`}:{})},[o.createElementVNode("p",null,o.toDisplayString(u.value.alt_name?u.value.alt_name:u.value.name),1)],4)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],512)],512)),[[o.vShow,o.unref(t).productSizes.length>1&&s.value]])}}),[["__scopeId","data-v-2571f98b"]]),Yf="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",Gf={class:"counter_container"},Kf={class:"card_size_place_wrapper",ref:"sliderWrapper"},Jf={class:"cart_amount_counter"},Zf={class:"button_circle_number"},Qf=ke(o.defineComponent({__name:"NumberModifier",setup(i){const e=Ke(),{stateCard:t}=J.storeToRefs(e),n=()=>{var s,a;(s=t.value.openCard)!=null&&s.amount&&((a=t.value.openCard)==null?void 0:a.amount)>1&&(t.value.openCard.amount-=1)},r=()=>{var s;(s=t.value.openCard)!=null&&s.amount&&(t.value.openCard.amount+=1)};return(s,a)=>{var l,c;return o.openBlock(),o.createElementBlock("div",Gf,[o.createElementVNode("div",Kf,[o.createElementVNode("div",Jf,[o.createElementVNode("p",{class:o.normalizeClass(["cart_circle_minus",[((l=o.unref(t).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:o.withModifiers(n,["stop","prevent"])},[...a[0]||(a[0]=[o.createElementVNode("span",null,null,-1)])],2),o.createElementVNode("p",Zf,o.toDisplayString((c=o.unref(t).openCard)==null?void 0:c.amount),1),o.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:o.withModifiers(r,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-c3d45434"]]);function Pa(i,e=800){const t=o.ref(i),n=o.ref(i);let r=null,s=null,a=i;const l=c=>{s||(s=c);const u=c-s,d=Math.min(u/e,1),h=d<.5?4*d*d*d:1-Math.pow(-2*d+2,3)/2;t.value=Math.round(a+(n.value-a)*h),d<1?r=requestAnimationFrame(l):(t.value=n.value,r=null)};return o.watch(n,()=>{r&&cancelAnimationFrame(r),a=t.value,s=null,r=requestAnimationFrame(l)},{immediate:!0}),o.onUnmounted(()=>{r&&cancelAnimationFrame(r)}),{displayNumber:t,targetNumber:n,update:c=>{n.value=c}}}const Mt=o.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(i){const e=i,{displayNumber:t,update:n}=Pa(e.price||0,e.duration||800);return o.watchEffect(()=>{n(e.price)}),(r,s)=>(o.openBlock(),o.createElementBlock("span",null,o.toDisplayString(o.unref(t).toFixed(i.fixedFloat)),1))}}),eh=["disabled","id"],en=o.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(i){const e=i,t=()=>{e.onClick()};return(n,r)=>(o.openBlock(),o.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:i.disabled,onClick:t,id:i.disabled?"buttonDefaultDisabled":""},o.toDisplayString(i.textButtonDefault),9,eh))}}),th={class:"notification_info"},nh={key:0,class:"notification_18plus"},rh={class:"notification_18plus_image"},ih=["src"],oh={class:"notification_18plus_text"},sh={class:"notification_18plus_accept"},ah={key:1,class:"notification_text"},lh={key:0,class:"wrapper_button_accept"},lo=o.defineComponent({__name:"NotificationWindow",props:o.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(i){const e=i,t=Ge(),n=Le(),{is18Allowed:r}=J.storeToRefs(n),{itemThemes:s}=J.storeToRefs(t),a=o.computed(()=>e.backgroundColor||"rgba(50, 50, 50, 0.9)"),l=o.useModel(i,"visible"),c=()=>{sessionStorage.setItem("is_adult","true"),r.value=!0,l.value=!1},u=()=>{l.value=!1};return(d,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.Transition,{name:"notificationBlack",appear:""},{default:o.withCtx(()=>[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"notification_background_black",onClick:u})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{name:"notification",appear:""},{default:o.withCtx(()=>{var _;return[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"notification_overlay",onClick:u},[o.createElementVNode("div",{class:"notification_wrapper",style:o.normalizeStyle({"background-color":a.value,border:`2px solid ${a.value}`})},[o.createElementVNode("div",th,[i.type?(o.openBlock(),o.createElementBlock("div",nh,[o.createElementVNode("div",rh,[o.createElementVNode("img",{src:o.unref(s).adult_disclaimer_image||o.unref(s).fallback_image,alt:"Дисклеймер"},null,8,ih)]),o.createElementVNode("div",oh,o.toDisplayString(o.unref(s).adult_disclaimer_text),1),o.createElementVNode("div",sh,[h[0]||(h[0]=o.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой.",-1)),o.createVNode(en,{textButtonDefault:"Мне есть 18",onClick:c,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(o.openBlock(),o.createElementBlock("div",ah,[o.createTextVNode(o.toDisplayString(i.textNotificationDefault)+" ",1),(_=i.buttonAccept)!=null&&_.state?(o.openBlock(),o.createElementBlock("div",lh,[o.createVNode(en,{class:"button_accept",textButtonDefault:i.buttonAccept.text,onClick:i.buttonAccept.acceptBtn,disabled:i.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):o.createCommentVNode("",!0)]))])],4)])):o.createCommentVNode("",!0)]}),_:1})],64))}}),ch={class:"button_price button_price_modifiers"},uh=["src"],dh={class:"button_text_container"},fh={class:"button_text_price"},hh=ke(o.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(i){const e=re.useRouter(),t=re.useRoute(),n=Ke(),r=Le(),s=Ge(),a=o.ref([]),l=o.ref([]),c=i,{stateCard:u,totalPrice_libCard:d,isOpenWindow:h,isAddToCard:_}=J.storeToRefs(n),{itemThemes:f}=J.storeToRefs(s),m=o.ref(!0),p=o.ref(!1),g=()=>{var w,x,T,S,B,k;if(m.value){n.setCurrentCard(u.value.openCard),p.value=!0;const b=u.value.groupModifiers.findIndex(C=>n.checkedRequiredBtn.group.id===C.id);n.checkedRequiredBtn.haveRequaire&&n.toggleNotRequire(n.checkedRequiredBtn.group,b);return}const y=u.value.groupModifiersSelected||[];if(a.value=[],l.value=[],Array.isArray(y)&&y.length>0&&y.forEach(b=>{const C=b.group,P=b.modifiers||[];C==="Добавки2000"?a.value=P.map(O=>{var H;return{...O,old_price:O.price,size:Array.isArray(O.size)?O.size.map(R=>R.id).filter(Boolean):(H=O.size)!=null&&H.id?O.size.id:void 0}}):P.length>0&&l.value.push({group:C,modifiers:P.map(O=>{var H;return{...O,old_price:O.price,size:Array.isArray(O.size)?O.size.map(R=>R.id).filter(Boolean):(H=O.size)!=null&&H.id?O.size.id:void 0}})})}),document.body.style.overflow="",u.value.openCard){const b={id:u.value.openCard.id,is_fake:u.value.openCard.is_fake||!1,amount:u.value.openCard.amount,name:u.value.openCard.name,image_link:u.value.openCard.image_link,price:u.value.openCard.price,old_price:u.value.openCard.price,size:((w=u.value.selectedSize)==null?void 0:w.id)??((T=(x=u.value.openCard.sizes)==null?void 0:x.find(C=>C.is_default))==null?void 0:T.id),sizes:((S=u.value.selectedSize)==null?void 0:S.id)??((k=(B=u.value.openCard.sizes)==null?void 0:B.find(C=>C.is_default))==null?void 0:k.id),modifiers:a.value,group_modifiers:l.value,energy_amount:u.value.openCard.energy_amount??0,proteins_amount:u.value.openCard.proteins_amount??0,fat_amount:u.value.openCard.fat_amount??0,carbohydrates_amount:u.value.openCard.carbohydrates_amount??0};c.closeProduct&&c.closeProduct(),r.addToCart(b),_.value=!0}h.value=!1,e.push(`/${t.params.orgId}/`)};return o.watch(()=>u.value.productSizes,y=>{!y||y.length===0||!u.value.selectedSize||(u.value.selectedSize={...u.value.selectedSize})},{immediate:!0}),o.watchEffect(()=>{n.checkedRequiredBtn.haveRequaire?m.value=!0:m.value=!1}),o.onMounted(()=>{_.value=!1}),(y,w)=>(o.openBlock(),o.createElementBlock("div",{class:"button_price_bg_product",onTouchstart:w[3]||(w[3]=o.withModifiers(()=>{},["stop"])),onPointerdown:w[4]||(w[4]=o.withModifiers(()=>{},["stop"]))},[o.createVNode(lo,{visible:p.value,textNotificationDefault:o.unref(u).textErrorRequaired,backgroundColor:o.unref(f).accent_color?o.unref(f).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":w[0]||(w[0]=x=>p.value=x)},null,8,["visible","textNotificationDefault","backgroundColor"]),o.createElementVNode("div",ch,[o.createVNode(Qf),o.createElementVNode("div",{class:o.normalizeClass(["card_product_button_buy",{buy_active:!m.value}]),"data-clickable":"true",onClick:g,onTouchstart:w[1]||(w[1]=o.withModifiers(()=>{},["stop"])),onPointerdown:w[2]||(w[2]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("img",{src:o.unref(Yf),class:"card_product_button_icon"},null,8,uh),o.createElementVNode("div",dh,[o.createElementVNode("p",fh,[o.createVNode(Mt,{price:+o.unref(d),fixedFloat:2},null,8,["price"]),w[5]||(w[5]=o.createTextVNode(" ₽ ",-1))])])],34)])],32))}}),[["__scopeId","data-v-dcf9a7ff"]]),ph={class:"modified_amount"},mh={class:"hide_image_corners"},_h=["src"],gh={class:"wrapper_modifier_title"},yh={class:"amount_title"},bh={class:"wrapper_amount_counter"},wh={class:"amount_count"},xh={class:"amount_wrapper"},kh={class:"add_counter_amount"},Sh=ke(o.defineComponent({__name:"ModalAmount",setup(i){const e=Ke(),t=Ge(),{itemThemes:n}=J.storeToRefs(t),{stateCard:r}=J.storeToRefs(e),s=o.computed(()=>{var c,u,d;return((d=(u=(c=r.value.currentModifier)==null?void 0:c.sizes)==null?void 0:u.find(h=>h.id===r.value.selectedSize.id))==null?void 0:d.price)??dr(r.value.currentModifier)}),a=()=>{r.value.currentModifier&&(r.value.currentModifier.amount=r.value.modalCount),e.modifierSelect(r.value.currentModifier),r.value.isModifiedAmount=!1},l=()=>{r.value.modalCount=1,r.value.currentModifier.amount=1};return(c,u)=>{var d,h;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",ph,[o.createElementVNode("div",mh,[o.createElementVNode("img",{class:"modifier_image",src:((d=o.unref(r).currentModifier)==null?void 0:d.image_link)||o.unref(n).fallback_image||""},null,8,_h),o.createElementVNode("div",gh,[o.createElementVNode("p",yh,o.toDisplayString((h=o.unref(r).currentModifier)==null?void 0:h.name),1),o.createElementVNode("p",null,"+ "+o.toDisplayString(s.value)+"₽",1)])])]),o.createElementVNode("div",bh,[o.createElementVNode("div",{class:"amount_mines",onClick:u[0]||(u[0]=o.withModifiers((..._)=>o.unref(e).minusAmount&&o.unref(e).minusAmount(..._),["stop"]))},[...u[1]||(u[1]=[o.createElementVNode("div",null,null,-1)])]),o.createElementVNode("p",wh,o.toDisplayString(o.unref(r).modalCount),1),o.createElementVNode("div",xh,[o.createVNode(oo,{onClick:o.withModifiers(o.unref(e).plusAmount,["stop"])},null,8,["onClick"])])]),o.createElementVNode("p",{class:"clear_count",onClick:o.withModifiers(l,["stop"])},"Убрать все"),o.createElementVNode("div",kh,[o.createVNode(en,{textButtonDefault:"Добавить",onClick:a,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-6b4f039c"]]),Aa=o.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(i){const e=i;return o.watch(()=>e.data,t=>{document.body.style.overflow=t?"hidden":""}),()=>{}}}),Ch={class:"card_product_wrapper"},Eh={class:"card__pictures"},Th={key:0,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},vh=["src"],Nh=["src"],Mh={class:"card_header_wrapper"},Ph={key:0,class:"card_fire_kkal_wrapper"},Ah={class:"card_content"},Bh={class:"wrapper_size"},Rh={key:0,class:"upsell_wrapper"},Dh={key:1,class:"description"},Oh={key:2,id:"openSelectionModifiers"},$h=ke(o.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(i){const e=Ge(),t=Ke(),{stateCard:n,isOpenWindow:r,dataUpSale:s}=J.storeToRefs(t),{itemThemes:a}=J.storeToRefs(e),l=re.useRouter(),c=re.useRoute(),u=i,d=()=>{u.configPage.qr_menu?l.push(`/${c.params.orgId}`):u.configPage.closeProduct(),document.body.style.overflow="auto"},h=()=>{n.value.isModifiedAmount=!1};return o.watch(()=>u.configPage.data,_=>{t.setCurrentCard(_)}),o.watchEffect(()=>{document.body.style.overflow="",r.value||(r.value=u.configPage.is_closeProduct)}),o.onBeforeUnmount(()=>{t.reset(),document.body.style.overflow=""}),(_,f)=>{var p,g,y,w,x,T,S,B,k,b;const m=o.resolveComponent("Upsell");return o.openBlock(),o.createElementBlock("div",Ch,[o.createVNode(Aa,{data:o.unref(n).isModifiedAmount},null,8,["data"]),o.unref(n).isModifiedAmount?(o.openBlock(),o.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:o.withModifiers(h,["stop"])},[o.createVNode(Sh)])):o.createCommentVNode("",!0),o.createElementVNode("div",Eh,[o.createElementVNode("div",{class:"card__pictures__gradient",style:o.normalizeStyle(o.unref(a).gradientStyle)},null,4),(p=o.unref(n).openCard)!=null&&p.video_link?(o.openBlock(),o.createElementBlock("video",Th,[o.createElementVNode("source",{src:((g=o.unref(n).openCard)==null?void 0:g.video_link)??"",type:"video/webm"},null,8,vh)])):(o.openBlock(),o.createElementBlock("img",{key:1,class:"card__pictures_images",src:((y=o.unref(n).openCard)==null?void 0:y.image_link)||o.unref(a).fallback_image||"",alt:"Product image"},null,8,Nh)),o.createElementVNode("div",Mh,[o.createVNode(so,{class:"card_header_back",onClick:d,"aria-label":"Вернуться назад"}),(w=o.unref(n).openCard)!=null&&w.energy_amount?(o.openBlock(),o.createElementBlock("div",Ph,[f[1]||(f[1]=o.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),o.createElementVNode("p",null,[o.createElementVNode("b",null,o.toDisplayString((x=o.unref(n).openCard)==null?void 0:x.energy_amount),1),f[0]||(f[0]=o.createTextVNode(" Ккал ",-1))])])):o.createCommentVNode("",!0)]),o.createElementVNode("h4",null,o.toDisplayString((T=o.unref(n).openCard)==null?void 0:T.name),1)]),o.createVNode(Uf,{isModified:o.unref(n).isSectionModifier},null,8,["isModified"]),o.createElementVNode("div",Ah,[o.withDirectives(o.createElementVNode("div",Bh,[o.createVNode(Xf)],512),[[o.vShow,!o.unref(n).isSectionModifier]]),(S=o.unref(n).openCard)!=null&&S.upsell_set&&!o.unref(n).isSectionModifier?(o.openBlock(),o.createElementBlock("div",Rh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((B=o.unref(n).openCard)==null?void 0:B.upsell_set.upsell_items)||[],C=>(o.openBlock(),o.createBlock(m,{key:C.id,data:C,is_upsell:!0},null,8,["data"]))),128))])):o.createCommentVNode("",!0),!o.unref(n).isSectionModifier&&((k=o.unref(n).openCard)!=null&&k.description)?(o.openBlock(),o.createElementBlock("p",Dh,o.toDisplayString((b=o.unref(n).openCard)==null?void 0:b.description),1)):o.createCommentVNode("",!0),o.unref(n).groupModifiers.length?(o.openBlock(),o.createElementBlock("div",Oh,[f[2]||(f[2]=o.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),o.createVNode(xf,{isSectionModifier:o.unref(n).isSectionModifier,toggleNotRequire:o.unref(t).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):o.createCommentVNode("",!0),o.createVNode(hh,{qr_menu:i.configPage.qr_menu,closeProduct:i.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-c420b27b"]]),Ih={key:0,class:"popupWindowDefault_overlay"},Ba=ke(o.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,r=()=>{n("update:visible",!1)};return o.watch(()=>t.visible,async s=>{s&&await o.nextTick(),t.isVisible=s}),(s,a)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:a[0]||(a[0]=()=>{n("update:visible",!1)})},{default:o.withCtx(()=>[t.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:"background_black",onClick:r})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:a[1]||(a[1]=()=>{n("update:visible",!1)})},{default:o.withCtx(()=>[t.visible?(o.openBlock(),o.createElementBlock("div",Ih,[o.renderSlot(s.$slots,"default",{},void 0,!0)])):o.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),Vh={},Lh={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fh(i,e){return o.openBlock(),o.createElementBlock("svg",Lh,[...e[0]||(e[0]=[o.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 zh=ke(Vh,[["render",Fh]]),co=J.defineStore("modals",()=>{const i=new Map,e=(r,s)=>{const a=n(r).value;a.visible=!0,a.context=s},t=r=>{const s=n(r).value;s.visible=!1},n=r=>(i.has(r)||i.set(r,o.ref({visible:!1})),i.get(r));return{state:n,open:e,close:t}}),Uh=["src"],Hh={class:"cart_box_content_wrapper"},qh={class:"cart_box_content_info"},Wh={class:"cart_amount"},jh={class:"cart_amount_count"},Xh={class:"cart_box_info_more"},Yh={key:1,class:"cart_modifier_info"},Gh={class:"cart_modifier_content"},Kh={class:"wrapper_price_count_cart"},Jh={class:"count_cart_box"},Zh={class:"wrapper_modifiers_discount"},Ra=ke(o.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(i,{emit:e}){const t=i,n=Le(),r=Ge(),s=co(),{itemThemes:a}=J.storeToRefs(r),l=o.ref(0),c=o.ref(0),u=o.ref(!1),d=o.ref(!1),h=o.ref(!1),{displayNumber:_,update:f}=Pa(0,800),m=o.computed(()=>{var P,O;const b=((P=t.cardItem)==null?void 0:P.modifiers)??[],C=(((O=t.cardItem)==null?void 0:O.group_modifiers)??[]).flatMap(H=>H.modifiers??[]);return[...b,...C]}),p=o.computed(()=>{var b,C;return((b=t.cardItem)==null?void 0:b.total_new_price)||dr(t.cardItem)*((C=t.cardItem)==null?void 0:C.amount)}),g=()=>s.open("cart-delete-confirm",t.cardItem),y=()=>{h.value=!h.value},w=()=>{n.plusAmount(t.cardItem.idSystem)},x=()=>{t.cardItem.amount>1?n.minusAmount(t.cardItem.idSystem):g()},T=b=>{l.value=b.touches[0].clientX,u.value=!0},S=b=>{u.value&&(c.value=b.touches[0].clientX-l.value,c.value>0&&(c.value=0))},B=()=>{u.value=!1,c.value<-115&&g(),c.value=0};o.onMounted(()=>{t.index===0&&(d.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,d.value=!1},700)},0))});const k=o.computed(()=>{const b=t.index===0&&d.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:b,transition:u.value?"none":"transform 0.7s, opacity 0.7s"}});return o.watch(p,f,{immediate:!0}),(b,C)=>{var P,O,H,R,N;return o.openBlock(),o.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:T,onTouchmove:S,onTouchend:B,style:o.normalizeStyle(k.value)},[C[2]||(C[2]=o.createElementVNode("div",{class:"wrapper_cart_delete"},[o.createElementVNode("div",{class:"cart_delete"})],-1)),o.createElementVNode("img",{src:((P=i.cardItem)==null?void 0:P.image_link)||o.unref(a).fallback_image||"",class:"cart_box_image"},null,8,Uh),o.createElementVNode("div",Hh,[o.createElementVNode("div",qh,[o.createElementVNode("p",null,o.toDisplayString((O=i.cardItem)==null?void 0:O.name),1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((H=t.cardItem)==null?void 0:H.discounts)||[],(E,M)=>(o.openBlock(),o.createElementBlock("div",{key:M,class:"discount_banner"},[o.createElementVNode("p",null,o.toDisplayString(E.name),1),o.createElementVNode("p",null,o.toDisplayString(E.discount)+"₽",1)]))),128)),o.createElementVNode("div",Wh,[o.createElementVNode("button",{onClick:x},"-"),o.createElementVNode("p",jh,o.toDisplayString(t.cardItem.amount),1),o.createElementVNode("button",{onClick:w},"+")])]),o.createElementVNode("div",Xh,[o.createElementVNode("div",{class:"cart_box_remove_item",onClick:g},[o.createVNode(zh)]),(R=t.cardItem)!=null&&R.new_price?(o.openBlock(),o.createElementBlock("p",{key:0,class:o.normalizeClass({discount_new_price:(N=t.cardItem)==null?void 0:N.new_price})},o.toDisplayString((t.cardItem.new_price*t.cardItem.amount).toFixed(2)+"₽"),3)):o.createCommentVNode("",!0),o.createElementVNode("p",null,o.toDisplayString(o.unref(_).toFixed(2)+"₽"),1)])]),!h.value&&m.value.length>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:o.withModifiers(y,["stop"])},[...C[0]||(C[0]=[o.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),o.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):o.createCommentVNode("",!0),h.value?(o.openBlock(),o.createElementBlock("div",Yh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,E=>{var M;return o.openBlock(),o.createElementBlock("div",{class:"cart_modifier_item",key:E.id},[o.createElementVNode("div",Gh,[o.createVNode(oo,{id:"plus_orange"}),o.createElementVNode("p",null,o.toDisplayString(E.name),1)]),o.createElementVNode("div",Kh,[o.createElementVNode("p",Jh,o.toDisplayString(`x${E.amount}`),1),o.createElementVNode("div",Zh,[E!=null&&E.new_price?(o.openBlock(),o.createElementBlock("p",{key:0,class:o.normalizeClass({discount_new_price:(M=E==null?void 0:E.new_price)==null?void 0:M.toFixed(2)})},o.toDisplayString((E.new_price*E.amount).toFixed(2)+"₽"),3)):o.createCommentVNode("",!0),o.createElementVNode("p",null,o.toDisplayString((E.total_new_price||E.price*E.amount).toFixed(2)+"₽"),1)])])])}),128)),o.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:o.withModifiers(y,["stop"])},[...C[1]||(C[1]=[o.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),o.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):o.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-491ab42e"]]),Qh={},ep={class:"nfc_x",viewBox:"0 0 48 48"};function tp(i,e){return o.openBlock(),o.createElementBlock("svg",ep,[...e[0]||(e[0]=[o.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),o.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const np=ke(Qh,[["render",tp]]),rp={},ip={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function op(i,e){return o.openBlock(),o.createElementBlock("svg",ip,[...e[0]||(e[0]=[o.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),o.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),o.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const sp=ke(rp,[["render",op]]),ap={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},lp=o.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(i){return(e,t)=>i.styleRetry?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("svg",ap,[...t[0]||(t[0]=[o.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),o.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),cp={class:"sheet_header"},up={class:"sheet_title",id:"sheetTitle"},dp={class:"sheet_body"},fp={class:"sheet_card"},hp={class:"nfc_title"},pp={class:"lead"},mp={class:"wrapper_input_accept"},_p={key:0,class:"card_phone_auth_wrapper"},gp={class:"sr_only","aria-live":"polite"},Da=o.defineComponent({__name:"CardReader",setup(i){const e=Le(),t=Ge(),{is_OpenLoyal:n}=J.storeToRefs(e),{itemThemes:r}=J.storeToRefs(t),s=zn(),a=o.ref(),l=o.ref(),c=o.ref(null),u=o.ref(""),d={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},h=o.computed({get:()=>u.value,set:A=>{u.value=A.replace(/\s/g,"")}}),_=o.computed(()=>s.currentState),f=o.computed(()=>s.isDrawerOpen),m=o.computed(()=>{var A;return((A=d[_.value])==null?void 0:A.text)||""}),p=o.computed(()=>{var A;(A=d[_.value])!=null&&A.title}),g=o.computed(()=>_.value==="success"?"Добро пожаловать!":r.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),y=o.computed(()=>({ok:_.value==="success",warn:_.value==="not_found"})),w=o.computed(()=>{const A=[];return _.value==="wait"&&A.push("pulse","show-x"),_.value==="not_found"&&A.push("pulse","show-x"),_.value==="success"&&A.push("pulse","show-ok"),A}),x=o.computed(()=>_.value==="not_found"),T=o.computed(()=>_.value==="success"),S=o.computed(()=>_.value==="not_found"),B=o.computed(()=>["not_found"].includes(_.value)),k=o.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[_.value]||""),b=()=>{s.closeDrawer(),n.value=!0},C=async A=>{var $,V;s.error="",c.value=null;try{const F=new Qt;await F.authorizeByCard(A.trim()),await F.getProfile(),e.loadCart(),s.setState("success"),s.isDrawerOpen=!1,s.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(F){s.error=((V=($=F.response)==null?void 0:$.data)==null?void 0:V.user_friendly_message)||"Ошибка",s.setState("not_found"),c.value=h.value,h.value=""}},P=()=>{var A;s.setState("wait"),s.error="",h.value="",c.value=null,(A=a.value)==null||A.focus()},O=()=>{s.closeDrawer(),c.value=null,h.value=""},H=()=>{var A,$;s.setState("wait"),($=(A=h.value)==null?void 0:A.trim())!=null&&$.length&&C(h.value.trim())},R=A=>{A.stopPropagation(),document.activeElement!==l.value&&N()},N=()=>{o.nextTick(()=>{l.value&&(l.value.focus(),u.value&&l.value.select())})},E=A=>{const $=document.activeElement===l.value;if(!f.value||$)return;const V=A.key.toLowerCase();if(V==="backspace")return h.value=h.value.slice(0,-1);if(V==="escape")return O();if(V==="r"&&S.value)return P();if(V==="c"&&_.value==="success")return O();if(V==="enter")return H();h.value+=V},M={mounted(A){A==null||A.focus()}};return o.onMounted(()=>{document==null||document.addEventListener("keydown",E)}),o.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",E)}),o.watchEffect(()=>{f.value&&(s.error="")}),(A,$)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[f.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"backdrop show",onClick:O,"aria-hidden":"true"})):o.createCommentVNode("",!0),f.value?(o.openBlock(),o.createElementBlock("section",{key:1,class:o.normalizeClass(["sheet show",{sheet_retry:S.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:R},[o.createElementVNode("header",cp,[o.createElementVNode("div",up,o.toDisplayString(m.value),1),S.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["sheet_status",y.value])},o.toDisplayString(c.value),3)):o.createCommentVNode("",!0),o.createElementVNode("button",{class:"sheet_close",onClick:O,"aria-label":"Закрыть"}," Закрыть ")]),o.createElementVNode("div",dp,[o.createElementVNode("div",fp,[o.createElementVNode("div",{class:o.normalizeClass(["nfc",w.value])},[o.createVNode(lp,{styleRetry:B.value},null,8,["styleRetry"]),x.value?(o.openBlock(),o.createBlock(np,{key:0})):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"overlay check",style:o.normalizeStyle({display:T.value?"grid":"none"}),"aria-hidden":"true"},[o.createVNode(sp)],4)],2),o.createElementVNode("h2",hp,o.toDisplayString(p.value),1),o.createElementVNode("p",pp,o.toDisplayString(g.value),1),o.createElementVNode("div",mp,[o.withDirectives(o.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":$[0]||($[0]=V=>h.value=V),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:o.withKeys(H,["enter"])},null,544),[[o.vModelText,h.value],[M]]),S.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:P},"Повторить")):(o.openBlock(),o.createElementBlock("button",{key:1,class:"btn btn_ghost",onClick:$[1]||($[1]=V=>S.value?O:H())},"Отправить"))]),_.value==="wait"&&o.unref(r).kiosk_show_loyalty_phone_input_button?(o.openBlock(),o.createElementBlock("div",_p,[o.createElementVNode("button",{class:"card_phone_auth_button",onClick:b},"Войти по номеру телефона")])):o.createCommentVNode("",!0)])]),o.createElementVNode("input",{ref_key:"cardInputRef",ref:a,type:"text",class:"sr_only","aria-live":"polite"},null,512),o.createElementVNode("div",gp,o.toDisplayString(k.value),1)],2)):o.createCommentVNode("",!0)],64))}}),yp={key:0,class:"wrapper_qr"},bp={key:1,class:"wrapper_qr"},wp={key:2,class:"wrapper_qr"},xp={class:"wrap"},kp=ke(o.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(i){const e=Le(),t=zn(),{cartProducts_lib:n}=J.storeToRefs(e),{orderNumber:r,orderCompleted_lib:s}=J.storeToRefs(t),a=re.useRouter(),l=re.useRoute(),c=()=>{Fn(["cart","authTokensAccess","authTokensRefresh"]),n.value=[],s.value=null,t.clearCard(),e.profile=null,a.replace(`/${l.params.orgId}`)};return(u,d)=>o.unref(s)&&o.unref(s)===1?(o.openBlock(),o.createElementBlock("section",yp,[...d[0]||(d[0]=[o.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-f6831631><i data-v-f6831631></i></div><h1 class="title_fiscal" data-v-f6831631>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-f6831631>Не забудьте <b data-v-f6831631>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-f6831631><div class="printer" data-v-f6831631><div class="led" data-v-f6831631></div><div class="slot" data-v-f6831631></div><div class="receipt" data-v-f6831631><div class="tear" data-v-f6831631></div><div class="line accent" data-v-f6831631></div><div class="line" data-v-f6831631></div><div class="line sm" data-v-f6831631></div><div class="line" data-v-f6831631></div><div class="line sm" data-v-f6831631></div><div class="line" data-v-f6831631></div><div class="line sm" data-v-f6831631></div></div></div></div>',4)])])):o.unref(s)&&o.unref(s)===2?(o.openBlock(),o.createElementBlock("section",bp,[...d[1]||(d[1]=[o.createStaticVNode('<div class="center" data-v-f6831631><div class="stack" data-v-f6831631><h1 class="title_fiscal" data-v-f6831631>Приложите карту для оплаты</h1><p class="reminder" data-v-f6831631>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f6831631><div class="waves" data-v-f6831631><span data-v-f6831631></span><span data-v-f6831631></span><span data-v-f6831631></span></div><div class="nfc" data-v-f6831631><svg viewBox="0 0 24 24" data-v-f6831631><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f6831631></path><path d="M10 6c4 4 4 8 0 12" data-v-f6831631></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f6831631></path></svg></div><div class="card" data-v-f6831631><div class="logo" data-v-f6831631>inno.</div><div class="chip" data-v-f6831631></div><div class="digits" data-v-f6831631>4815 1623 4200 0900</div><div class="holder" data-v-f6831631>Гость</div></div></div></div></div>',1)])])):o.unref(s)&&o.unref(s)===3?(o.openBlock(),o.createElementBlock("section",wp,[o.createElementVNode("div",xp,[d[5]||(d[5]=o.createElementVNode("div",{class:"icon","aria-hidden":"true"},[o.createElementVNode("svg",{viewBox:"0 0 24 24"},[o.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),o.createElementVNode("h1",null,[d[2]||(d[2]=o.createTextVNode(" Ваш заказ ",-1)),o.createElementVNode("span",null,"№ "+o.toDisplayString(o.unref(r)),1),d[3]||(d[3]=o.createTextVNode(" успешно оплачен ",-1))]),d[6]||(d[6]=o.createElementVNode("p",{class:"title_fiscal"},"Спасибо! Заказ передан в работу.",-1)),o.createElementVNode("div",{class:"wrapper_accept"},[o.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:c},[...d[4]||(d[4]=[o.createElementVNode("span",{class:"label"},"Новый заказ",-1),o.createElementVNode("span",{class:"fill","aria-hidden":"true"},null,-1),o.createElementVNode("div",{class:"bubbles","aria-hidden":"true"},null,-1)])])])])])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-f6831631"]]),Sp={},Cp={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Ep(i,e){return o.openBlock(),o.createElementBlock("svg",Cp,[...e[0]||(e[0]=[o.createElementVNode("path",{d:"M19 20H20M16 20H14V17M17 17H20V14H19M14 14H16M4 16.9997C4 16.0679 4 15.6019 4.15224 15.2344C4.35523 14.7443 4.74432 14.3552 5.23438 14.1522C5.60192 14 6.06786 14 6.99974 14C7.93163 14 8.39808 14 8.76562 14.1522C9.25568 14.3552 9.64467 14.7443 9.84766 15.2344C9.9999 15.6019 9.9999 16.0681 9.9999 17C9.9999 17.9319 9.9999 18.3978 9.84766 18.7654C9.64467 19.2554 9.25568 19.6447 8.76562 19.8477C8.39808 19.9999 7.93162 19.9999 6.99974 19.9999C6.06786 19.9999 5.60192 19.9999 5.23438 19.8477C4.74432 19.6447 4.35523 19.2557 4.15224 18.7656C4 18.3981 4 17.9316 4 16.9997ZM14 6.99974C14 6.06786 14 5.60192 14.1522 5.23438C14.3552 4.74432 14.7443 4.35523 15.2344 4.15224C15.6019 4 16.0679 4 16.9997 4C17.9316 4 18.3981 4 18.7656 4.15224C19.2557 4.35523 19.6447 4.74432 19.8477 5.23438C19.9999 5.60192 19.9999 6.06812 19.9999 7C19.9999 7.93188 19.9999 8.39783 19.8477 8.76537C19.6447 9.25542 19.2557 9.64467 18.7656 9.84766C18.3981 9.9999 17.9316 9.9999 16.9997 9.9999C16.0679 9.9999 15.6019 9.9999 15.2344 9.84766C14.7443 9.64467 14.3552 9.25568 14.1522 8.76562C14 8.39808 14 7.93163 14 6.99974ZM4 6.99974C4 6.06786 4 5.60192 4.15224 5.23438C4.35523 4.74432 4.74432 4.35523 5.23438 4.15224C5.60192 4 6.06786 4 6.99974 4C7.93163 4 8.39808 4 8.76562 4.15224C9.25568 4.35523 9.64467 4.74432 9.84766 5.23438C9.9999 5.60192 9.9999 6.06812 9.9999 7C9.9999 7.93188 9.9999 8.39783 9.84766 8.76537C9.64467 9.25542 9.25568 9.64467 8.76562 9.84766C8.39808 9.9999 7.93162 9.9999 6.99974 9.9999C6.06786 9.9999 5.60192 9.9999 5.23438 9.84766C4.74432 9.64467 4.35523 9.25568 4.15224 8.76562C4 8.39808 4 7.93163 4 6.99974Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const Tp=ke(Sp,[["render",Ep]]),Oa=i=>{const e=co(),t=l=>e.open(i,l),n=()=>e.close(i),r=e.state(i),s=o.computed({get:()=>r.value.visible,set:l=>l&&t()||n()}),a=o.computed(()=>r.value.context);return{visible:s,context:a,open:t,close:n}},vp={class:"cart_deletion_modal_content"},Np={class:"cart_deletion_modal_title"},Mp={class:"cart_deletion_modal_footer"},Pp=ke(o.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(i,{emit:e}){const t=e,{visible:n,context:r,close:s}=Oa("cart-delete-confirm"),a=()=>{t("confirm",r.value.idSystem),s()};return(l,c)=>(o.openBlock(),o.createBlock(o.Transition,{name:"fade"},{default:o.withCtx(()=>[o.unref(n)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=o.withModifiers((...u)=>o.unref(s)&&o.unref(s)(...u),["self"]))},[o.createElementVNode("div",vp,[o.createElementVNode("div",Np,"Удалить "+o.toDisplayString(o.unref(r).name)+"?",1),c[2]||(c[2]=o.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),o.createElementVNode("div",Mp,[o.createElementVNode("button",{class:"primary",onClick:a}," Удалить "),o.createElementVNode("button",{onClick:c[0]||(c[0]=(...u)=>o.unref(s)&&o.unref(s)(...u))},"Отмена")])])])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),Ap={class:"cart_wrapper"},Bp={class:"cart_header_content"},Rp={class:"cart_kso_loyal_wrapper"},Dp={key:0},Op={class:"cart_header_wrapper"},$p={class:"cart_header_info"},Ip={class:"cart_header_info"},Vp={class:"cart_header_info"},Lp={class:"cart_header_info"},Fp={key:0},zp={key:0,class:"wrapper_comment"},Up={class:"wrapper_limit_in_area"},Hp={class:"limit_comment"},qp={class:"cart_cards"},Wp={class:"cart_footer_wrapper"},jp={key:0,class:"footer_title"},Xp=["disabled","max"],Yp={key:1,class:"footer_sales"},Gp=["max"],Kp={class:"list_price"},Jp={key:0},Zp={key:1},Qp={key:2},em={class:"accept_field"},tm={class:"accept_field"},nm={key:3},rm={class:"accept_field"},im={class:"accept_field"},om={class:"accept_field"},sm={class:"wrapper_footer_cart_btn"},am=o.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(i){const e=Le(),t=zn(),n=Ge(),r=Ke(),s=i,{totalPrice_lib:a,countBonus:l,config_lib:c,cartProducts_lib:u,profile:d}=J.storeToRefs(e),{itemThemes:h}=J.storeToRefs(n),{textPaymentBtn_lib:_,isButtonDisabled:f,orderCompleted_lib:m,orderNumber:p,extraDiscount:g,is_notification_lib:y,notificationData_lib:w}=J.storeToRefs(t),{isAddToCard:x}=J.storeToRefs(r),T=re.useRouter(),S=re.useRoute(),B=o.ref(!1),k=o.ref(!1),b=o.ref(""),C=o.ref(!1),P=o.ref(0),O=o.ref(!1),H=o.ref(0),R=o.ref(),N=o.computed(()=>{const Y={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return u.value.reduce((U,ie)=>(U.energy_amount+=(ie.energy_amount||0)*(ie.amount||0),U.proteins_amount+=(ie.proteins_amount||0)*(ie.amount||0),U.fat_amount+=(ie.fat_amount||0)*(ie.amount||0),U.carbohydrates_amount+=(ie.carbohydrates_amount||0)*(ie.amount||0),U),Y)}),E=()=>T.push(`/${S.params.orgId}/`),M=Y=>{["a","A","+","-",".",","].includes(Y.key)&&Y.preventDefault()},A=Y=>{e.deleteItemFromCart(Y)},$=()=>{C.value=!C.value,b.value.length},V=()=>{var U,ie,_e;let Y=Math.floor(l.value);Y<0||!Y?Y=0:((U=d.value)==null?void 0:U.balance)>a.value?Y>a.value-1&&(Y=a.value-1):Y>((ie=d.value)==null?void 0:ie.balance)&&(Y=(_e=d.value)==null?void 0:_e.balance),Y!==l.value&&e.setBonus(Y)};o.watchEffect(()=>{V(),e.setBonus(a.value===0?0:Math.floor(l.value))});const F=()=>u.value.map(Y=>({id:Y.id,front_item_id:Y.idSystem,is_fake:!!Y.is_fake,removals:Y.removals??null,amount:Y.amount,size:Y.size,modifiers:Y.modifiers??[],group_modifiers:Y.group_modifiers??[]})),z=async()=>{f.value=!0;try{return await Qt.create().createOrder(F(),s.configPage.tableDataId,s.configPage.kiosk_menu,b.value,!!s.configPage.userData||!!d.value,s.configPage.is_tableservice)}catch(Y){throw s.configPage.kiosk_menu?(Y.status===403&&(localStorage.removeItem("apiKey"),e.is_showApiKey=!0,T.push(`/${S.params.orgId}/retryPage`)),t.deleteCart("retryPage",s.configPage.kiosk_menu)):s.configPage.is_tableservice?t.showNotification(Y.response.data.user_friendly_message):T.push(`/${S.params.orgId}/errorPayment`),f.value=!1,Y}},W=()=>{if(!d.value&&s.configPage.qr_menu){T.push(`/${S.params.orgId}/register`);return}x.value=!1,m.value=1,c.value.has_rms_discount?t.makeInitPaymentLinkRequest(R.value,s.configPage.kiosk_menu,s.configPage.is_tableservice).then(()=>R.value=null):z()},Z=async()=>{var ie;g.value=0,f.value=!0;const Y={items:[...F()],combos:[]},U=Qt.create();try{O.value=!0;const _e=await U.calculateDiscount(Y,s.configPage.kiosk_menu,!!s.configPage.userData||!!d.value);if(!u.value)return;if(u.value.forEach(ce=>{const ye=_e.items.find(ge=>ge.front_item_id===ce.idSystem);if(ye&&(ce.group_modifiers.forEach(ge=>{const se=ye.group_modifiers.find(pe=>pe.group===ge.group);se&&ge.modifiers.forEach(pe=>{const ne=se.modifiers.find(mn=>mn.id===pe.id);if(ne&&Number(pe.price)!==Number(ne==null?void 0:ne.new_price)){const mn=(ne.discounts||[]).reduce((ot,_t)=>ot+=+_t.discount,0);P.value+=mn,pe.new_price=pe.price,pe.price=Number(ne==null?void 0:ne.new_price),pe.total_new_price=Number(ne.total_new_price)}})}),ce.modifiers.forEach(ge=>{const se=ye.modifiers.find(pe=>pe.id===ge.id);if(se&&Number(ge.price)!==Number(se==null?void 0:se.new_price)){const pe=(se.discounts||[]).reduce((ne,mn)=>ne+=+mn.discount,0);P.value+=pe,ge.new_price=ge.price,ge.price=Number(se==null?void 0:se.new_price),ge.total_new_price=Number(se.total_new_price)}}),ce.price!==Number(ye.new_price))){const ge=(ye.discounts||[]).reduce((se,pe)=>se+=+pe.discount,0);P.value=P.value+ge,ce.new_price=ce.price,ce.price=ye.new_price,ce.discounts=ye.discounts,ce.total_new_price=Number(ye.total_new_price)}}),u.value=[...u.value],P.value!==0&&(a.value=_e.total_cart_price),c.value.has_rms_discount){const ce=await z();R.value=(ie=ce.data)==null?void 0:ie.id}else f.value=!1;k.value=!1}catch(_e){console.log("Ошибка скидок [CartPage calculateDiscount]",_e),t.showNotification("Скидки временно недоступны"),O.value=!1,k.value=c.value.has_rms_discount,f.value=!1}},K=()=>{var Y;(Y=d.value)!=null&&Y.balance?d.value.balance>=1&&(B.value=!B.value):t.showNotification("У Вас пока нет бонусов")},ue=()=>{var Y,U;c.value.has_rms_discount?(R.value=null,k.value=!0):((Y=c.value)==null?void 0:Y.loyalty)==="IIKO"&&(c.value.has_loyalty_default_user||d.value)&&s.configPage.kiosk_menu||((U=c.value)==null?void 0:U.loyalty)==="IIKO"&&s.configPage.qr_menu&&d.value?k.value=!0:k.value=!1};return o.onMounted(async()=>{_.value=s.textPaymentBtn,e.loadCart(),m.value=null,a.value=null,g.value=0,u.value.splice(0,u.value.length,...u.value.map(e.makeProductFullyReactive))}),o.onUnmounted(()=>{R.value=null,m.value=null,a.value=null,g.value=0,u.value.splice(0,u.value.length,...u.value.map(e.makeProductFullyReactive))}),o.watchEffect(()=>{!c.value.has_rms_discount&&["ОПЛАТИТЬ","СОЗДАТЬ ЗАКАЗ"].includes(_.value.toUpperCase())?f.value=e.cartProducts_lib.length===0||a.value===0:(f.value=!1,m.value=null)}),o.watch([()=>e.cartProducts_lib,d],Y=>{if(H.value>0){H.value--;return}Y&&!O.value&&(ue(),u.value.splice(0,u.value.length,...u.value.map(e.makeProductFullyReactive)),P.value=0,a.value=null,g.value=0,H.value=1),O.value=!1},{deep:!0}),(Y,U)=>{var ie,_e,ce,ye,ge;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Ap,[o.createVNode(Pp,{onConfirm:A}),o.createVNode(Ba,{visible:o.unref(t).isDrawerOpen,"onUpdate:visible":U[0]||(U[0]=se=>o.unref(t).isDrawerOpen=se)},{default:o.withCtx(()=>[o.createVNode(Da)]),_:1},8,["visible"]),o.createElementVNode("header",Bp,[o.createElementVNode("div",Rp,[o.createElementVNode("div",{class:o.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:E},[o.createVNode(so,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(o.openBlock(),o.createElementBlock("span",Dp,"Назад")):o.createCommentVNode("",!0)],2)]),o.createElementVNode("div",Op,[(o.unref(h).kiosk_show_loyalty_card_button||o.unref(h).kiosk_show_loyalty_phone_input_button)&&!s.config_qr?(o.openBlock(),o.createElementBlock("button",{key:0,class:"buttonDefaultWrapper button_payment_cart button_payment_cart_loyal",onClick:U[1]||(U[1]=(...se)=>o.unref(t).openDrawer&&o.unref(t).openDrawer(...se))},[U[6]||(U[6]=o.createElementVNode("p",{class:"cart_loyal_program"},"Программа лояльности",-1)),o.createVNode(Tp,{class:"cart_loyal_qr"})])):o.createCommentVNode("",!0),o.unref(h).show_nutrition_in_cart?(o.openBlock(),o.createElementBlock("div",{key:1,class:"cart_header",style:o.normalizeStyle({paddingTop:s.config_qr?0:"10px"})},[o.createElementVNode("div",$p,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.energy_amount,duration:800},null,8,["price"]),U[7]||(U[7]=o.createTextVNode(" г",-1))]),U[8]||(U[8]=o.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),o.createElementVNode("div",Ip,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.proteins_amount,duration:900},null,8,["price"]),U[9]||(U[9]=o.createTextVNode(" г",-1))]),U[10]||(U[10]=o.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),o.createElementVNode("div",Vp,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.fat_amount,duration:1e3},null,8,["price"]),U[11]||(U[11]=o.createTextVNode(" г",-1))]),U[12]||(U[12]=o.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),o.createElementVNode("div",Lp,[o.createElementVNode("p",null,[o.createVNode(Mt,{price:N.value.carbohydrates_amount,duration:1100},null,8,["price"]),U[13]||(U[13]=o.createTextVNode(" г",-1))]),U[14]||(U[14]=o.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):o.createCommentVNode("",!0)])]),i.config_qr&&o.unref(h).show_order_comment?(o.openBlock(),o.createElementBlock("div",Fp,[C.value?(o.openBlock(),o.createElementBlock("div",zp,[o.createElementVNode("div",Up,[o.withDirectives(o.createElementVNode("textarea",{class:"comment_order",placeholder:"Ваш комментарий к заказу...",name:"comment",maxlength:"50","onUpdate:modelValue":U[2]||(U[2]=se=>b.value=se)},null,512),[[o.vModelText,b.value]]),o.createElementVNode("p",Hp,o.toDisplayString(b.value.length+" / 50"),1)]),o.createVNode(en,{textButtonDefault:"Сохранить",onClick:$,class:"button_bonus_cart"})])):o.createCommentVNode("",!0),!C.value&&o.unref(u).length>0?(o.openBlock(),o.createBlock(en,{key:1,textButtonDefault:b.value.length>0?"Редактировать":"Комментарий к заказу",onClick:()=>C.value=!C.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",qp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(u),se=>(o.openBlock(),o.createBlock(Ra,{key:se.idSystem,cardItem:se,onDelete:pe=>A(se.idSystem)},null,8,["cardItem","onDelete"]))),128))]),o.createElementVNode("div",Wp,[B.value?(o.openBlock(),o.createElementBlock("p",jp,[U[15]||(U[15]=o.createTextVNode(" Списать ",-1)),o.withDirectives(o.createElementVNode("input",{type:"number",placeholder:"0",style:o.normalizeStyle({maxWidth:`${o.unref(l).toString().length||1}em`}),disabled:o.unref(d)===null||((ie=o.unref(d))==null?void 0:ie.balance)===0,"onUpdate:modelValue":U[3]||(U[3]=se=>o.isRef(l)?l.value=se:null),onInput:V,min:"0",max:((_e=o.unref(d))==null?void 0:_e.balance)>o.unref(a)?Math.floor(o.unref(a)):(ce=o.unref(d))==null?void 0:ce.balance,onKeypress:M},null,44,Xp),[[o.vModelText,o.unref(l),void 0,{number:!0}]]),U[16]||(U[16]=o.createTextVNode(" бонусов ",-1))])):o.createCommentVNode("",!0),B.value?(o.openBlock(),o.createElementBlock("p",Yp,"У вас есть "+o.toDisplayString(o.unref(d)?o.unref(d).balance:0)+" B",1)):o.createCommentVNode("",!0),B.value?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:2,type:"range",class:"footer_range","onUpdate:modelValue":U[4]||(U[4]=se=>o.isRef(l)?l.value=se:null),min:0,max:((ye=o.unref(d))==null?void 0:ye.balance)>o.unref(a)?Math.floor(o.unref(a)-1):(ge=o.unref(d))==null?void 0:ge.balance},null,8,Gp)),[[o.vModelText,o.unref(l),void 0,{number:!0}]]):o.createCommentVNode("",!0),o.createElementVNode("ul",Kp,[B.value?(o.openBlock(),o.createElementBlock("li",Jp,[U[18]||(U[18]=o.createElementVNode("p",null,"Сумма заказа:",-1)),o.createElementVNode("p",null,[o.createVNode(Mt,{price:o.unref(a),fixedFloat:2},null,8,["price"]),U[17]||(U[17]=o.createTextVNode(" ₽",-1))])])):o.createCommentVNode("",!0),B.value?(o.openBlock(),o.createElementBlock("li",Zp,[U[20]||(U[20]=o.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),o.createElementVNode("p",null,[o.createVNode(Mt,{price:o.unref(l),fixedFloat:2},null,8,["price"]),U[19]||(U[19]=o.createTextVNode(" Б",-1))])])):o.createCommentVNode("",!0),o.unref(g)!==0?(o.openBlock(),o.createElementBlock("li",Qp,[o.createElementVNode("p",em,o.toDisplayString(o.unref(g)>0?"Надбавка":"Скидка")+": ",1),o.createElementVNode("p",tm,[o.createVNode(Mt,{price:Math.abs(o.unref(g)),fixedFloat:2},null,8,["price"]),U[21]||(U[21]=o.createTextVNode(" ₽",-1))])])):P.value!==0?(o.openBlock(),o.createElementBlock("li",nm,[o.createElementVNode("p",rm,o.toDisplayString(P.value>0?"Надбавка":"Скидка")+": ",1),o.createElementVNode("p",im,[o.createVNode(Mt,{price:Math.abs(P.value),fixedFloat:2},null,8,["price"]),U[22]||(U[22]=o.createTextVNode(" ₽",-1))])])):o.createCommentVNode("",!0),o.createElementVNode("li",null,[U[24]||(U[24]=o.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),o.createElementVNode("p",om,[o.createVNode(Mt,{price:o.unref(a)-o.unref(l),fixedFloat:2},null,8,["price"]),U[23]||(U[23]=o.createTextVNode(" ₽",-1))])])]),o.createElementVNode("div",sm,[o.unref(d)?(o.openBlock(),o.createBlock(en,{key:0,textButtonDefault:"Бонусы",onClick:K,class:"button_bonus_cart"})):o.createCommentVNode("",!0),o.createVNode(en,{textButtonDefault:k.value?"Рассчитать скидки":o.unref(_),onClick:k.value?Z:W,class:"button_payment_cart",disabled:o.unref(f)},null,8,["textButtonDefault","onClick","disabled"])])])]),i.configPage.kiosk_menu?(o.openBlock(),o.createBlock(kp,{key:0,orderNumber:o.unref(p),pageNumber:1},null,8,["orderNumber"])):o.createCommentVNode("",!0),o.createVNode(lo,{visible:o.unref(y),"onUpdate:visible":U[5]||(U[5]=se=>o.isRef(y)?y.value=se:null),textNotificationDefault:o.unref(w).textNotification,backgroundColor:o.unref(h).accent_color?o.unref(h).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"])],64)}}}),lm={},cm={viewBox:"0 0 24 24"};function um(i,e){return o.openBlock(),o.createElementBlock("svg",cm,[...e[0]||(e[0]=[o.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const dm=ke(lm,[["render",um]]),fm={class:"retry_screen"},hm={class:"retry_all_in_screen"},pm={class:"retry_content"},mm={class:"retry_icon_wrap"},_m={class:"retry_icon_circle"},gm={class:"retry_error_x"},ym=o.defineComponent({__name:"RetryPage",setup(i){const e=zn(),t=re.useRouter(),n=re.useRoute(),r=Le(),s=()=>{e.notificationData_lib.textNotification="",e.is_notification_lib=!1,r.openApiKey=!0,t.replace(`/${n.params.orgId}/`)};return(a,l)=>(o.openBlock(),o.createElementBlock("section",fm,[o.createElementVNode("div",hm,[o.createElementVNode("main",pm,[o.createElementVNode("div",mm,[o.createElementVNode("div",_m,[l[0]||(l[0]=o.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),o.createElementVNode("div",gm,[o.createVNode(dm)])])]),l[1]||(l[1]=o.createElementVNode("div",{class:"retry_oops"},"OOPS",-1)),l[2]||(l[2]=o.createElementVNode("h1",{class:"retry_title"},"Что-то пошло не так",-1)),l[3]||(l[3]=o.createElementVNode("div",{class:"retry_hint"},[o.createElementVNode("p",null,"Похоже, произошёл технический сбой."),o.createElementVNode("p",null,"Мы уже знаем о проблеме и сейчас разбираемся."),o.createElementVNode("p",null,"Приносим извинения за доставленные неудобства."),o.createElementVNode("p",null,"Попробуйте начать новый заказ.")],-1))]),o.createElementVNode("div",{class:"retry_footer"},[o.createElementVNode("button",{onClick:s,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=o.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),bm={class:"wrapper_loader"},wm=o.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(i){return(e,t)=>(o.openBlock(),o.createElementBlock("div",bm,[o.createElementVNode("div",{class:"loader",style:o.normalizeStyle({width:i.size})},null,4)]))}}),xm={class:"opacity-animation"},km=ke(o.defineComponent({__name:"AnimationLoader",props:{key:{}},setup(i){const e=o.ref(!0);return o.watch(()=>e.value,()=>{e.value=!1,setTimeout(()=>{e.value=!0},0)}),(t,n)=>(o.openBlock(),o.createElementBlock("div",xm,[o.renderSlot(t.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-26479273"]]),Sm={key:0},Cm={class:"card__main__wrapper"},Em={key:0,class:"folder_content_top"},Tm={key:0,class:"loader_card_main"},vm={key:1,class:"card__main_content"},Nm=["src","alt"],Mm={class:"card_title_price_wrapper"},Pm={class:"title"},Am={key:0,class:"price"},Bm={key:1,class:"card_button_add_wrapper"},$a=ke(o.defineComponent({__name:"CardMain",props:{data:{type:Object,required:!0},activeTags:{type:Object,required:!1,default:[]},is_product:{type:Boolean,default:!0},is_group:{type:Boolean,default:!1},parent:{type:String,required:!1},isLoading:{type:Boolean,default:!1},selectGroupChild:{type:Function,required:!1},takeCurrentCard:{type:Function,required:!1}},setup(i){const e=i,t=Ge(),n=Le(),{is_18_above_content:r,is18Allowed:s}=J.storeToRefs(n),{itemThemes:a}=J.storeToRefs(t),l=(u,d)=>{if(u.adult&&!s.value){r.value=!0;return}if(u.amount||(u.amount=1),e.is_group&&e.selectGroupChild){e.selectGroupChild({...u,parent:e.parent,child:d.child_groups});return}e.takeCurrentCard&&e.takeCurrentCard(d.id)},c=u=>{if(e.is_group&&e.selectGroupChild){u={...u,parent:e.parent,child:u.child_groups},e.selectGroupChild(u);return}if(u.adult&&!s.value){r.value=!0;return}e.takeCurrentCard&&e.takeCurrentCard(u.id)};return(u,d)=>e.activeTags.length===0||e.activeTags.every(h=>e.data.tags.includes(h))?(o.openBlock(),o.createElementBlock("div",Sm,[(o.openBlock(),o.createBlock(km,{key:e.data.id},{opacityLoader:o.withCtx(()=>[o.createElementVNode("div",Cm,[i.is_group?(o.openBlock(),o.createElementBlock("div",Em)):o.createCommentVNode("",!0),o.createElementVNode("div",{onClick:d[0]||(d[0]=h=>c(e.data)),class:o.normalizeClass(["card__main",{card__main_folder:i.is_group}])},[i.isLoading?(o.openBlock(),o.createElementBlock("div",Tm,[o.createVNode(wm)])):(o.openBlock(),o.createElementBlock("div",vm,[o.createElementVNode("img",{src:e.data.image_link||o.unref(a).fallback_image||"",class:o.normalizeClass(["img",{card_blur_image:e.data.adult&&!o.unref(s)}]),loading:"lazy",alt:i.data.name},null,10,Nm),o.createElementVNode("div",Mm,[o.createElementVNode("p",Pm,o.toDisplayString(i.data.name),1),i.is_group?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("p",Am,o.toDisplayString(o.unref(dr)(i.data))+" ₽",1))])]))],2),i.is_group?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Bm,[o.createElementVNode("div",{onClick:d[1]||(d[1]=h=>l(i.data,e.data)),class:"add_button"},[...d[2]||(d[2]=[o.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1}))])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-56a6b046"]]),Rm=["id","onClick"],Dm=ke(o.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(i){const e=o.ref(null);return(t,n)=>i.menuGroup.length?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:e},[o.createVNode(io,{axis:"x",behavior:"smooth",container:e.value,autoScroll:!0,idActive:i.idActiveGroup,clearContainer:!0},{default:o.withCtx(({handleTargetClick:r})=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.menuGroup,(s,a)=>(o.openBlock(),o.createElementBlock("li",{key:s.id,id:"scrolling"+s.id,onClick:l=>{i.activeTakeGroup&&i.activeTakeGroup(s.id,a),r(l)},style:o.normalizeStyle(i.idActiveGroup==s.id?{fontFamily:"Bounded"}:{})},o.toDisplayString(s.name),13,Rm))),128))]),_:1},8,["container","idActive"])],512)):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Om=["id","onClick"],$m=ke(o.defineComponent({__name:"TagsMain",props:{menuTags:{default:()=>[]},groupIndex:{default:null},isSolo:{type:Boolean,default:!1},currentActiveTag:{},activeTakeTags:{type:Function,default:void 0},activeTakeTagsSolo:{type:Function,default:void 0}},setup(i){const e=i,t=o.ref(null),n=o.computed(()=>e.isSolo&&e.groupIndex!==void 0?e.currentActiveTag:e.currentActiveTag[e.groupIndex]);return(r,s)=>i.menuTags.length>0?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:t},[o.createVNode(io,{axis:"x",behavior:"smooth",container:t.value,autoScroll:!0,idActive:n.value?n.value[i.currentActiveTag.length-1]:null,clearContainer:!1},{default:o.withCtx(({handleTargetClick:a})=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.menuTags,(l,c)=>(o.openBlock(),o.createElementBlock("li",{key:c,id:`scrolling${l}`,onClick:u=>{i.activeTakeTags&&(i.groupIndex||i.groupIndex===0)?i.activeTakeTags(l,i.groupIndex):i.activeTakeTagsSolo&&i.activeTakeTagsSolo(l),a(u)},class:o.normalizeClass({main__filter_active:n.value.includes(l)})},o.toDisplayString(l),11,Om))),128))]),_:1},8,["container","idActive"])],512)):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-49c107f2"]]),Ia=J.defineStore("imageCache",()=>{const i=o.ref({});async function e(a){const l=String(a);if(i.value[l])return;const c=await Ma(a);if(!c)return;const u=URL.createObjectURL(c);i.value[l]=u,window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:l,blob:c}}))}async function t(a){await Promise.all(a.map(l=>e(l)))}function n(a,l){const c=String(a);i.value[c]&&URL.revokeObjectURL(i.value[c]),i.value[c]=URL.createObjectURL(l)}function r(a){return o.computed(()=>i.value[String(a)]||null)}function s(){Object.values(i.value).forEach(URL.revokeObjectURL),i.value={}}return{cache:i,initCacheSingle:e,initCache:t,setImage:n,getImageUrl:r,cleanup:s}});function Im(i,e=""){const t=Ia(),{initCacheSingle:n,getImageUrl:r}=t,s=o.ref(null),a=r(i);return o.watch(a,l=>{l&&(s.value=l)},{immediate:!0}),a.value?s.value=a.value:n(i).then(()=>{s.value=r(i).value||e}),{mediaUrl:o.computed(()=>s.value||e),isLoading:o.computed(()=>!s.value||s.value===e)}}const Vm=["data-id"],Lm={key:0,loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},Fm=["src"],zm=["src"],Um=ke(o.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(i){const e=i,{mediaUrl:t}=Im(e.group.id,e.group.video_link||e.group.image_link||"");return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["drum_item",{active:e.active}]),"data-id":i.group.id},[i.group.video_link?(o.openBlock(),o.createElementBlock("video",Lm,[o.createElementVNode("source",{src:o.unref(t)||"",type:"video/webm"},null,8,Fm)])):(o.openBlock(),o.createElementBlock("img",{key:1,class:"drum_img",src:o.unref(t)||""},null,8,zm)),o.createElementVNode("p",null,o.toDisplayString(i.group.name),1)],10,Vm))}}),[["__scopeId","data-v-38338744"]]),Hm={},qm={width:"9.998535",height:"10.000000",viewBox:"0 0 9.99854 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"};function Wm(i,e){return o.openBlock(),o.createElementBlock("svg",qm,[...e[0]||(e[0]=[o.createElementVNode("desc",null," Created with Pixso. ",-1),o.createElementVNode("defs",null,null,-1),o.createElementVNode("path",{id:"Форма 5",d:"M4.23 10L5.76 10L5.76 5.74L9.99 5.74L9.99 4.25L5.76 4.25L5.76 0L4.23 0L4.23 4.25L0 4.25L0 5.74L4.23 5.74L4.23 10Z",fill:"#F2F7FF","fill-opacity":"1.000000","fill-rule":"nonzero"},null,-1)])])}const jm=ke(Hm,[["render",Wm]]),Xm={class:"recommendation_wrapper"},Ym={class:"recommendation_header"},Gm={class:"recommendation_info"},Km=ke(o.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(i){const e=Ke(),{isUpSale:t,dataUpSale:n}=J.storeToRefs(e),r=()=>{t.value=!1};return o.onUnmounted(()=>{n.value=null}),(s,a)=>(o.openBlock(),o.createElementBlock("div",Xm,[o.createElementVNode("div",Ym,[a[0]||(a[0]=o.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),o.createElementVNode("div",{class:"header_close",onClick:r},[o.createVNode(jm,{class:"close_icon"})])]),o.createElementVNode("div",Gm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(n),l=>(o.openBlock(),o.createBlock($a,{data:l,key:l.id,parent:l.id,is_group:!1,is_product:!0,class:"card",closeCurrentCard:i.closeCurrentCard,takeCurrentCard:()=>i.openCurrentCard(l.id,!0)},null,8,["data","parent","closeCurrentCard","takeCurrentCard"]))),128))])]))}}),[["__scopeId","data-v-abf4717f"]]),Jm={class:"wrapper_modal"},Zm={class:"card_modal"},Qm=ke(o.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(i){const e=i,t=Ke(),{isUpSale:n}=J.storeToRefs(t),r=()=>{n.value=!1};return(s,a)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(Aa,{data:e.visible},null,8,["data"]),o.createElementVNode("div",{class:"black_modal",onClick:r}),o.createElementVNode("div",Jm,[o.createElementVNode("div",Zm,[o.renderSlot(s.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]);function Ht(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Va(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}/*!
|
|
7
7
|
* GSAP 3.14.1
|
|
8
8
|
* https://gsap.com
|
|
9
9
|
*
|